I am having trouble coming up with solutions and I think its because I am not approaching these problems in the correct manner even though I understand what a DFA is. For those of you who do well with creating state diagrams, how do you approach these problems?
I guess more specifically:
Is there a systematic way of determining what a state diagram should look like given a few strings the machine should accept as well as some strings it rejects?
Edit: Since this got a bad rep, I am going to put an example to be more clear:
What would a DFA look like for a problem like this?
Lb = { w | w’s decimal equivalent is divisible by 6 }
For your example of decimal strings divisible by $6$, consider the residue modulo $6$ of what has been read as the state $q$; adding a new digit $d$ gives state $(10 q + d) \bmod 6$, which is easy to compute. Might need to spice up with a starting state to avoid strings starting with $0$, and make the state $0$ accepting. This can obviously be generalized to other bases and moduli.