GATE Computer ScienceEasyGATE CS (PYQ pattern)
The minimal complete DFA for { w ∈ {a, b}* : abab is a substring of w } has how many states?
- A. 5
- B. 4
- C. 6
- D. 8
Correct answer: A. 5
KMP-style states: matched prefix length 0, 1, 2 or 3 of abab, plus the accepting sink, giving 5.
More Theory of Computation questions
- 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?
- Over Σ = {a, b, c}, how many strings of length 6 have an even number of a's and do not contain cc?