I only have one letter available as a language (e.g.: x). If I now enter "xxx" or "xxxxx" then the machine should accept this input because in the former case the length is 3 and in the second the length of the input is 5. And since the length should be divisible by 3 or 5, this should be accepted.
However, after hours of thinking, I can't find the solution. Can someone help me please?
I have tried the following: q0, q1, q2, q3, q4 and q5 --> each for the rest.
q3 and q5 would be my final states, since the remainder is 0 (divisible)
Then I can enter the following transitions:
q0 --> q1 q1 --> q2 q2 --> q3 q3 --> q4 q4 --> q5 q5 --> q6 For example, if I have 6 "x" i.e. "xxxxxx" then I end up in state q0. So it has to be an accepting one too.
If I have 10 "x", i.e. "xxxxxxxxxx" I end up on q4. With 11 "x" I end up at q5, which is an accepting state which is not possible.
No matter how I spin it, I keep running into problems like this. Why am I thinking so wrongly here :-S