Browse · MathNet
Print66th Belarusian Mathematical Olympiad
Belarus counting and probability
Problem
Given a table, all its cells being white.
Per move it is allowed to change the color of any three consecutive cells in any row or in any column (white cell is replaced by black one and vice versa). Find all possible values of such that one can obtain the chess coloring of the given table with black corner cells (the example of such coloring is shown in the figure for ). (E. Barabanov)





Solution
Answer: .
We say that a cell is black if this cell becomes black in the final coloring, and white if this cell becomes white in the final coloring. It is easy to see that we have black and white cells in the chess coloring of the given table with black corner cells. In particular, we have even number of white cells and odd number of black cells.
Since each of black cells must be recolored odd number of times and each of white cells must be recolored even number of times (may be, zero), the total number of the recolorings is odd. Per move odd number (namely, three) cells are recolored, so the number of moves is odd.
Now we show that if , then the number of moves to obtain the final coloring must be even, so one cannot obtain the final coloring for such .
Fig. 1 Fig. 2
Let , , , denote the vertices of the square (see Fig. 1). Consider any line parallel to the line (see Fig. 1) and passing through the centers of some cells. We call the set of all cells with the centers on such line a diagonal (see Fig. 1, where 4 from 13 possible diagonals of the square are indicated). It is evident that there are distinct diagonals starting from the cells of the half-perimeter , and each diagonal consists of either black cells (we call such diagonal black) or white cells (we call such diagonal white).
We number the cells of the half-perimeter as shown in Fig. 2. Consider the diagonals starting from the cells with the numbers which are divisible by 3 (let be the set of these diagonals), and write the symbol "" in the cells of these diagonals (see Fig. 3 and Fig. 4 for and , respectively). Find the parity of the number of the black cells with "". It is evident that the diagonal from starting from the cell with even (odd) number is white (black). It is also evident that the diagonal starting from the cell with odd number consists of odd number of the cells. Hence, the parity of the number of the black cells with "" is equal to the parity of the number of all odd numbers (divisible by 3) between 1 and .
Fig. 3 Fig. 4
If , i.e., , , then and between 1 and odd numbers which are divisible by 3 have the forms . There are such numbers.
If , i.e., , , then and between 1 and odd numbers which are divisible by 3 have the forms . There are such numbers.
If , i.e., , , then and between 1 and odd numbers which are divisible by 3 have the forms . There are such numbers.
Therefore, the symbol "" is written in the even number of black cells if , and the symbol "" is written in the odd number of black cells if . Suppose one can obtain the final coloring after some moves. It is easy to see that per move exactly one cell with "" is recolored. Hence we can divide all moves into two sets: the set consists of the moves when some white cell (with "") is recolored and the set consists of the moves when some black cell (with "") is recolored. There are even number of the moves from because any recolored white cell is recolored even number of times; there are also even number of moves from if , since in this case we have even number of black cells with "*" and each of them must be recolored odd number of times. Therefore, one must make even number of moves, contrary to our previous statement about the parity of the moves for . Thus, for one cannot obtain the required chess coloring of the table.
If , i.e., is divisible by 3, one can obtain the required coloring. It suffices to divide the table into the squares and in each such square make the moves depending on the arrangement of the black cells in this square as it is shown in Fig. 5 or Fig. 6, where the moves are shown as the segments connecting the centers of the recolored cells.
Fig. 5 Fig. 6
We say that a cell is black if this cell becomes black in the final coloring, and white if this cell becomes white in the final coloring. It is easy to see that we have black and white cells in the chess coloring of the given table with black corner cells. In particular, we have even number of white cells and odd number of black cells.
Since each of black cells must be recolored odd number of times and each of white cells must be recolored even number of times (may be, zero), the total number of the recolorings is odd. Per move odd number (namely, three) cells are recolored, so the number of moves is odd.
Now we show that if , then the number of moves to obtain the final coloring must be even, so one cannot obtain the final coloring for such .
Fig. 1 Fig. 2
Let , , , denote the vertices of the square (see Fig. 1). Consider any line parallel to the line (see Fig. 1) and passing through the centers of some cells. We call the set of all cells with the centers on such line a diagonal (see Fig. 1, where 4 from 13 possible diagonals of the square are indicated). It is evident that there are distinct diagonals starting from the cells of the half-perimeter , and each diagonal consists of either black cells (we call such diagonal black) or white cells (we call such diagonal white).
We number the cells of the half-perimeter as shown in Fig. 2. Consider the diagonals starting from the cells with the numbers which are divisible by 3 (let be the set of these diagonals), and write the symbol "" in the cells of these diagonals (see Fig. 3 and Fig. 4 for and , respectively). Find the parity of the number of the black cells with "". It is evident that the diagonal from starting from the cell with even (odd) number is white (black). It is also evident that the diagonal starting from the cell with odd number consists of odd number of the cells. Hence, the parity of the number of the black cells with "" is equal to the parity of the number of all odd numbers (divisible by 3) between 1 and .
Fig. 3 Fig. 4
If , i.e., , , then and between 1 and odd numbers which are divisible by 3 have the forms . There are such numbers.
If , i.e., , , then and between 1 and odd numbers which are divisible by 3 have the forms . There are such numbers.
If , i.e., , , then and between 1 and odd numbers which are divisible by 3 have the forms . There are such numbers.
Therefore, the symbol "" is written in the even number of black cells if , and the symbol "" is written in the odd number of black cells if . Suppose one can obtain the final coloring after some moves. It is easy to see that per move exactly one cell with "" is recolored. Hence we can divide all moves into two sets: the set consists of the moves when some white cell (with "") is recolored and the set consists of the moves when some black cell (with "") is recolored. There are even number of the moves from because any recolored white cell is recolored even number of times; there are also even number of moves from if , since in this case we have even number of black cells with "*" and each of them must be recolored odd number of times. Therefore, one must make even number of moves, contrary to our previous statement about the parity of the moves for . Thus, for one cannot obtain the required chess coloring of the table.
If , i.e., is divisible by 3, one can obtain the required coloring. It suffices to divide the table into the squares and in each such square make the moves depending on the arrangement of the black cells in this square as it is shown in Fig. 5 or Fig. 6, where the moves are shown as the segments connecting the centers of the recolored cells.
Fig. 5 Fig. 6
Final answer
n ≡ 1 (mod 3)
Techniques
Invariants / monovariantsColoring schemes, extremal arguments