Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the…

HPSC Teaching and Computer Science 2022

Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the terminal alphabet, S as the start symbol and the following set of production rules :

S → bA S → aB
A → a B → b
A → aS B → bS
S → bAA B → aBB

Which of the following strings is generated by the grammar?

  1. A.

    aaaabb

  2. B.

    aabbbb

  3. C.

    aabbab

  4. D.

    Abbba

Attempted by 76 students.

Sign up free to check your answer

Sign up free

Explore the full course: Bpsc

Loading lesson…