design a DFA accepting the set of strings over the alphabet {0, 1} that when interpreted in reverse as a binary integer, are divisible by 3
-
5(What's in it for me?) This does not look a question. Frankly, it looks like an assignment dumped on this forum. Please show what you tried and ask a specific question. – greybeard Jan 14 '20 at 17:06
3 Answers
This is a DFA for binary numbers divisible by three. your desirable language is reverse of this language.
For reversion of language of a DFA, you must reverse all of its transitions and change its initial state with its final state. in this case initial and final states are same, also its language is symmetric so all of transitions are symmetric.
Therefore you need only reverse all of its transitions are symmetric; so you don't need to
do anything. above DFA is above.

- 21
- 2
-
Good observation that the DFA is invariant when reversed. I have given this automaton earlier as answer to: Algorithms computing if a number is a multiple of 3 – Hendrik Jan Jan 14 '20 at 16:58
Take a look here
https://stackoverflow.com/questions/39385971/how-to-know-if-a-binary-number-divides-by-3
This means that while your DFA consumes the number from right to left, you should keep track (by using different states) of whether your difference is divisible by three or not. Also, your DFA must keep track of whether you are in an odd or even position (again, using different states).

- 256
- 1
- 5
I tried the same question to check divisibility by 5. As @m.farokhian said, this doesn’t need to be reversed, but for the strings 10011 & 1001100, it doesn’t seem to work.
Ps. I couldn’t comment due to my contribution. That's why added it as an answer.

- 1
- 1