Creating a DFA that only accepts number of a's that are multiples of 3
The key idea here is to make a ring of three states, $q_0, q_1, q_2$ with $a$ transitions 
$$\begin{align}
q_0 &amp; \stackrel{a}{\rightarrow}q_1\\
q_1 &amp; \stackrel{a}{\rightarrow}q_2\\
q_2 &amp; \stackrel{a}{\rightarrow}q_0
\end{align}$$
On input $aaa$, for example, you'll start in state $q_0$ and pass to state $q_1$ on the first $a$, $q_2$ on the second, and back to $q_0$ on the third $a$. Clearly, any multiple of three $a$s will leave you in state $q_0$, so we make that a final state.

What to do about $b$s in the input? They don't have any effect on the number of $a$s, so include transitions 
$$\begin{align}
q_0 &amp; \stackrel{b}{\rightarrow}q_0\\
q_1 &amp; \stackrel{b}{\rightarrow}q_1\\
q_2 &amp; \stackrel{b}{\rightarrow}q_2
\end{align}$$
and you're done. In fancier terms, we're $q_n$ to "remember" whether the number of $a$s seen so far was congruent to $n\pmod{3}$. This idiom, using the states to remember certain situations, is fundamental when designing FAs.