GATE Computer ScienceVery hardGATE CS

Let D be a DFA and G a context-free grammar over the same alphabet. Consider the problems: I. Is L(D) ⊆ L(G)? II. Is L(G) ⊆ L(D)? III. Is L(G) regular? IV. Is L(G) finite? Which of these are decidable?

  1. A. I and IV only
  2. B. II, III and IV only
  3. C. I and II only
  4. D. II and IV only

Correct answer: D. II and IV only

II: L(G) ∩ complement(L(D)) is context-free (CFL ∩ regular), so its emptiness is decidable. IV is decidable by the pumping argument on the grammar. I is undecidable (with L(D) = Σ* it asks if G generates everything), and regularity of a CFG language (III) is undecidable.

More Theory of Computation questions

Exams that ask this topic