Let be the language represented by the regular expression where . What is the minimum number of states in a DFA that recognizes (complement of )?
View worked solution
Answer: B
The language represents the set of all strings over that contain the substring 0011.
Step 1: Construct the Minimal DFA for
To recognize the substring 0011, we track the longest prefix of 0011 matched so far. The states can be defined as follows:
- : Start state (no progress towards
0011) - : Matched
0 - : Matched
00 - : Matched
001 - : Matched
0011(Accepting state / Dead-end trap state)
The transition table for this DFA is:
| Current State | Input 0 |
Input 1 |
|---|---|---|
| (Accepting) | ||
This minimal DFA for has exactly states.
Step 2: Find the Minimal DFA for
By the properties of regular languages, the complement of a regular language is recognized by a DFA obtained by swapping the accepting and non-accepting states of the minimal DFA for :
- The set of states and transitions remains identical.
- The new accepting states are .
- The new non-accepting state is .
According to the Myhill-Nerode theorem, the equivalence relations and are identical. Thus, the minimal DFA for has the exact same number of states as the minimal DFA for .
Therefore, the minimum number of states in a DFA that recognizes is .
Free practice · Your answers on this page are not saved.
