2011 AIME II Problem 7
Problem 7 of 15IntermediateCombinatorics
Ed has five identical green marbles, and a large supply of identical red marbles. He arranges the green marbles and some of the red ones in a row and finds that the number of marbles whose right hand neighbor is the same color as themselves equals the number of marbles whose right hand neighbor is the other color. An example of such an arrangement is GGRRRGGRG. Let be the maximum number of red marbles for which such an arrangement is possible, and let be the number of ways in which Ed can arrange the marbles to satisfy the requirement. Find the remainder when is divided by
Your answer
Integer from 0 to 999
Show solution
Solution
Break the row into maximal single-color runs. If there are runs, there are exactly different-color neighbor pairs. Since runs alternate colors and the five green marbles form at most runs, there are at most red runs, hence at most runs and at most different-color pairs. With red marbles there are neighbor pairs in all, and the requirement says half of them are different-color pairs, so i.e. Thus
With reds and marbles, the count of different-color pairs must be exactly so there are exactly runs: the colors must alternate as red–green–red––red with red runs and single green marbles between them. The arrangements correspond to compositions of into positive parts, of which there are
Hence and the remainder upon division by is
Tagged: arrangements with restrictions · partitions and compositions · stars and bars