Design a DFA for the set of strings in $\{a\}$* such that it's length is divisible by 3 or 5.
The point that I am not understanding is, how many states do we need? Since we can't possibly represent all possible states such that the length of the string is divisible by 3 or 5.
Q | a
___________
-> 0 | 1
1 | 2
2 | 3
F 3 | 4
4 | 5
F 5 | 6
F 6 | 7
7 | 8
8 | 9
F 9 | 10
F 10| 11
.
.
The left column represents the current state, the right column represents what state to go to next if another a is added to the string. The F's represent the accepted states.
How do I find a finite set $Q$ that represents all possible sets, and a finite subset $F \subset Q$ that represents all accepted states?
nstates, could I just representQ = {0..n}and then loop back to state 1 when we reach state n? – JLL Jan 17 '15 at 00:41