Are these two grammars similar?

29 Views Asked by At

Language is

L = {a^nb^m | n.m >=1}

Grammar 1 :

 S->AB
 B -> bB|b
 A-> aA|a

Grammar 2 :

S->aSB|epsilon
B -> b|epsilon
1

There are 1 best solutions below

0
On BEST ANSWER

The second grammar can generate epsilon whereas the first one can not, so they are not equivalent. Since epsilon is not in $L$, only the first grammar generates $L$.