GATE Computer ScienceEasyGATE CS (PYQ pattern)

Let L = { w ∈ {a, b}* : n_a(w) is divisible by 3 }. How many states does the minimal complete DFA for the concatenation L·L have?

  1. A. 9
  2. B. 6
  3. C. 3
  4. D. 1

Correct answer: C. 3

w ∈ L·L iff w splits into two parts with a-counts ≡ 0 (mod 3) each, which forces n_a(w) ≡ 0; conversely any w ∈ L splits as w·ε. So L·L = L and still needs 3 states (the 9-state product is a trap).

More Theory of Computation questions

Exams that ask this topic