GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Let L₁ = { w ∈ {a, b}* : |w| ≡ 0 (mod 4) } and L₂ = { w : (n_a − n_b) ≡ 0 (mod 4) }. The minimal complete DFA for L₁ ∪ L₂ has how many states, and how many of them are accepting?

  1. A. 16 states, 7 accepting
  2. B. 8 states, 4 accepting
  3. C. 8 states, 3 accepting
  4. D. 16 states, 4 accepting

Correct answer: C. 8 states, 3 accepting

Track (|w| mod 4, (n_a − n_b) mod 4). Since |w| ≡ n_a − n_b (mod 2), only pairs of equal parity occur: 8 of the 16. All 8 are distinguishable. Accepting pairs have a 0 coordinate: (0,0), (0,2), (2,0) — 3 states.

More Theory of Computation questions

Exams that ask this topic