Ideas Solution

Q No 01

Solution:

NP -> Adj NP

The draw parse trees for above given grammar:

The above given grammar have only one parse tree so it is non-ambiguous grammar.

NP -> NP Conj NP

The draw parse trees for above given grammar:

The above grammar has two different parse trees therefore the given grammar is ambiguous.

NP -> Adj N

The draw parse trees for above given grammar:

The above given grammar have only one parse tree so it is non-ambiguous grammar.

NP ->N

The draw parse trees for above given grammar:

The above given grammar have only one parse tree so it is non-ambiguous grammar.

Adj -> Young

The draw parse trees for above given grammar:

The above given grammar have only one parse tree so it is non-ambiguous grammar.

Conj -> and

The draw parse trees for above given grammar:

The above given grammar have only one parse tree so it is non-ambiguous grammar.

N -> Boys | Girls

The draw parse trees for above given grammar:

The above given grammar have only one parse tree so it is non-ambiguous grammar.

Q No 02

Solution:

The given grammar is

S -> S + S | S / S | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19

The draw parse trees for above given grammar:

Parse Trees:

The above grammar has two different parse trees therefore the given grammar is ambiguous.

THE END!