GATE Computer ScienceVery hardGATE CSE · NIELIT
A DFA reads a binary string most-significant bit first (leading zeros allowed) and tracks the value so far modulo 12, accepting exactly when the value is divisible by 12. How many states does the minimal DFA for this language have?
- A. 12
- B. 5
- C. 6
- D. 4
Correct answer: B. 5
For any extension of length ≥ 2 acceptance depends only on r mod 3, and extensions of length 0 or 1 only separate r = 0 and r = 6; the classes are {0}, {6}, {3,9}, {r ≡ 1 mod 3 else}, {r ≡ 2 mod 3 else}: 5 states.
More Theory of Computation questions
- 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…
- How many strings of length 12 over {a, b} contain neither aba nor bbb as a substring?