Statement for Linked Answer Questions 78 and 79: A CFG G is given with the…

GATE · 2008 · IT

Statement for Linked Answer Questions 78 and 79:

A CFG G is given with the following productions where S is the start symbol, A is a non-terminal and a and b are terminals.

S→aS∣A

A→aAb∣bAa∣ϵ

Which of the following strings is generated by the grammar above?

  1. A.

    aabbaba

  2. B.

    aabaaba

  3. C.

    abababb

  4. D.

    aabbaab

Attempted by 63 students.

Show answer

Correct answer: D

The worked solution is available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…