Given the production rules of a grammar G1 as
$S_1 \rightarrow AB \mid aaB$
$A \rightarrow a \mid Aa$
$B \rightarrow b$
and the production rules of a grammar G2 as
$S_2 \rightarrow aS_2bS_2 \mid bS_2 aS_2 \mid \lambda$
Which of the following is correct statement?
Here both G1 and G2 are ambiguous
G1 : We can generate 2 parse tree for string aab
/ \ / | \
A B a a B
/ \ \ \
A a b b
G2: We can generate more than one parse tree for abab , baba etc.
Hence,Option(B)G1 is ambiguous and G2 is ambiguous .