Skip to main content
OlympiadHQ

Browse · MathNet

Print

2023 Chinese IMO National Team Selection Test

China 2023 counting and probability

Problem

Find the largest positive integer such that there is a way to color some of the cells red in a grid, satisfying the following two conditions: (1) There do not exist two red cells such that the number of red cells in the row they belong to and the number of red cells in the column they belong to are the same; (2) There are at least 2 rows each containing exactly red cells.
Solution
Let the row with the maximum number of red squares (let's assume it's the first row) have red squares, and the column with the maximum number of red squares (let's assume it's the first column) have red squares. If , consider the columns in which the red squares of the first row are located. These columns must have distinct numbers of red squares and can only be chosen from . This leads to a contradiction. Similarly, we can show that cannot be less than . Therefore, we conclude that . Moreover, the number of red squares in the columns where the red squares of the first row are located must be a permutation of , and the number of red squares in the rows where the red squares of the first column are located must also be a permutation of . In other words, for any , there exist rows with exactly red squares and columns with exactly red squares.

Next, we prove that there exists a coloring that satisfies condition (1) and has rows with exactly red squares and columns with exactly red squares (, ), if and only if there exists a coloring of an grid such that the th row has exactly red squares and the th column has exactly red squares (). ().

First, we prove the necessity. If the coloring of a grid satisfies condition (1), we construct an grid with the following coloring: for any , the cell in the th row and th column of is colored red if and only if has a red cell in a row with exactly red cells and a column with exactly red cells (denoted as ). Note that in , the number of red cells in a row with exactly red cells is , and the numbers of red cells in their corresponding columns are distinct. Therefore, satisfies if and only if there are exactly red cells in column , which implies that the th row of has exactly red cells. Similarly, the th column of has exactly red cells. Thus, the necessity is proved.

Next, we prove the sufficiency. Assume that the grid has exactly red cells in the th row and exactly red cells in the th column. We construct a grid as follows: we label all rows of as () and all columns of as (). Then, we color the cells of as follows: if the cell in the th row and th column of is red, we mark as a good pair. For each good pair , we define as the index of (in ascending order) such that is a good pair, and as the index of (in ascending order) such that is a good pair. Then, in , we color the intersection of row and column red. In this way, each good pair is associated with only one pair of row and column , satisfying condition (1). Moreover, for any row , the red cells correspond to values that are the st, nd, ..., th smallest among all good pairs . Thus, this row has exactly red cells. Similarly, each column has exactly red cells. Therefore, the sufficiency is proved, and thus (
) holds.

Returning to the original problem, let's first construct an example for . Consider a grid , where the cell in the th row and th column is colored red if and only if . This coloring ensures that each row of has a decreasing number of red cells from 64 to 2, and each column has the same pattern. Now, let while all other and are set to 1. According to (*) and the above construction, we know that there exists a grid that satisfies condition (1) and has two rows with exactly 32 red cells. Thus, we have shown that meets the requirements of the problem.

Finally, we prove that cannot be greater than 32. Note that when , we have , which implies . We only need to show that cannot equal 33 or 34. In this case, we only need to consider . For the grid and any , the difference between the total number of red cells in any rows and the total number of red cells in any columns is no more than the total number of red cells in those rows and the remaining columns, which is no more than .

If , then we have and all other can only be 1. From calculating twice, we find that only and all other can only be 1. In this case, in the grid , the top 5 rows with the maximum number of red cells have at least red cells, while the leftmost 5 columns with the minimum number of red cells have red cells. However, which leads to a contradiction!

If , similarly, we have which means that at least one of is not less than 2. Since we have . Furthermore, notice that which implies . However, this contradicts the fact that .

If (in this case, ), similarly, we have which implies that at least one of is not less than 2. Additionally, we have which means that . Furthermore, we have implying that . Finally, we have which shows that . However, this contradicts the fact that .

If (in this case, ), we have two values of equal to 66, indicating that all are not less than 2, i.e., . Similarly, we have which implies . Furthermore, we have implying . Additionally, we have which shows . Moreover, we have implying . However, this contradicts the fact that .

In conclusion, the maximum value of that satisfies the conditions is 32.
Final answer
32

Techniques

Coloring schemes, extremal argumentsPigeonhole principleCounting two ways