Professional Documents
Culture Documents
Assignment No 03
Assignment No 03
Assignment No 03
03
ODD SEM 2022 - 2023
S -> aB | bA
A -> a | aS | bAA
B -> b | bS | aBB
Find leftmost derivation, right most derivation and parse tree for the string “ bbaaabbaba ”
S -> SAS
S -> b
A -> ba
A -> b
for the sttring “ bbabbbbab ” derive Left most derivation,Rightmost derivation,Parse tree.
S -> abAB
A -> bAB | Ɛ
B -> Baa | A | Ɛ
Q5. Consider the following grammer
S -> ASB | Ɛ
A -> aAS | a
B -> SbS | A | bb
Put the above grammer in Chomsky normal form.
S -> bA | aB
A -> bAA | aS | a
B -> aBB | bS | b
S -> AACD
A -> aAb | Ɛ
C -> aC | a
D -> aDa | bDb | Ɛ
Q8.Consider the following grammer G = {V,T,P,S},V= {S,X}, T ={A,B} and productions P are
S -> aSb | aX
X -> Xa | Sa | a
convert this grammer in greibach Normal form (GNF).
S -> XA | BB
B-> b| SB
X -> b
A -> a
Q9.Conver the following grammar in GNF
S -> AA | 0
A -> SS | 1
S -> XY1 | 0
X -> 00X | Y
Y -> 1X1