1
$\begingroup$

I want to draw a DFA to accept a String containing even number of both A and B, but rejects the empty String(ε)

I have already drawn the DFA which accepts the above language, without rejecting the empty string.

$\endgroup$
1
$\begingroup$

I'm going to assume that your DFA has 4 states with the start state also being the singular accepting state.

Add a new (non-accepting) state where the outgoing transitions are a copy from your existing accepting start state. Make that new state the start state.

If my assumption about your existing DFA is correct then this way you should not be able to get into an accepting state with the empty string.

$\endgroup$
0
$\begingroup$

Your DFA probably has 4 states; $a_e b_e , a_o b_o , a_e b_o , a_o b_e$ ,

$a_o$means odd number of $a$s , $b_e$ even number of $b$s and so on

replace the $a_e b_e$ state by 2 states , a state for empty string and one for $a_e b_e$ then try again

Here is the DFA

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.