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 77. 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)

Official answer and solution
Official answer
6
From
Official GATE 2025 answer key

Solution

Determine which non-zero residues modulo 7 are reachable from 1 by multiplying symbols from {1,2,3,4}\{1, 2, 3, 4\} and show that all reachable residues are pairwise distinguishable.

  1. Reachable residues: Since 77 is prime and every symbol in Σ={1,2,3,4}\Sigma = \{1, 2, 3, 4\} is non-zero modulo 77, prod(x) mod 7prod(x) \bmod 7 can only take values in the multiplicative group (Z/7Z)×={1,2,3,4,5,6}(\mathbb{Z}/7\mathbb{Z})^\times = \{1, 2, 3, 4, 5, 6\} (residue 00 is unreachable). Furthermore, 3∈Σ3 \in \Sigma is a primitive root modulo 77 (31≡3,32≡2,33≡6,34≡4,35≡5,36≡1(mod7)3^1 \equiv 3, 3^2 \equiv 2, 3^3 \equiv 6, 3^4 \equiv 4, 3^5 \equiv 5, 3^6 \equiv 1 \pmod 7), so all 66 non-zero residues are reachable from the initial state prod(ϵ)=1prod(\epsilon) = 1.
  2. Pairwise distinguishability: For any two distinct residues r1≢r2∈{1,2,3,4,5,6}r_1 \not\equiv r_2 \in \{1, 2, 3, 4, 5, 6\}, choose k∈{1,…,6}k \in \{1, \dots, 6\} such that r1⋅3k≡2(mod7)r_1 \cdot 3^k \equiv 2 \pmod 7 (using string z=3k∈Σ∗z = 3^k \in \Sigma^*). Since gcd⁡(3k,7)=1\gcd(3^k, 7) = 1, we have r2⋅3k≢2(mod7)r_2 \cdot 3^k \not\equiv 2 \pmod 7, so zz distinguishes r1r_1 and r2r_2.

By the Myhill-Nerode Theorem, the minimum-state DFA for LL has exactly 66 states.

Final answer

6

Common trap

Including a 7th state for residue 0, which is unreachable since 0 is not in the alphabet.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
Question
60 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.