@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.