The language L = { aⁿ bⁿ aᵐ bᵐ | n ≥ 0, m ≥ 0 } is

2013

The language L = { aⁿ bⁿ aᵐ bᵐ | n ≥ 0, m ≥ 0 } is

  1. A.

    Context free but not linear

  2. B.

    Context free and linear

  3. C.

    Not context free and not linear

  4. D.

    Not context free but linear

Attempted by 30 students.

Show answer & explanation

Correct answer: A

The language L is the concatenation of two context-free languages {a^n b^n}. Since CFLs are closed under concatenation, L is context-free. However, it cannot be generated by a linear grammar because two independent nested structures require multiple non-terminals simultaneously.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…