IAE Academy

GATE 2025 CS2 Q.60: solution and answer

GATE 2025 · CS2Q.60 · 2 marks · NAT

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)

See the question in the paper

Answer and solution

ANSWER

The minimum state DFA for has 6 states.

Official answer: 6Source: Official answer key, GATE 2025 CS2 (IIT Roorkee)

  1. 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 .

  2. 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.

  3. Reachability from : reading gives residues . Then and . So all of are reachable, and no state is unreachable.

  4. 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 .

  5. Then , so a string in state followed by is accepted. For , , because . So that string is rejected, and and are distinguishable.

  6. 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

More Finite automata questions