GATE Computer ScienceHardGATE CS (PYQ pattern)
L = { w ∈ {a, b}* : (n_a(w) − n_b(w)) is divisible by 3 and w contains no bb }. Its minimal complete DFA has 7 states. How many of them are accepting?
- A. 1
- B. 3
- C. 2
- D. 4
Correct answer: C. 2
Live states are (difference mod 3, last symbol b?) — 6 combinations, plus dead. Difference 0 occurs with last symbol not b (e.g. ε) and with last symbol b (e.g. ab); both are accepting and they differ (suffix b kills only the second). The other residues are rejecting. So 2 accepting states.
More Theory of Computation questions
- Consider L = { w ∈ {a, b} : every a in w is immediately followed by a b }. The minimal complete DFA for L has how many states?
- L = { w ∈ {a, b} : the 5th symbol from the right is a } needs 32 states in a minimal DFA. Its reversal Lᴿ needs how many states in a…
- An NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {2,3}. Transitions: δ(0): a→{2,3}, b→{3}; δ(1): a→∅, b→{1}…
- An NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {3}. Transitions: δ(0): a→{3}, b→{1,2}; δ(1): a→{0}, b→{1,3}…
- An NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {1, 3}. Transitions: δ(0): a→{2,3}, b→{2}; δ(1): a→{0,3}…
- An NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {0}. Transitions: δ(0): a→{3}, b→∅; δ(1): a→{1,3}, b→{3}; δ(2)…