GATE Computer ScienceModerateGATE CS (PYQ pattern)

Over the alphabet {a, b, c}, what is the status of the complement of { aⁿbⁿcⁿ : n ≥ 0 }?

  1. A. Not context-free (context-sensitive only)
  2. B. Context-free but not deterministic context-free
  3. C. Deterministic context-free (accepted by a DPDA)
  4. D. Regular (accepted by a finite automaton)

Correct answer: B. Context-free but not deterministic context-free

The complement is the union of strings not of the form a*b*c* (regular) and a^i b^j c^k with i ≠ j or j ≠ k (CFL), so it is context-free. If it were a DCFL, its complement aⁿbⁿcⁿ would be a DCFL (DCFLs are closed under complement), but aⁿbⁿcⁿ is not even context-free.

More Theory of Computation questions

Exams that ask this topic