Let Σ={1,2,3,4} For x ∈ Σ*, let prod(x) be the product of symbols in x modulo 7. We take prod(ϵ)=1, where ϵ is the null string. For example, prod(124)=(1×2×4) mod 7=1 prod(124)=(1×2×4)mod7=1. Define L={x∈Σ∗ ∣ prod(x)=2}. The number of states in a minimum state DFA for L is ______
Correct Answer :
Solution :
The correct answer is 6.
We are given the alphabet .
For any string , is defined as the product of the symbols in modulo 7, with .
We want to find the number of states in the minimum state Deterministic Finite Automaton (DFA) that accepts the language:
.
Let's analyze the possible values of . Since the product is taken modulo 7, the possible values of the product modulo 7 are from the set .
However, let's look at the alphabet . None of the symbols in is a multiple of 7, nor can any product of these symbols be a multiple of 7 because 7 is a prime number and none of the prime factors of the numbers in (which are 2 and 3) can multiply to form a multiple of 7. Thus, the modulo 7 product of any string over can never be 0.
Consequently, the only possible values of for any belong to the set .
Let us define the states of our DFA. The state of the DFA after reading a string must keep track of the current product modulo 7. Since there are 6 possible modulo values , we can define 6 states corresponding to each of these values:
State : current product modulo 7 is 1 (this is also the start state because ).
State : current product modulo 7 is 2 (this is the only accepting/final state).
State : current product modulo 7 is 3.
State : current product modulo 7 is 4.
State : current product modulo 7 is 5.
State : current product modulo 7 is 6.
To verify if all these 6 states are necessary and distinct (i.e., that the DFA is minimal and no states can be merged), we can check the transition behavior.
For any state representing a product and an input symbol , the transition goes to state where:
.
Let's check if all states are reachable from the start state :
- From , reading '1' keeps us in .
- From , reading '2' goes to .
- From , reading '3' goes to .
- From , reading '4' goes to .
- From , reading '2' then '3' gives , reaching .
- From , reading '3' then '4' gives , reaching .
Thus, all 6 states are reachable.
Next, we verify that all 6 states are distinguishable (meaning no two states are equivalent):
Two states and (where ) are distinguishable if there exists a string such that starting from and reading leads to the accepting state , while starting from and reading leads to a non-accepting state, or vice versa.
Mathematically, we want to find a string such that:
but .
Since 7 is a prime number, the integers modulo 7 form a field , meaning every non-zero element has a unique multiplicative inverse .
Thus, the equation has a unique solution .
Since , the value of required to reach the accepting state from will be different from the value required from .
Since we can generate any modulo value in using strings over , every pair of states is distinguishable. Therefore, no states can be merged.
Hence, the minimum state DFA requires exactly 6 states.
Access expert-curated educational resources and study materials—completely free.
Create, conduct, and manage professional online assessments with Mindyard. Perfect for teachers and institutes.
Copyright © 2026 Mindyard. All Rights Reserved.