Problem:
How many ways can one color the squares of a grid red and blue such that the number of red squares in each row and column is exactly ?
Problem:
How many ways can one color the squares of a grid red and blue such that the number of red squares in each row and column is exactly ?
Solution:
Answer:
Assume the grid is . Let denote the number of ways to color exactly two squares in each row and column red. So and . We note that coloring two squares red in each row and column partitions the set into cycles such that is in the same cycle as, and adjacent to, iff column and column have a red square in the same row. Each is adjacent to two others (or the same one twice in a -cycle).
Now consider the cycle containing , and let it have size . There are 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 ways to pick this column, and ways to pick the second red square in this column (unless ). Then there are ways to pick the red squares in the third column, and ways to pick the th ones for . Then when we pick the th column, the last one in the cycle, it has to be red in the same row as the second red square in column , so there are just choices. Therefore, if the cycle has length there are
ways, which equals:
Summing over the size of the cycle containing the first column, we get
We thus obtain the recursion:
Then we get: