Question
Definition of a language with alphabet is given as following.
What is the minimum number of states needed in a DFA to recognize ?
Official answer and solution
- Official answer
- B
- From
- Official GATE 2011 answer key
Solution
Construct the minimal DFA recognizing non-zero multiples of positive constant .
- The language is . Crucially, implies that the empty string () is NOT accepted by .
- The DFA must count input symbols modulo while distinguishing the initial string length 0 from subsequent non-zero multiples of .
- Let states be :
- : start state (non-accepting, representing string of length 0).
- Reading transitions: .
- : accepting state, reached after reading symbols ().
- From , reading transitions back to to count the next block of symbols.
- The states and cannot be merged because is non-accepting while is accepting. Hence, exactly states are necessary and sufficient.
Final answer
B
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2011 Computer Science and Information Technology (CS)
- Question
- 42 of 65, printed as CS Q.42
- 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.