in Theory of Computation
2,993 views
1 vote
1 vote
Given M = (Q,Σ,δ,q0,F) a DFA with n states. Prove:
The language L(M) is infinite iff it contains a string with length t, where n ≤ t < 2n.
Please provide a prove. I am not getting it from the resources available on the net.
Why isn’t the criteria like n ≤ t only ?
When there are n states and if we get strings of length greater than equal to n that means DFA must have a loop. With a loop in DFA we can accept infinite no. of strings isn’t it? Then why doesn’t this condition suffice?

Please point out where I am going wrong.
in Theory of Computation
3.0k views

4 Comments

edited by

@Soumya29,

Thank you so much for this..can you please clarify this one as well..

Since lower bound is n, we can enumerate all the strings of length "n" which will be a finite set of strings and check if our DFA accepts it or not. This will reduce our time from checking infinite strings. Now the mistake that I am doing here is, the DFA might not be accepting any string of length n and may accept strings of length=n+1. Like for eg: a DFA accepting strings of form $(00)^{+}$ . This DFA will have 3 states and a loop from final state to the middle state. So in order to say the language is infinite, according to lower bound, I will be checking if DFA accepts strings of length 3. But the DFA won't accept strings of length 3 and wrongly I will conclude that language is finite though it accepts strings of length 4,6,8...

Now possible length of cycles in the DFA that can accept strings of various lengths are:

1. 0 (no cycle) .. DFA accepts strings of length= (n-1)

2. 1 (cycle on FINAL state) .. DFA accepts string of length= (n-1)+1 = n [Obv DFA will accept strings of other lengths as well but here I am considering the minimum length using the cycle for once]

3. 2 (cycle from final state to 2nd last state i.e. state coming before the final ) .. DFA accepts string of length= (n-1)+2 = n+1

4. 3 (cycle from final state to 3rd last state ) .. DFA accepts string of length= (n-1)+3 = n+2

5. This continues until there is a cycle from final to initial state.. then it will be nth last state (i.e. the 1st state) so DFA accepts string of length= (n-1)+n = 2n-1

This will be the max length of cycle that a DFA can have. This sets the upper bound.

Please correct me if you find any glitch in this alternate approach.

Thank you.

0
0

@MiNiPanda, Yes it looks fine to me.
We just need to check all possible strings $w$ such that $n \leq |w| < 2n$, one by one. If our DFA accepts one of them, we will stop there and say that our language is infinite. 
If DFA accepts no such string then we will say that our language is finite. 

The crux is - whatever possible combination of loops and cycle we try, we have to take at least 1 of them twice to get a string of length $\geq 2n.$

1
1

Yes.. once again thank you so much @Soumya29 😋

1
1

Please log in or register to answer this question.

Related questions