GATE Computer ScienceEasyGATE CS (PYQ pattern)

The minimal complete DFA for { w ∈ {a, b}* : abab is a substring of w } has how many states?

  1. A. 5
  2. B. 4
  3. C. 6
  4. 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

Exams that ask this topic