The minimum possible number of states of a deterministic finite automaton that…
2017
The minimum possible number of states of a deterministic finite automaton that accepts the regular language \(L = w_{1}aw_{2} | w_{1},w_{2} \in \left \{ a,b \right \}^{*} \left | w_{1} \right | = 2, \left | w_{2} \right |\geq 3\) is ______________ .
Attempted by 226 students.
Show answer & explanation
Correct answer: 8
Answer: 8
Reason (construction): The language consists of all strings whose third symbol is a and that have at least three symbols after that specified a (so total length at least 6). A DFA that recognizes this can be built by tracking:
How many symbols have been read before reaching the third position (three distinct situations): 0, 1, or 2 symbols read.
Whether the third symbol was the required a (if it was not, the automaton goes to a rejecting sink).
After seeing the required third-symbol a, the DFA must count how many symbols of the suffix have occurred to ensure at least three symbols follow: 0 seen, 1 seen, 2 seen, or 3 or more seen (once 3 or more are seen the string is accepted and further input stays accepting).
Combine these requirements to get a DFA with states for:
start / 0 symbols read (must still reach position 3)
1 symbol read (before position 3)
2 symbols read (about to read the third symbol)
third symbol was a and 0 of the required 3 suffix symbols have been read yet
third symbol was a and 1 suffix symbol read
third symbol was a and 2 suffix symbols read
third symbol was a and 3 or more suffix symbols read (accepting sink for further input)
a rejecting sink state for any string whose third symbol is not a
Counting these gives 8 distinct states in the DFA.
Reason (minimality): These 8 states correspond to pairwise distinguishable Myhill–Nerode classes: three different possible numbers of symbols seen before reaching the third position (0,1,2) affect where the required a can appear in the future; whether the third symbol is a or not produces a rejecting class; and after a correct third-symbol a, four distinct counts of how many suffix symbols have been seen (0,1,2,≥3) lead to different acceptance possibilities for future continuations. Because each of these eight situations can be distinguished by an appropriate continuation that yields acceptance in one situation but not in another, no two can be merged. Hence 8 is the minimum number of states.
A video solution is available for this question — log in and enroll to watch it.