GATE Computer ScienceVery hardGATE CS (PYQ pattern)
How many states does the minimal complete DFA have for the set of ODD-length strings over {a, b} that contain neither aba nor bab as a substring?
- A. 6
- B. 12
- C. 7
- D. 10
Correct answer: D. 10
The avoidance part must know the last symbol and whether the last two differ; combined with length parity, the Myhill–Nerode classes have representatives ε, a, b, aa, ab, ba, bb, aab, bba and a dead class (e.g. aba). Accepting: a, b, aab, bba. 10 states — not 6 (parity ignored) nor 12 (a blind product).
More Theory of Computation questions
- The minimal complete DFA for { w ∈ {a, b} : abab is a substring of w } has how many states?
- Let L = { w ∈ {a, b} : w contains aa as a substring and w contains bb as a substring }. Which pair of strings is equivalent under the…
- L = { w ∈ {a, b} : |w| mod 4 = 1 AND w ends with bb }. How many states does the minimal complete DFA for L have?
- L = { w ∈ {a, b} : the substring ab occurs an odd number of times AND the substring ba occurs an odd number of times }. How many states…
- How many strings of length 10 over {a, b} have an even number of occurrences of ab AND an even number of occurrences of ba?
- How many strings of length 8 over {a, b} begin with b and contain no aa as a substring?