-4

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

abdul
  • 1

3 Answers3

1

This is a DFA for binary numbers divisible by three. your desirable language is reverse of this language.

enter image description here
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.

0

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

entropyfeverone
  • 256
  • 1
  • 5
0

divisible by 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.