# In how many ways can 9 cars be parked so that there are never two red cars next to each other?

Nine cars are parked in a row. Four of the cars are painted red and five are painted blue. In how many ways can the cars be parked so that there are never two red cars next to each other?

I think I know how to solve this but I am not sure.

First arranging the blue cars in line and specifying where the red ones could be parked.

$$\color{red}X\color{blue}B\color{red}X\color{blue}B\color{red}X\color{blue}B\color{red}X\color{blue}B\color{red}X\color{blue}B\color{red}X$$

Where $\color{blue}B$ stands for a parked blue car and $\color{red}X$ for a potential red car parking spot. So we have 6 $X's$ (red cars) and 5 $B's$ (blue cars). Note all cars are considered to be the same.

Then the answer is $C(6,4) = 15$?

• You are correct! – Nicholas Oct 26 '15 at 11:11

For validation, consider the number of partitions of $5$ into at least $3$ parts, namely $311$ and $221$ which yield $3$ solutions each, $2111$ which yields $8$ solutions, and $11111$ which yields $1$ solution - total $15$ solutions.