GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Let L = { binary strings (MSB first, ε accepted) whose value is divisible by 5 }, with a minimal DFA of 5 states. For h(a) = 1 and h(b) = 01, how many states does the minimal DFA for h⁻¹(L) = { w ∈ {a, b}* : h(w) ∈ L } have?

  1. A. 10
  2. B. 5
  3. C. 25
  4. D. 4

Correct answer: B. 5

On remainders mod 5, a acts as v → 2v + 1 and b as v → 4v + 1; the DFA for h⁻¹(L) keeps L's 5 states and all five remain distinguishable. The state count cannot exceed that of L's DFA.

More Theory of Computation questions

Exams that ask this topic