GATE Computer ScienceVery hardGATE CSE
For a context-free grammar G given as input, how many of the following problems are undecidable? (a) Is L(G) = Σ*? (b) Is L(G) regular? (c) Is a given string w in L(G)? (d) Is L(G) infinite? (e) Is G ambiguous?
- A. 3
- B. 2
- C. 4
- D. 5
Correct answer: A. 3
Universality, regularity and ambiguity are undecidable; membership (CYK) and finiteness (pumping/cycle check) are decidable.
More Theory of Computation questions
- A DFA reads a binary string most-significant bit first (leading zeros allowed) and tracks the value so far modulo 12, accepting exactly…
- Let L be the set of strings over {a, b} in which the third symbol from the right is a, or the last symbol is b (strings shorter than 3…
- An NFA over {a, b} has states 0–4, start state 0 and accepting state 4. Transitions: 0 –a→ {0,1}; 0 –b→ {0}; 1 –a,b→ {2}; 2 –a,b→ {3}; 3…
- A DFA over {a, b} has states 0–4, start 0 and accepting states {2, 4}. Transitions (on a, b): 0:(1,2), 1:(2,0), 2:(3,3), 3:(4,1), 4:(4,0)…
- Over {a, b}, L = { w : the number of a's in w is ≡ 1 (mod 4) and |w| ≡ 3 (mod 6) }. How many states does the minimal DFA of L have?
- A DFA over {0,1} has states p0 (start), p1, p2, A (accepting), D. Transitions: p0 –0,1→ p1; p1 –0,1→ p2; p2 –1→ A; p2 –0→ D; A –0,1→ A; D…