The context free grammar for the language L = {an bm | n ≤ m + 3, n ≥ 0, m ≥…

PYQ UGC NET 2013Modified — slightly modified from the official paper; see the solution

The context free grammar for the language

L = {an bm | n ≤ m + 3, n ≥ 0, m ≥ 0} is

  1. A.

    S → aaa A; A → aAb | B, B → Bb | λ

  2. B.

    S → aaaA|λ, A → aAb | B, B → Bb | λ

  3. C.

    S → aaaA | aa A | λ, A → aAb | B, B → Bb| λ

  4. D.

    S → aaaA | aaA | aA | A, A → aAb | B, B → Bb | λ

Attempted by 44 students.

Sign up free to check your answer

Sign up free

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…