[Math] Create DFA that accept language where number of 0’s is even and after every 1 goes 0

automata

Alphabet ${} = \{0,1\}$.

Language $L = \{ w \in \{0,1\}^* \mid \text{ number of $0$'s in $w$ is even and after every $1$ goes $0$} \}$.

I'm trying to create DFA that accepts language $L$. But I have some problems. Transition arrow with $1$ can only lead to the same state is goes from. But when it happens this state can not be final state. If arrow with $1$ goes to another state, then word can contain $11$ so this DFA would not accept this language. Probably I think in incorrect way? Can you give some advice how to create DFA that will accept language $L$?

Best Answer

The regular language of even zeros is the language $(1*01*01*)*$, the regular language for no consecutive ones is $(1?0*)*$. One can construct $\varepsilon$-NFAs for each case using the Thompson construction, and use the subset construction to convert them into two explicit DFAs. One can then use the (constructive) proof that the finite union of two regular languages is regular to get an explicit DFA that matches both.

Related Question