Let . For , let be the product of symbols in modulo 7. We take , where is the null string.
For example, .
Define .
The number of states in a minimum state DFA for is ___________. (Answer in integer)
Let . For , let be the product of symbols in modulo 7. We take , where is the null string.
For example, .
Define .
The number of states in a minimum state DFA for is ___________. (Answer in integer)
ANSWER
The minimum state DFA for has 6 states.
Official answer: 6Source: Official answer key, GATE 2025 CS2 (IIT Roorkee)
After reading a string , the only thing that matters for the future is . Take one state for each residue . The start state is , since . The accepting state is .
The transitions are for . No symbol is a multiple of , and is prime, so the residue is never reached. No and no dead state is needed.
Reachability from : reading gives residues . Then and . So all of are reachable, and no state is unreachable.
Distinguishability: take residues in . Every nonzero residue modulo has an inverse. Every nonzero residue is the product of some string over (the empty string gives , and , ). So pick a suffix with .
Then , so a string in state followed by is accepted. For , , because . So that string is rejected, and and are distinguishable.
All states are reachable and pairwise distinguishable, so none can be merged. The minimum DFA has states.
KEY IDEA
The state of the DFA is the running product modulo 7. Because 7 is prime and the symbols 1 to 4 generate every nonzero residue, all six nonzero residues are reachable and pairwise distinguishable.
WATCH OUT FOR
Counting a state for residue 0 or a dead state (giving 7 or 8). Residue 0 can never occur, since no symbol is a multiple of 7.
From the GATE 2025 CS2 paper. Every question of this paper · Download the full paper · All 18 Finite automata questions, with notes