GATE Computer ScienceModerateGATE CS (PYQ pattern)
L = { aⁿbᵐ : n, m ≥ 0 and n ≡ m (mod 3) }. How many states does the minimal complete DFA for L have?
- A. 7
- B. 4
- C. 6
- D. 9
Correct answer: A. 7
In the a-phase remember n mod 3 (3 states); after the first b remember (n − m) mod 3 (3 states); plus a dead state for an a after a b. The a-phase state 0 (accepts ε) and b-phase state 0 also accept ε but differ on the suffix ab: from the a-phase state it gives n ≡ 1 ≡ m (accepted), from the b-phase state the a leads to the dead state, so nothing merges: 3 + 3 + 1 = 7.
More Theory of Computation questions
- Occurrences of aa may overlap (aaa contains two). How many states does the minimal complete DFA for { w ∈ {a, b} : w contains EXACTLY two…
- L = { w ∈ {a, b} : (na(w) − nb(w)) is divisible by 3 and w contains no bb }. Its minimal complete DFA has 7 states. How many of them are…
- 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}…