The transition function for the language $L=\{w \mid n_a (w) \text{ and } n_b(w) \text{ are both odd} \}$ is given by:
$\delta (q_0, a)=q_1$ |
; |
$\delta (q_0, b)=q_2$ |
$\delta (q_1, a)=q_0$ |
; |
$\delta (q_1, b)=q_3$ |
$\delta (q_2, a)=q_3$ |
; |
$\delta (q_2, b)=q_0$ |
$\delta (q_3, a)=q_2$ |
; |
$\delta (q_3, b)=q_1$ |
The initial and final states of the automata are
- $q_0$ and $q_0$ respectively
- $q_0$ and $q_1$ respectively
- $q_0$ and $q_2$ respectively
- $q_0$ and $q_3$ respectively