Skip to content
Official PYQ · 2025

GATE CS 2025 Set 2 Q50 — Regular Expressions and Finite Automata

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

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

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

The number of states in a minimum state DFA for LL is __________ . (Answer in integer)
View worked solution

Answer: 6:6

To find the number of states in the minimum state DFA for LL, we analyze the possible values of prod⁡(x)(mod7)\operatorname{prod}(x) \pmod 7.

Since the alphabet is Σ={1,2,3,4}\Sigma = \{1, 2, 3, 4\}, none of the symbols are divisible by 77. Since 77 is a prime number, the product of any sequence of symbols from Σ\Sigma can never be 0(mod7)0 \pmod 7. Thus, the possible values of prod⁡(x)(mod7)\operatorname{prod}(x) \pmod 7 belong to the multiplicative group Z7∗={1,2,3,4,5,6}\mathbb{Z}_7^* = \{1, 2, 3, 4, 5, 6\}.

Let us define the states of our DFA by the value of the current product modulo 7:

  • Reachability: The start state corresponds to the product 11 (since prod⁡(ϵ)=1\operatorname{prod}(\epsilon) = 1). The symbol 3∈Σ3 \in \Sigma is a generator of the cyclic group Z7∗\mathbb{Z}_7^* because: 31≡3,32≡2,33≡6,34≡4,35≡5,36≡1(mod7)3^1 \equiv 3, \quad 3^2 \equiv 2, \quad 3^3 \equiv 6, \quad 3^4 \equiv 4, \quad 3^5 \equiv 5, \quad 3^6 \equiv 1 \pmod 7 Since we can generate all elements of Z7∗\mathbb{Z}_7^* using just the symbol 33, all 66 states {1,2,3,4,5,6}\{1, 2, 3, 4, 5, 6\} are reachable from the start state.
  • Distinguishability: For any two distinct states p,q∈{1,2,3,4,5,6}p, q \in \{1, 2, 3, 4, 5, 6\}, we can find a string y∈Σ∗y \in \Sigma^* such that p⋅prod⁡(y)≡2(mod7)p \cdot \operatorname{prod}(y) \equiv 2 \pmod 7. Since p≠qp \neq q, it must be that q⋅prod⁡(y)≢2(mod7)q \cdot \operatorname{prod}(y) \not\equiv 2 \pmod 7. Thus, every pair of states is distinguishable.

Since all 66 states are reachable and pairwise distinguishable, the minimum state DFA must have exactly 6 states.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions