GATE Computer ScienceHardGATE CS (PYQ pattern)
Occurrences of aa may overlap (aaa contains two). How many states does the minimal complete DFA for { w ∈ {a, b}* : w contains EXACTLY two occurrences of aa } have?
- A. 5
- B. 6
- C. 8
- D. 7
Correct answer: D. 7
Count occurrences 0, 1, 2 while remembering whether the last symbol is a: (0, last ≠ a), (0, last a), (1, last ≠ a), (1, last a), (2, last ≠ a), (2, last a), plus a dead state for a third occurrence. Both count-2 states accept and differ on suffix a, so 7 states.
More Theory of Computation questions
- 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}…
- 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}…