The number of states in the minimal deterministic finite automaton…
2015
The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0 + 1)∗(10) is __________.
Attempted by 112 students.
Show answer & explanation
Correct answer: 3
Answer: 3 states.
Key idea: The regular expression (0 + 1)*(10) denotes all binary strings that end with the substring 10.
Use a DFA that remembers the relevant suffix of length up to 2:
States:
q0 — no relevant suffix matched (start).
q1 — last symbol seen is '1' (possible prefix of '10').
q2 — last two symbols are '10' (accepting).
Typical transitions (illustrative): q0 on '1' → q1, q0 on '0' → q0; q1 on '0' → q2 (accept), q1 on '1' → q1; q2 on '1' → q1, q2 on '0' → q0.
Minimality reason: Distinguishability of suffixes. The empty suffix (not ending with '1'), the suffix '1', and the suffix '10' are pairwise distinguishable with respect to extending by more input to reach a string ending in '10', so three distinct states are necessary.
A video solution is available for this question — log in and enroll to watch it.