This is a problem from the book A Book of Abstract Algebra by Pinter; chapter 6H (Theory of Automata).
I am unable to make any progress in this problem. I was thinking one can take
$$S=\{s_0,s_1,s_2,s_3\}.$$
But then why does this says whether the sequence contains exactly three $a$’s.
Any help or hint will be appreciated. Thanks in advance.


I assume that in your diagram the arrows that aren't indicated keep you in the same state. I assume that $s_0$ is the initial state and $s_3$ is intended to be the unique accepting state.
There are a couple of problems with this automaton:
There is no reason for $d$ to take you back to $s_2$. For example, $aaad$ ought to be accepted but isn't.
Your automaton will accept words with more than three $a$'s.