GATE Computer ScienceVery hardGATE CS (PYQ pattern)

L = { w ∈ {a, b}* : w[i] = w[i+3] for every valid index i } (w is periodic with period 3). How many states does the minimal complete DFA for L have?

  1. A. 8
  2. B. 27
  3. C. 15
  4. D. 16

Correct answer: D. 16

The first three symbols fix the whole string. States: ε, the 2 strings of length 1, the 4 of length 2, the 8 of length 3, and a dead state. After length 3, a live string's state is its last three symbols — a rotation of the period, which is again one of the 8 length-3 states. 1 + 2 + 4 + 8 + 1 = 16.

More Theory of Computation questions

Exams that ask this topic