Question
The number of states in the minimal deterministic finite automaton corresponding to the regular expression is _____.
Official answer and solution
- Official answer
- 3
- From
- Official GATE 2015 answer key
Solution
Construct the minimal DFA that recognizes all binary strings ending in the suffix 10.
The language consists of all binary strings ending in .
Define the state states based on the longest matching suffix of seen so far:
- State (start): Last symbol is not 1 (matched suffix ).
- State : Last symbol seen is 1 (matched suffix
1). - State (accepting): Last two symbols seen are 10 (matched suffix
10).
Transitions:
- From : on , on .
- From : on , on .
- From : on , on .
All 3 states are reachable and pairwise distinguishable by the Myhill-Nerode theorem:
- separates (accepting) from and .
- Input string
0sends to (accept) but keeps in (reject).
Hence, the minimal DFA requires exactly 3 states.
3
Adding redundant states or failing to combine equivalent non-matching prefix states.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 2
- Question
- 63 of 65, printed as CS Q.53
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.