Let $n$ be an odd positive integer, and consider an infinite square grid. Prove that it is impossible to fill in one of $1,2$ or $3$ in every cell, which simultaneously satisfies the following conditions: (1) Any two cells which share a common side does not have the same number filled in them. (2) For any $1\times 3$ or $3\times 1$ subgrid, the numbers filled does not contain $1,2,3$ in that order be it reading from top to bottom, bottom to top, or left to right, or right to left. (3) The sum of numbers of any $n\times n$ subgrid is the same.
Problem
Source: Japan Mathematical Olympiad Finals 2018 Q4
Tags: combinatorics, grid
14.02.2018 10:43
I think here's the general idea of the solution. Firstly, if there are no $2$s on the grid, the claim is obvious. Note that a number to the left and right of a number $2$ must be equal, similarly to top and bottom. If some pattern of the form .a. b2b .a. appears, with $a \neq b$, then we note that the whole grid is uniquely determined (the corners must be $2$ and the pattern repeats). This case can again be easily solved. Otherwise, for every occurence of $2$, all $4$ adjacent cells have the same number. The key observation is that if we color the cells in white and black like a chessboard (adjacent cells have distinct colors), then one of the colors cannot contain the number $1$ and the cells of the other color cannot contain the number $3$. WLOG, the white cells cannot contain the number $1$ and the black cells cannot contain the number $3$. For every $n \times n$ subgrid, define the score as the difference between the number of white cells containing $2$ and the number of black cells containing $2$. Call a $n \times n$ subgrid white if the corners are white and black otherwise. All white $n \times n$ subgrid must have the same score while the score of a black $n \times n$ subgrid is $2$ less than a white $n \times n$ subgrid. Suppose $(1, 1)$ is white and consider the subgrid with corners $(1, 1), (n, n)$ and the subgrid with corners $(1, 2), (n, n + 1)$. The score of the strip with corners $(1, 1)$ and $(n, 1)$ must be $2$ more than the score of the strip with corners $(1, n + 1)$ and $(n, n + 1)$. But the difference between the score of the strip with corners $(2, 1)$ and $(n + 1, 1)$ and the strip with corners $(2, n + 1)$ and $(n + 1, n + 1)$ is $-2$, so this implies all the squares $(1, 1), (1, n + 1), (n + 1, 1), (n + 1, n + 1)$ are marked with $2$. Repeating the same argument gives us $(2, 1), (2, n + 1), (n + 2, 1), (n + 2, n + 1)$ are marked with $2$, a contradiction to (1).
22.01.2019 02:47
How do you prove that the difference between a black and white cells is invariant?
01.05.2019 09:05
zschess wrote: For every $n \times n$ subgrid, define the score as the difference between the number of white cells containing $2$ and the number of black cells containing $2$. Call a $n \times n$ subgrid white if the corners are white and black otherwise. All white $n \times n$ subgrid must have the same score while the score of a black $n \times n$ subgrid is $2$ less than a white $n \times n$ subgrid. Why?
07.06.2019 16:34
bump this again. still dont know why.
23.07.2019 19:03
Bump... again
28.08.2019 19:07
Bumping..
28.12.2019 17:18
Bump, any other solution?
29.12.2019 15:24
zschess wrote: I think here's the general idea of the solution. Firstly, if there are no $2$s on the grid, the claim is obvious. Note that a number to the left and right of a number $2$ must be equal, similarly to top and bottom. If some pattern of the form .a. b2b .a. appears, with $a \neq b$, then we note that the whole grid is uniquely determined (the corners must be $2$ and the pattern repeats). This case can again be easily solved. Otherwise, for every occurence of $2$, all $4$ adjacent cells have the same number. The key observation is that if we color the cells in white and black like a chessboard (adjacent cells have distinct colors), then one of the colors cannot contain the number $1$ and the cells of the other color cannot contain the number $3$. WLOG, the white cells cannot contain the number $1$ and the black cells cannot contain the number $3$. For every $n \times n$ subgrid, define the score as the difference between the number of white cells containing $2$ and the number of black cells containing $2$. Call a $n \times n$ subgrid white if the corners are white and black otherwise. All white $n \times n$ subgrid must have the same score while the score of a black $n \times n$ subgrid is $2$ less than a white $n \times n$ subgrid. Suppose $(1, 1)$ is white and consider the subgrid with corners $(1, 1), (n, n)$ and the subgrid with corners $(1, 2), (n, n + 1)$. The score of the strip with corners $(1, 1)$ and $(n, 1)$ must be $2$ more than the score of the strip with corners $(1, n + 1)$ and $(n, n + 1)$. But the difference between the score of the strip with corners $(2, 1)$ and $(n + 1, 1)$ and the strip with corners $(2, n + 1)$ and $(n + 1, n + 1)$ is $-2$, so this implies all the squares $(1, 1), (1, n + 1), (n + 1, 1), (n + 1, n + 1)$ are marked with $2$. Repeating the same argument gives us $(2, 1), (2, n + 1), (n + 2, 1), (n + 2, n + 1)$ are marked with $2$, a contradiction to (1). Interesting puzzle but I only understood up to and including "all four numbers surrounding a 2 must be the same". Can you explain why the 1s must be confined to one color black or white, and the 3s must be confined to the other color?
14.06.2020 10:25
The key is to analyze the 2's, as they are the most restricted by condition 2. We first eliminate some annoying cases. If there are no 2's, then we must have a checkerboard pattern of 1 and 3. It is easy to eliminate this by condition 3. Another annoying case is where the 2's form a checkerboard pattern, i.e. if we were to color the grid black and white like a checkerboard, then all the 2's are on white squares. This case is easy to dispatch as well, using condition 3. Now assume neither of the aforementioned cases hold. Part 1: Understanding the grid. Define the buddies of a square to be the 4 adjacent squares. Lemma: The 4 buddies of any square labeled 2 have equal label. Proof: Label the 2 as $(0,0)$ in the coordinate plane. Note that the two numbers to the left and right of a 2 are equal by condition 2. Assume its 4 buddies are not all equal, then we must have \[ \begin{tabular}{ccc} & {\color{blue}3} & \\ {\color{blue}1} & {\color{red}2} & {\color{blue}1} \\ & {\color{blue}3} & \end{tabular} \]or the case where we switch the 1 and 3 above, but WLOG the above. We can build (almost like sudoku) to the following: \[ \begin{tabular}{ccccc} & {\color{blue}3} & 2 & 3 \\ {\color{blue}1} & {\color{red}2} & {\color{blue}1} & 2 & 1\\ & {\color{blue}3} & 2 \end{tabular} \]Now, it is clear that the grid is periodic with period 2 along the rows and columns. Therefore, the 2's appear in a checkerboard fashion, contradiction. $\blacksquare$ Claim: [Fixing the entire board upto 2's] Let $X=(0,0)$ be a 2. WLOG the 4 buddies around it are 3. Then for any point $(a,b)$, \[(a,b)= \begin{cases} \text{2 or 3}\iff a+b \text{ odd} \\ \text{2 or 1}\iff a+b \text{ even}. \end{cases} \]Proof: WLOG we handle the quadrant $a,b>0$. We induct on $a+b$, the case $a+b=1$ clear. Say we have some $(a,b)$, suppose $a+b$ odd. We know $(a-1,b)$ is 2 or 1 by induction. If $(a-1,b)=2$, then $(a-2,b)=3$, so $(a,b)=3$. If $(a-1,b)=1$, then $(a,b)$ is 2 or 3 obviously. This proves the claim in the case $a+b$ odd. The case $a+b$ even is similar. $\blacksquare$ Color the board black and white, WLOG $X$ at a white square. The claim tells us that all points an odd taxicab distance from $X$ are 2 or 3, and all points an even taxicab distance from $X$ are 2 or 1. Hence, all black squares are 2 or 3, and all white squares are 2 or 1. The structure of the board is fully determined: 1's can only be on white squares 3's can only be on black squares 2's can be anywhere. Of course, just using conditions 1 and 2, any board of the above form works, since clearly no equal numbers are adjacent, and placing a 2 anywhere will make the two horizontally adjacent labels equal and the two vertically adjacent labels equal. Part 2: Finishing the problem. We are now ready to use condition 3, along with the above structure, to get a contradiction. Let $[(a,b),(c,d)]$ be the box with corners $(a,b),(c,d)$. Define the diversity of a box $\text{div}[(a,b),(c,d)]$ to be number of 2's in the box on black squares $-$ number of 2's in the box on white squares. Define $\sum[(a,b),(c,d)]$ to be the sum of the numbers in the box. Since $[(1,0),(n+1,n)]$ has one more black square than $[(0,0),(n,n)]$, we have by condition 3: \begin{align*} 0&=\sum [(1,0),(n+1,n)] - \sum [(0,0),(n,n)] \\ &= 2 + \text{div}[(1,0),(n+1,n)]-\text{div}[(0,0),(n,n)]. \end{align*}Removing the center $[(1,0),(n,n)]$ block, this is equivalent to \[ \text{div}[(n,0),(n+1,n)] = \text{div}[(0,0),(1,n)]+2.\]Let $(a_1,\ldots,a_n,a_{n+1})=(x_{0,0},\ldots,x_{0,n},x_{0,n+1})$, and $(b_1,\ldots,b_n,b_{n+1})=( x_{n,0},\ldots,x_{n,n})$, where \[ x_{ij} = \begin{cases}1 &\text{ if } (i,j) \text{ is 2 and black} \\ -1 &\text{ if } (i,j) \text{ is 2 and white} \\0 &\text{ if } (i,j) \text{ is not 2}.\end{cases}\]By the definition of diversity, we have $\text{div}[(n,0),(n+1,n)]=b_1+\cdots+b_n$, and $\text{div}[(0,0),(1,n)]=a_1+\cdots+a_n$. Therefore, \[ b_1+\cdots+b_n = 2+a_1+\cdots + a_n. \]They key is to look at the same logic, but shifted up by 1. Shifting the strips up by 1, we have the same argument, except black and white switch, so we get \[ b_2+\cdots+b_{n+1} = -2 +a_2+\cdots+a_{n+1}. \]Subtracting, \[ b_{n+1}-b_1 = a_{n+1}-a_1-4. \]But $a_i,b_i \in \{-1,0,1\}$ for all $i$, so the above actually implies $b_{n+1}=-1,b_1=1,a_{n+1}=1,a_1=-1$. Therefore, all of $(0,0),(0,n+1),(n+1,0),(n+1,n+1)$ are 2. By similar logic, $(1,0),(1,n+1),(n+2,0),(n+2,n+1)$ are all 2, contradiction.