this dfa should accept only consecutive odd number of both 0's and 1's. example: 10001,1110001,10,01,011101.
How can I draw its diagram?
Asked By : user49697
Answered By : Rick Decker
Here are a couple of hints to get you started.
- Could you make a DFA that accepts only $0, 000, 00000,\dotsc$? You can do it with a start state, a final state, and one other non-final state.
- Obviously, if you can do (1), you can make a DFA that accepts only $1, 111, 11111,\dotsc$.
- Merge the two DFAs into one with a common start state and appropriately link the two final states. You'll have a DFA that accepts all strings which have an odd number of consecutive $0$s followed by an odd number of consecutive $1$s, followed by ... or an odd number of consecutive $1$s followed by an odd number of consective $0$s, followed by ... , which is what you want.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/56088
0 comments:
Post a Comment
Let us know your responses and feedback