The cells of a grid are each colored red, white, or blue. Sam starts at the bottom-left cell of the grid and walks to the top-right cell by taking steps one cell either up or to the right. Thus, he passes through 9 cells on his path, including the start and end cells. Compute the number of colorings for which Sam is guaranteed to pass through a total of exactly 3 red cells, exactly 3 white cells, and exactly 3 blue cells no matter which route he takes.
Solution
Let denote the cell in the -th row from the bottom and the -th column from the left, so Sam starts at and is traveling to . The key observation (from, say, trying small cases) is that Claim. For , the cells and must be the same color. Proof. Choose a path from to , and a path from to . Then consider the two paths and . These both must have 3 cells of each color, but they only differ at cells and . So these cells must be the same color. Hence, every diagonal must consist of cells of the same color. Moreover, any path that goes from to contains exactly one cell in for . So we simply need to color the diagonals such that there are 3 diagonals of each color. The number of ways to do this is .
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.