GATE Computer ScienceHardGATE CSE
Over {a, b}, let L = { w : n_a(w) ≡ 1 (mod 4) OR n_b(w) is even }. What is the number of states in its minimal complete DFA?
- A. 7
- B. 8
- C. 9
- D. 14
Correct answer: B. 8
State = (n_a mod 4, n_b mod 2) gives 8 combinations. All are reachable and pairwise distinguishable (for example (1,0) and (1,1) differ after one more a), so the minimal DFA has 8 states.
More Theory of Computation questions
- Over {a, b}, L = { w : the fourth symbol from the right end of w is a }. How many states does the minimal complete DFA of L have?
- How many strings of length 8 over {a, b} contain aa as a substring but do not contain bb as a substring?
- An NFA with ε-moves over {a, b} has states 0–4, start 0 and accepting state 4. Transitions: 0 –ε→ 1, 2 –ε→ 3; δ(0,a) = {0}; δ(1,b) = {2}…
- The grammar S → SS | a | b is ambiguous. How many distinct parse trees does it give for the string ababa?
- How many strings of length 8 does the grammar S → aSb | bSa | SS | ε generate?
- Consider these statements. I. Deterministic context-free languages are closed under complementation. II. Deterministic context-free…