Let $A = \{ a,b\} $ and $ L = \{ w \in A^* : |a| = 2k+1, |b| = 2l, k,l \ge 0 \}$
$|a| = 2k+1 $ means that amount of 'a' in word $w$ should be odd. I am asking for any advice. I tried do it a lot of hours.
Let $A = \{ a,b\} $ and $ L = \{ w \in A^* : |a| = 2k+1, |b| = 2l, k,l \ge 0 \}$
$|a| = 2k+1 $ means that amount of 'a' in word $w$ should be odd. I am asking for any advice. I tried do it a lot of hours.
To keep track of, if there is an odd number of $a$ symbols, you need only two states, one corresponding to "odd number of $a$ seen so far" $q_{oa}$ and one corresponding to "even number of $a$ seen so far" $q_{ea}$ and every accepted $a$ should switch between those two states.
Similar construction for $b$. Combine this into a product of states $$ Q = \{ q_{eaeb}, q_{oaeb}, q_{eaob}, q_{oaob} \} $$ Initially you are in state $q_0 = q_{eaeb}$ and $q_{oaeb}$ should be the final state, $F = \{ q_{oaeb} \}$.
Then we have the transitions $$ \begin{array}{cc|c} q & s & q' = \delta(q, s) \\ \hline q_{eaeb} & a & q_{oaeb} \\ q_{eaeb} & b & q_{eaob} \\ q_{eaob} & a & q_{oaob} \\ q_{eaob} & b & q_{eaeb} \\ q_{oaeb} & a & q_{eaeb} \\ q_{oaeb} & b & q_{oaob} \\ q_{oaob} & a & q_{eaob} \\ q_{oaob} & b & q_{oaeb} \\ \end{array} $$
This should specify the DFA $\mathcal{A} = (Q, A, q_0, \delta, F)$.
$\quad\quad\quad\quad\quad\quad\quad$