Question: how many different ways are there to arrange the letters a b a and b?
Answer: For the second question, we have a a b, a b a, and b a a. There are three ways, just as there are for two letters b and one letter a: a b b, b a b, and b b a. This ought to look familiar.