GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Which of the following problems is decidable?

  1. A. Given a CFG G and a DFA D, is L(D) ⊆ L(G)?
  2. B. Given CFGs G₁ and G₂, is L(G₁) ∩ L(G₂) = ∅?
  3. C. Given a CFG G, is the complement of L(G) context-free?
  4. D. Given a CFG G and a DFA D, is L(G) ⊆ L(D)?

Correct answer: D. Given a CFG G and a DFA D, is L(G) ⊆ L(D)?

L(G) ⊆ L(D) ⇔ L(G) ∩ complement(L(D)) = ∅, and that intersection is a CFL whose emptiness is decidable. The reverse inclusion contains 'is L(G) = Σ*?' (take D accepting Σ*), which is undecidable. CFG intersection emptiness reduces from PCP, and whether a complement is context-free is undecidable as well.

More Theory of Computation questions

Exams that ask this topic