Maths Olympiad Prep

Library / /659 of 860

Combinatorics Difficulty 5.3 AIME, harder Find the answer

How many ways can one color the squares of a 6×66 \times 6 grid red and blue such that the number of red squares in each row and column is exactly 2?

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Assume the grid is n×nn \times n. Let f(n)f(n) denote the number of ways to color exactly two squares in each row and column red. So f(1)=0f(1)=0 and f(2)=1f(2)=1. We note that coloring two squares red in each row and column partitions the set 1,2,,n1,2, \ldots, n into cycles such that ii is in the same cycle as, and adjacent to, jj iff column ii and column jj have a red square in the same row. Each ii is adjacent to two other, (or the same one twice in a 2-cycle). Now consider the cycle containing 1, and let it have size kk. There are (n2)\binom{n}{2} ways to color two squares red in the first column. Now we let the column that is red in the same row as the top ball in the first column, be the next number in the cycle. There are n1n-1 ways to pick this column, and n2n-2 ways to pick the second red square in this column (unless k=2)k=2). Then there are (n2)(n3)(n-2)(n-3) ways to pick the red squares in the third column. and (nj)(nj+1)(n-j)(n-j+1) ways to pick the jj th ones for jk1j \leq k-1. Then when we pick the kk th column, the last one in the cycle, it has to be red in the same row as the second red square in column 1 , so there are just nk+1n-k+1 choices. Therefore if the cycle has length kk there are n!(n1)!2(nk)!(nk)!\frac{n!(n-1)!}{2(n-k)!(n-k)!} ways. Summing over the size of the cycle containing the first column, we get f(n)=k=2n12f(nk)(n)!(n1)!(nk)!(nk)!f(n)=\sum_{k=2}^{n} \frac{1}{2} f(n-k) \frac{(n)!(n-1)!}{(n-k)!(n-k)!}. We thus obtain the recursion: f(n)=n(n1)f(n1)+n(n1)22f(n2)f(n)=n(n-1) f(n-1)+\frac{n(n-1)^{2}}{2} f(n-2). Then we get: f(1)=0,f(2)=1,f(3)=6,f(4)=12×6+18=90,f(5)=20×90+40×6=2040,f(6)=30×2040+75×90=67950f(1)=0, f(2)=1, f(3)=6, f(4)=12 \times 6+18=90, f(5)=20 \times 90+40 \times 6=2040, f(6)=30 \times 2040+75 \times 90=67950.

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: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.