Skip to content
GATEiit

GATE CSE 2025 Session 2 Q60: Minimal DFA for strings whose digit product mod 7 is 2

Question

Let Σ={1,2,3,4}\Sigma = \{1, 2, 3, 4\}. For x∈Σ∗x \in \Sigma^*, let prod(x)prod(x) be the product of symbols in xx modulo 7. We take prod(ϵ)=1prod(\epsilon) = 1, where ϵ\epsilon is the null string.

For example, prod(124)=(1×2×4) mod 7=1prod(124) = (1 \times 2 \times 4) \bmod 7 = 1.

Define L={x∈Σ∗∣prod(x)=2}L = \{x \in \Sigma^* \mid prod(x) = 2\}.

The number of states in a minimum state DFA for LL is ___________. (Answer in integer)

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 6 (official GATE 2025 final answer key)

Concept used: Track the running product modulo 7; the symbols 1–4 are all invertible mod 7, so the product is never 0.

First step: States are residues {1,…,6}\{1, \ldots, 6\}; check that all are reachable from 1 (3 generates the group) and pairwise distinguishable.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2025 Session 2 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key