Maths Olympiad Prep

Library / /49 of 94

Combinatorics Difficulty 6.8 National Olympiad Prove it Japan

Suppose 1212 boxes are lined up from left to right. We want to put a ball in each of these 1212 boxes. Balls are colored red, blue or yellow. How many distinct ways of putting balls into the 1212 boxes are there if the following condition is to be satisfied?

* Condition: For each ball placed in a box, at least 11 of the balls in the adjacent boxes has the same color as its color.

Solution

For an integer n2n \ge 2, let us consider the number of ways of filling the nn boxes lined up from left to right by putting nn balls one-by-one into the boxes starting from the left-most one, assuming that any of the balls can have any of the three colors. Denote by ana_n the possible number of ways of filling the boxes so as to satisfy the condition of the problem, starting with a red ball going into the left-most box. We see that the number of ways will be the same ana_n if we start with a blue ball instead of a red one, and this is true also if we start with a yellow one.

Next, suppose n4n \ge 4, and we start with a red ball, and count how many red balls were used before the first non-red ball is put into a box. Call this number kk. Then by the assumption of the problem, k2k \ge 2. Now consider the following two cases:

(1) When k=2k=2: In this case, either a blue or a yellow ball has to go into the third box, and in either case the number of ways of filling the remaining n2n-2 boxes so as to satisfy the condition of the problem is an2a_{n-2}, and therefore there are 2an22a_{n-2} ways of filling the nn boxes so as to satisfy the condition.

(2) When k3k \ge 3: In this case, if we remove the left-most box (containing a red ball), the left-most box for the remaining n1n-1 boxes has a red ball and the number of ways of filling the remaining n2n-2 boxes must be an1a_{n-1} in order to satisfy the condition.

Thus we get the recurrence formula: an=an1+2an2a_n = a_{n-1} + 2a_{n-2}.

When n=2,3n=2,3 the only way to fill boxes starting with a red ball and satisfying the condition is to use red balls only, so we have a2=1a_2 = 1 and a3=1a_3 = 1.

If we use the recurrence formula above repeatedly, we obtain a12=683a_{12} = 683, and therefore, the desired answer is 3×683=20493 \times 683 = 2049.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.