View worked solution
Answer: 4
The given regular expression is over the alphabet . This language consists of all strings where the second symbol from the right end is .
In general, a deterministic finite automaton (DFA) that recognizes the language of strings where the -th symbol from the right is a specific character requires at least states. Here, , so the minimum number of states is .
We can construct the minimal DFA with the following 4 states representing the history of the last two symbols read:
- (Start state): Represents having read nothing, or ending in .
- : Represents ending in .
- (Accepting state): Represents ending in .
- (Accepting state): Represents ending in .
Since all 4 states are pairwise distinguishable, the minimal DFA has exactly 4 states.
Free practice · Your answers on this page are not saved.
