MathDB
Number of ways of placing balls subject to condition

Source:

December 31, 2011
combinatorics unsolvedcombinatorics

Problem Statement

Suppose there are nn boxes in a row and place nn balls in them one in each. The balls are colored red, blue or green. In how many ways can we place the balls subject to the condition that any box BB has at least one adjacent box having a ball of the same color as the ball in BB? [Assume that balls in each color are available abundantly.]