For the first square, there are three choices: red, yellow, or blue.
For the second square, there are also three choices: whatever color we didn't use for the first square.
For the third square, there are two choices: any color except the one used for the second square.
For the fourth square, there are two choices: any color except the one used for the third square.
For the fifth square, there are two choices: any color except the one used for the fourth square.
Since each choice for coloring a square is independent of the previous choices, there are a total of $3\cdot 3\cdot 2\cdot 2\cdot 2=\boxed{72}$ ways to color the five squares.
In a row of five squares, each square is to be colored either red, yellow, or blue, so that no two consecutive squares have the same color. How many ways are there to color the five squares?
1 answer