Let $n \ge 2$ be a positive integer. An $n\times n$ grid of squares has been colored as a chessboard. Let a move consist of picking a square from the board and then changing the colors to the opposite for all squares that lie in the same row as the chosen square, as well as for all squares that lie in the same column (the chosen square itself is also changed to the opposite color). Find all values of $n$ for which it is possible to make all squares of the grid be the same color in a finite sequence of moves.
Problem
Source: Swiss TST/Latvian TST for Baltic Way 2022 P5
Tags: combinatorics, square grid, grid
15.07.2024 19:56
bump....
21.07.2024 09:40
bump....
21.07.2024 09:56
Let $S$ be the difference between the number of black and white squares. Then $S$ is fixed under modulo 2. Therefore the only possible values of $n$ are even numbers. For any even $n$, just pick all the white squares once and all the squares will turn black. Therefore, the answer is all $n$ such that $n\equiv 0\pmod{2}$
29.07.2024 12:51
dgkim wrote: Let $S$ be the difference between the number of black and white squares. Then $S$ is fixed under modulo 2. Therefore the only possible values of $n$ are even numbers... How do you finish here? I see that $S$ is fixed modulo 2 (actually it is also equal to the sum of both number modulo which is fixed because it is $n^2$). However, usually one would like to get a contradiction of the form $S$ is odd at the beginning but even at the end. Here both numbers are odd (because they are $n^2 \pmod{2}$).
29.07.2024 18:38
We show that the only $n \geq 2$ for which it is possible to go from a chessboard pattern to a unicolor pattern are the even numbers. In order to show that for all even $n$ it is possible just chose every white square once (as @dgkim said), then for each white square one can see that they will change color an odd number of time while the black cells will change color an even number of time. Thus, leaving the board $n \times n$ completely black. Assume now that $n$ is odd and that there is a sequence of moves that goes from a chessboard pattern to a unicolor pattern. Let $S$ be the number of black cells on the first two rows. Thus, $S=n$ is odd at the beginning. Each move will change either $2$ or $2+(n-1)=n+1$ of the cells of the first two rows (whether we chose a square outside of the first two rows or inside respectively). This implies that throughout the process each moves will not change the parity of $S$. At the end we need that $S=0$ or $2n$ is even! This yields the contradiction we needed.