GATE Computer ScienceModerateGATE CS (PYQ pattern)

How many states does the minimal complete DFA have for the set of strings over {a, b} that begin with ab OR end with ab?

  1. A. 3
  2. B. 5
  3. C. 6
  4. D. 7

Correct answer: C. 6

Classes: ε; a (could still begin with ab); 'begins-with-ab' failed and last symbol not a (b, abb-free strings like b, ba…b); failed and last symbol a (aa, …a); the accepting sink reached by the prefix ab; and the accepting, non-sink 'ends with ab' state (aab). ab and aab differ on the suffix a. 6 states.

More Theory of Computation questions

Exams that ask this topic