Let be the set of all binary strings whose last two symbols are the same. The number of states in the minimal state deterministic finite state automaton accepting is
View worked solution
Answer: B
The language consists of all binary strings over the alphabet that end with either or . That is:
Let us construct the Deterministic Finite Automaton (DFA) for by tracking the suffix of the input string processed so far. We define the following 5 states:
- : Start state (empty string processed).
- : The string processed so far ends in (but not ).
- : The string processed so far ends in (but not ).
- : The string processed so far ends in (Accepting state).
- : The string processed so far ends in (Accepting state).
The transition rules for these states are as follows:
| State | On input | On input |
|---|---|---|
| (Accept) | ||
| (Accept) | ||
| (Accept) | ||
| (Accept) |
To verify if this DFA is minimal, we check for equivalent states:
- The accepting states cannot be merged because on input , stays in an accepting state () while goes to a non-accepting state ().
- The non-accepting states cannot be merged because:
- On input , transitions to an accepting state () while and transition to non-accepting states.
- On input , transitions to an accepting state () while transitions to a non-accepting state.
Since no two states are equivalent, all states are pairwise distinguishable. Thus, the minimal DFA has exactly states.
Free practice · Your answers on this page are not saved.
