Solution:
Given grammar,
S -> ASB
A -> aAS | a |
B -> SbS | A | bb
(a)
Explanation:
=>Epsilon productions are production rules which contains epsilon().
=>Epsion production = A ->
Removing epsilon production:
=>Place the combination with and without epsilon to remove epsilon production.
S -> ASB | SB
A -> aAS | a | aS
B -> SbS | A | bb
(b)
Explanation:
=>Unit productions are of type X -> Y where X can be set of non terminals and Y is single non terminal.
=>Unit productions = B -> A
Removing unit production:
=>Replace the value of A in place of A to remove unit production.
S -> ASB | SB
A -> aAS | a | aS
B -> SbS | aAS| a | aS | bb
(c)
Explanation:
Converting into Chomsky normal form(CNF):
Step 1:
=>As start symbol S appears at the right hand side of production so addig a new production rule S1 -> S
S1 -> S
S -> ASB | SB
A -> aAS | a | aS
B -> SbS | aAS| a | aS | bb
Step 2:
=>Removing unit production S1 -> S
S1 -> ASB | SB
S -> ASB | SB
A -> aAS | a | aS
B -> SbS | aAS| a | aS | bb
Step 3:
=>Converting into the fors X -> YZ, T -> a
S1 -> PB | SB
S -> PB | SB
A -> TS | a | QS
B -> US | TS | a | QS | RR
P -> AS
Q -> a
R -> b
T -> QS
U -> SR
I have explained each and every part with the help of statements attached to it.
S->ASB A-> AS a B -> Sbs Albb (a) Identify and remove the l-productions. (b) Identify...
Given the following Grammar G, S->ASB A-> AS a B-> Sbs Albb (a) Identify and remove the A-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form.
Given the following Grammar G, S->ASB A-> AS a B-> Sbs Albb Identify and remove the -productions. Identify and remove unit-productions Convert it to Chomsky Normal Form.
Given the following Grammar G, S->ASB A -> AAS | a B -> Sbs | A|bb (a) Identify and remove the A-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form.
please show full work and answer! 1. (20 points) Given the following Grammar G, S->ASB A -> AS | a | 1 B -> Sbs | Albb (a) Identify and remove the N-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form.
1. (20 points) Given the following Grammar G, S->ASB A -> aAS | a | λ B -> SbS | A|bb (a) Identify and remove the λ-productions. (b) Identify and remove unit-productions from the result of (a). (c) Convert it to Chomsky Normal Form. 1. (20 points) Given the following Grammar G, S->ASB A -> AS | a 1a B -> Sbs | Albb (a) Identify and remove the -productions. (b) Identify and remove unit-productions from the result of (a)....
Consider a grammar: S --> | aS | SS SSb | Sbs, Where T={a,b} V={S }. Show that the grammar is ambiguous. What is the language generated by this grammar?
Consider a grammar: S --> | as SS SSb Sbs, Where T={a,b} V={S}. a. Show that the grammar is ambiguous. b. What is the language generated by this grammar?
6.(20) Let G=(V, S, R, S) be a grammar with V = {Q, R, T}; { = {q, r,ts}; and the set of rules: SQ Qq RqT R~rrt Qor T>t | ST a. (5) Convert G to a PDA using the method we described. b. (15) Convert G to Chomsky normal form.
Consider a grammar : S --> a | aS | bSS | SSb | SbS, Where T={a,b} V={S }. a. Show that the grammar is ambiguous. b. What is the language generated by this grammar? 2. (20 points) Consider a grammar: S -->a | aS | SS | Ssb | Sbs, Where T={a,b} V={S}. a. Show that the grammar is ambiguous. b. What is the language generated by this grammar?
Let G = (V, S, R, S) be a grammar with V = {Q, R, T}; { = {q, r,ts}; and the set of rules: SQ Q→ RqT RrrT QQr T>t | StT b. (15) Convert G to Chomsky normal form.