- GATE CS
- 2026–27 pattern practice
- Theory of Computation
- Finite automata
- Medium
How many states does the minimal DFA have for the language of all binary strings in which the number of s is divisible by ?
Regular Languages
Pick an option to check your answer.
Answer: B. Solution
The DFA only needs to remember the count of s modulo 3: states .
- On input : stay in the same state.
- On input : .
- Start and accepting state: .
The three states are pairwise distinguishable (from , the string is accepted only from ), so is minimal.
Why not the others
- can only track parity (divisibility by 2).
- and contain equivalent states that minimisation would merge.