I have a DFA problem and I need to use JFLAP to create a diagram for the automata. I have successfully done a more simple problem, however I just can't figure out how to solve this one:
"A DFA that receives sequences of "1" and "2" values, accepting only sequences that result in 4. Any other combinations that result in more than or less than 4 are to be rejected."
The alphabet is {1,2} and as far as I know these are the possible combinations that will be accepted:
1111, 22, 121, 112, 211
Any help will be very much appreciated. Thank you.
A DFA for this finite language could look a lot like this:
Another approach would be just to remember the current sum: