Well, as explained in the solution, we get three states, but we want to encode them symbolically with boolean variables. Since we need two variables, there are four states that are encoded with these two variables, and the full state transition diagram contains then also that fourth state {q,r} which is not reachable, but that is encoded as well.