Question 52
Suppose $12$ boxes are lined up from left to right. We want to put a ball in each of these $12$ boxes. Balls are colored red, blue or yellow. How many distinct ways of putting balls into the $12$ boxes are there if the following condition is to be satisfied?
* Condition: For each ball placed in a box, at least $1$ of the balls in the adjacent boxes has the same color as its color.
* Condition: For each ball placed in a box, at least $1$ of the balls in the adjacent boxes has the same color as its color.