GATE Computer ScienceVery hardGATE CS (PYQ pattern)
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? III. Is L(G) a regular language for a given CFG G? IV. Is L(M) finite for a given DFA M?
- A. I and IV only
- B. I, II and IV only
- C. I and III only
- D. II and IV only
Correct answer: A. I and IV only
Emptiness of a CFG is decidable (mark productive variables) and finiteness of a DFA language is decidable (look for a reachable-and-co-reachable cycle). Intersection-emptiness of two CFGs and regularity of a CFG are both undecidable.
More Theory of Computation questions
- Let L = { w ∈ {a, b} : (number of a's − number of b's) is divisible by 4 }. How many states does the minimal DFA for L have?
- A grammar G in Chomsky Normal Form (no ε-production) generates a string w of length 9. How many derivation steps does any derivation of w…
- Let L = { w ∈ {a, b} : w contains at most 3 a's and at least 2 b's }. How many states does the minimal complete DFA for L have?
- Let #ab(w) and #ba(w) be the numbers of occurrences of the substrings ab and ba in w ∈ {a, b}. Which one of the following languages is…
- Let L = { w ∈ {a, b} : w begins with aba, or (w ends with b and na(w) ≡ 0 (mod 3)) }. The minimal complete DFAs for L and for its reversal…
- Consider the following claims about an arbitrary regular language L over Σ. I. { w : ww ∈ L } is regular. II. { w : w wᴿ ∈ L } is regular…