GATE Computer ScienceModerateGATE CS (PYQ pattern)

The language generated by S → TT, T → aTb | ε is

  1. A. { aⁿbⁿaᵐbᵐ : n, m ≥ 0 }
  2. B. { aⁿbⁿaⁿbⁿ : n ≥ 0 }
  3. C. { aⁿbᵐaⁿbᵐ : n, m ≥ 0 }
  4. D. { (aⁿbⁿ)* : concatenations of any number of blocks aⁿbⁿ }

Correct answer: A. { aⁿbⁿaᵐbᵐ : n, m ≥ 0 }

Each T independently produces aⁿbⁿ, so two independent blocks give aⁿbⁿaᵐbᵐ with n and m unrelated. Three or more blocks cannot occur (not a star), and equality of n with m is not enforced.

More Theory of Computation questions

Exams that ask this topic