First Finite Automata Homework

For each of the languages below, come up with a finite automaton that recognizes the language. Draw a state diagram and give the formal definition. The formal definition consists of the set of states \(Q\), the alphabet \(\Sigma\), the transition function \(\delta\), the start state which must be an element of \(Q\), and the set of accept states \(F\).

For all languages the alphabet is \(\{\texttt{a},\texttt{b}\}\)

  1. \(\{w | w\) has at least one \(\texttt{a}\) and at least one \(\texttt{b} \}\)
  2. \(\{w | w\) has at exactly two \(\texttt{a}\)’s and at least two \(\texttt{b}\)’s \(\}\)
  3. \(\{w | w\) has an even number of \(\texttt{a}\)’s and one or two \(\texttt{b}\)’s \(\}\)
  4. \(\{w | w\) has even length and an odd number of \(\texttt{a}\)’s \(\}\)