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?
- A. I and IV only
- B. II, III and IV only
- C. I and II only
- 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
- A single-tape Turing machine has blank B and starts in q0 on the leftmost cell of a binary numeral (MSB at the left). Rules: δ(q0,0) =…
- For a Turing machine M (given by its encoding ⟨M⟩) consider these sets: I. { ⟨M⟩ : M has at least 481 states } II. { ⟨M⟩ : L(M) contains…
- Which of the following languages are deterministic context-free? I. { aⁱbʲcᵏ : i = j or j = k } II. { aⁱbʲcᵏ : i = j, k ≥ 0 } III. { w c…
- Let L = { aⁿ : n ≥ 5 and (n is divisible by 4 or n is divisible by 6) }. How many states does the minimal complete DFA for L have?
- Which one of the following languages over the one-letter alphabet {a} is NOT context-free?
- How many strings of length 12 over {a, b} contain exactly three occurrences of aa as a substring (overlapping occurrences counted…