Question
Consider the language over the alphabet , given below:
The minimum number of states in a Deterministic Finite-State Automaton (DFA) for is _______.
Official answer and solution
- Official answer
- 4
- From
- Official GATE 2023 answer key
Solution
Construct the minimal DFA that rejects any string containing the substring 111.
The language consists of all binary strings that do not contain the substring . A minimal DFA tracks the number of consecutive 's read immediately preceding the current position:
- State : 0 consecutive 's seen (Start state, Accepting).
- On
- On
- State : 1 consecutive seen (Accepting).
- On
- On
- State : 2 consecutive 's seen (Accepting).
- On
- On
- State : 3 consecutive 's seen (Dead/Trap state, Non-accepting).
- On
- On
These 4 states are pairwise distinguishable by suffix distinguishing extensions (e.g., distinguishes from ). By the Myhill-Nerode theorem, this DFA is minimal, having 4 states.
4
Omitting the dead/trap state , which is mandatory in a complete Deterministic Finite-State Automaton.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2023 Computer Science and Information Technology (CS)
- Question
- 63 of 65
- 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.