A grid made up of squares is given. Suppose we want to color each of the squares by using one of the four colors, red, blue, yellow or green. How many ways of painting all of the boxes are there if the following requirement must be met:
For any row and any column one of the following 3 conditions must be satisfied:
* all four squares must be colored by the same color.
* use two colors, each one to be used to color two squares.
* use all four colors, each one to be used to color one square.
, 2019
Solution
When we say color in this solution we mean red, blue, yellow and green.
An -tuple of colors (in which the same color can appear any number of times) is called consistent if every color appearing appears an even number of times, or every color appearing appears an odd number of times. Note that must be even if is consistent. The conditions imposed for the problem is equivalent to the statement that for any row and any column the colors used to paint is consistent.
Lemma: Let be an odd number, and let be an -tuple of colors. Then, there exists a unique color for which becomes consistent.
Proof: Since is odd, there are odd number of colors which appear odd number of times among . Thus, there is one color for which the even-odd parity of the appearances among is different from other colors appearing there, and this color is .
Let us consider how many ways there are for coloring squares of the given grid to satisfy the conditions of the problem. As indicated in the diagram below, we indicate colors by using symbols. There are ways of choosing colors if we choose freely. If we fix one such choice, then by applying the Lemma to the upper rows to obtain , and by applying the Lemma to left columns to obtain . If we can show that the color for which is consistent coincides with the color for which is consistent, then this common color must be the unique color that should be used to color the right lowest corner of the diagram below.
Since each one of the quadruples
is consistent, the -tuple obtained by combining these four quadruples is consistent, and so is the -tuple obtained by deleting each of twice from the -tuple above. Thus, we conclude that is consistent. Arguing in the same way, we also get the fact that is consistent. In view of the Lemma above, we conclude that and represent the same color.
No matter how we choose the colors , we see that there is a unique choice of the color to color the right lowermost square of the diagram below. So, is the desired answer to the problem.