GATE Computer ScienceModerateGATE CS (PYQ pattern)

Which of the following classes of languages is closed under complement but NOT under union?

  1. A. Regular languages
  2. B. Recursive (decidable) languages
  3. C. Deterministic context-free languages
  4. D. Context-free languages

Correct answer: C. Deterministic context-free languages

DCFLs are closed under complement, but { aⁱbʲcᵏ : i = j } ∪ { aⁱbʲcᵏ : j = k } (both DCFLs) is inherently ambiguous, hence not a DCFL. Regular and recursive languages are closed under both; CFLs are closed under union but not complement.

More Theory of Computation questions

Exams that ask this topic