Given the language $L=\{w\in\{a,b\}^*\mid\text{$w$ has an odd quantity of $a$ and even quantity of $b$}\}$ answer

47 Views Asked by At

Find a finite automaton that recognizes the language $$L=\{w\in\{a,b\}^*\mid\text{$w$ has an odd quantity of $a$ and an even quantity of $b$}\}.$$ Indicate whether the automata is deterministic or not.


I tried to find a regular expression for $L$: $$(a(aa)^*+(bb)^*)^*$$ but then I realized that $\lambda\notin L$ since there is not odd quantity of $a$, so my final regex is $$(a(aa)^*+(bb)^*)^+$$ I am not able to find an automata for this language. I tried with:

My attempt

but if we call $z=a(aa)^*+(bb)^*$ then I am not able to graph $z^+$.

How can we get the automata?