Consider the following grammar S-> PQ P-> aP | b Q-> bQ | a Consider the…

Consider the following grammar

S-> PQ

P-> aP | b

Q-> bQ | a

Consider the following statements.

S1: The grammar has different LMD and RMD for string abba.

S2: The grammar is ambiguous.

Select the correct option.

  1. A.

    Both S1 and S2 are true

  2. B.

    Both S1 and S2 are false

  3. C.

    S1 is true but S2 is false

  4. D.

    S1 is false but S2 is true

Attempted by 83 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…