GATE Computer ScienceHardGATE CS (PYQ pattern)
Which of the following decision problems can be solved by an algorithm that always halts?
- A. Given a CFG, is the language it generates regular?
- B. Given a CFG, is it ambiguous?
- C. Given a DPDA, is the language it accepts regular?
- D. Given two CFGs G₁, G₂, is L(G₁) ∩ L(G₂) empty?
Correct answer: C. Given a DPDA, is the language it accepts regular?
Regularity of a deterministic context-free language is decidable (Stearns). For general CFGs regularity, ambiguity and emptiness of the intersection are undecidable.
More Theory of Computation questions
- How many strings of length 10 over {a, b} contain aa as a substring but do not contain bb?
- How many strings of length exactly 9 are generated by the grammar S → aSbb | bSaa | SS | ε?
- Let L be the set of binary strings of length at least 3 whose third symbol from the right end is 1. What is the number of states in the…
- Consider I. {aⁿbᵐcⁿdᵐ | n, m ≥ 1}, II. {aⁿbᵐcᵐdⁿ | n, m ≥ 1}, III. {wwᴿ | w ∈ {a,b}}, IV. {ww | w ∈ {a,b}}. Which of these languages are…
- Which regular expression over {0,1} denotes exactly the set of strings that do not contain two consecutive 1s?
- Which of the following problems are decidable? I. Is L(G) empty for a given CFG G? II. Is L(G1) ∩ L(G2) empty for given CFGs G1 and G2?…