- GATE CS
- 2026–27 pattern practice
- Theory of Computation
- Finite automata
- Easy
How many states does the minimal DFA have for strings over {a, b} whose length is divisible by 3?
Regular Languages
Pick an option to check your answer.
Answer: D. Solution
The DFA only needs the length modulo 3, giving states , where is both start and accepting. Each symbol moves . All three remainders behave differently, so none can be merged.
Why not the others
- 2 cannot distinguish remainders 1 and 2.
- 4 adds an unnecessary dead state — every string has some remainder.
- 6 wrongly tracks the symbols as well as the length.