in Theory of Computation
392 views
1 vote
1 vote
Consider the set of all binary strings where the difference between the number of 0’s and number of 1’s is even. The minimum number of states in a DFA that accepts the given set is _____________?

(kindly explain the approach to this problem)
in Theory of Computation
392 views

1 comment

The minimum number of states in DFA will be 4.
0
0

1 Answer

2 votes
2 votes
Best answer
Given the difference between no of 0s and 1s is even which is possible only when both the no of 1s and 0s are even  or both are odd.

by this we will get 4 states but we can apply partition algorithm to get min 2 state dfa.
selected by

3 Comments

Thank you, didn’t knew about “partition algorithm”, gonna learn it right now.
1
1
Will you please draw the DFA?
0
0
i am not able to upload the image

see you can do like this.Consider 2 states(A,B) (A-final st)

δ(A,0)=δ(A,1)=B

δ(B,0)=δ(B,1)=A
0
0

Related questions