Maths Olympiad Prep

Library / /385 of 520

Combinatorics Difficulty 5.9 AIME, harder Find the answer

In a 643 square grid, there are only two types of cells: mine cells and number cells. Mine cells do not contain numbers. A number cell contains a number mm if and only if there are mm mine cells among its 8 surrounding cells (when the number cell is on the edge or corner of the grid, this changes to 5 surrounding cells or 3 surrounding cells).
(1) If a (2n+1)×(2n+1)(2 n+1) \times(2 n+1) grid contains n2+1n^{2}+1 mine cells, find the maximum value of the sum of all numbers in the number cells;
(2) Find the maximum value of kk such that in any n×nn \times n grid containing kk mine cells, there is at least one number cell with the number 0 (express the result in terms of nn).

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.

Solution

Let's first agree: When and only when two cells share at least one vertex, they are called "adjacent"; the cell in the ii-th column and jj-th row of the grid is denoted as (i,j)(i, j).
(1) Let mi(i=1,2,,3n2+4n)m_{i}\left(i=1,2, \cdots, 3 n^{2}+4 n\right) represent the number of mine cells adjacent to the number cell MiM_{i}, and let lj(j=1,2,,n2+1)l_{j}(j=1,2, \cdots, n^{2}+1) represent the number of number cells adjacent to the mine cell LjL_{j}. Since the adjacency relationship is mutual, we have
mi=lj\sum m_{i}=\sum l_{j}.
We only need to find the maximum value of li\sum l_{i}.
For n=1n=1, by trial, we get lj11\sum l_{j} \leqslant 11.
When n2n \geqslant 2, let there be BB mine cells on the boundary (excluding the four corners), JJ mine cells at the four corners, and SS pairs of adjacent mine cells. A mine cell not on the boundary or corners can be adjacent to at most 8 number cells, a mine cell on the boundary can be adjacent to at most 5 number cells, and a mine cell at the corner can be adjacent to at most 3 number cells. Apart from the positional factors, each pair of adjacent mine cells (Lk,Lj)\left(L_{k}, L_{j}\right) will cause lkl_{k} and ljl_{j} to each decrease by 1, thus reducing li\sum l_{i} by 2. Therefore,
lj=8(n2+1)(85)B(83)J2S\sum l_{j}=8\left(n^{2}+1\right)-(8-5) B-(8-3) J-2 S
=8(n2+1)3B5J2S=8\left(n^{2}+1\right)-3 B-5 J-2 S.
Clearly, lj8(n2+1)1\sum l_{j} \neq 8\left(n^{2}+1\right)-1.
First, we prove:
lj8(n2+1)\sum l_{j} \neq 8\left(n^{2}+1\right) and lj8(n2+1)2\sum l_{j} \neq 8\left(n^{2}+1\right)-2,

i.e., (B,J,S)(0,0,0)(B, J, S) \neq(0,0,0) and (B,J,S)(0,0,1)(B, J, S) \neq(0,0,1).
Proof by contradiction.
Assume (B,J,S)=(0,0,0)(B, J, S)=(0,0,0) or (0,0,1)(0,0,1).
We provide two ways to partition the grid.
Partition 1: For any r,S{0,1,,n}r, S \in\{0,1, \cdots, n\},

cells (2r,2s)(2r+1,2s)(2r,2s+1)(2r+1,2s+1)(2 r, 2 s) 、(2 r+1,2 s) 、(2 r, 2 s+1) 、(2 r+1, 2 s+1) are grouped into one region.
Partition 2: For any r,S{0,1,,n}r, S \in\{0,1, \cdots, n\}, cells (2r+1,2s+1)(2r+1,2s+2)(2r+2,2s+1)(2r+2,2s+2)(2 r+1,2 s+1) 、(2 r+1,2 s+2) 、(2 r+2, 2 s+1) 、(2 r+2,2 s+2) are grouped into one region (a region is considered to exist only if it contains at least one meaningful cell or a cell that has not been removed).

Since B=J=0B=J=0, we can remove all corner cells, leaving n2n^{2} regions. Because n2n \geqslant 2, there exists at least one region containing 2 cells. Since the total number of mine cells is n2+1n^{2}+1, by the pigeonhole principle, there must be a region containing at least two mine cells, i.e., a pair of adjacent mine cells, so S0S \neq 0.

Similarly, there is a pair of adjacent mine cells in Partition 2. Note that in Partition 1, two cells in the same region are in different regions in Partition 2. Thus, these two pairs of adjacent mine cells are different. Therefore, S1S \neq 1. This contradicts both assumptions, so the assumptions are false, i.e., (B,J,S)(0,0,0)(B, J, S) \neq(0,0,0) and (B,J,S)(0,0,1)(B, J, S) \neq(0,0,1).
Next, we prove: lj8(n2+1)3\sum l_{j} \neq 8\left(n^{2}+1\right)-3, i.e.,
(B,J,S)(1,0,0)(B, J, S) \neq(1,0,0).
Proof by contradiction.
Assume (B,J,S)=(1,0,0)(B, J, S)=(1,0,0). Suppose the mine cell on the boundary is at (k,1)(k, 1). After removing all corner cells and using Partition 1, we form n2n^{2} regions. Since S=0S=0, each region must contain exactly one mine cell; and to ensure no mine cell is adjacent to (k,1)(k, 1), (k1,2)(k,2)(k+1,2)(k-1,2) 、(k, 2) 、(k+1,2) must not be mine cells. But these three cells already contain one region, which is a contradiction. Therefore, the assumption is false, i.e., (B,J,S)(1,0,0)(B, J, S) \neq(1,0,0).

Thus, li8(n2+1)4\sum l_{i} \leqslant 8\left(n^{2}+1\right)-4, with equality when (B,J,S)=(0,0,2)(B, J, S) = (0,0,2).

In fact, when all cells in even rows and even columns are mine cells, and cell (3,2)(3,2) is a mine cell, the maximum value can be achieved (at this time, the pairs of adjacent mine cells are only (2,2)(2,2) and (3,2)(3,2) and (4,2)(4,2).

In summary, for n=1n=1, the maximum value is 1111; for n2n \geqslant 2, the maximum value is 8n2+48 n^{2}+4.
(2) If the smallest positive integer qq such that there exists an n×nn \times n grid with qq mine cells and no number cell filled with 0 is qmin q_{\text {min }}, then kmax =qmin 1k_{\text {max }}=q_{\text {min }}-1.

Note that a grid has no 0 if and only if each cell satisfies: it is a mine cell or it is adjacent to at least one mine cell.
Let S={(i,j)i=j1(mod3)}S=\{(i, j) \mid i=j \equiv 1(\bmod 3)\}.
Then S=[n+23]2([x]|S|=\left[\frac{n+2}{3}\right]^{2}([x] denotes the greatest integer not exceeding the real number xx).

For any (i,j)S(i, j) \in S, let the set of (i,j)(i, j) and all cells adjacent to it be S(i,j)S(i, j). It is easy to see that the intersection of any two S(i,j)S(i, j) is empty. Since any two cells in SS are not adjacent and cannot be adjacent to the same mine cell, and (i,j)(i, j) must satisfy: it is a mine cell or it is adjacent to at least one mine cell, each S(i,j)S(i, j) must contain at least one mine cell, i.e., qSq \geqslant|S|.

To make qq attain this minimum value, we only need to let each (i,j)(i, j) satisfying ij1(mod3)i \equiv j \equiv 1(\bmod 3) be a mine cell when n=1(mod3)n = 1(\bmod 3); and let each (i,j)(i, j) satisfying ij=2(mod3)i \equiv j = 2(\bmod 3) be a mine cell when n0(mod3)n \equiv 0(\bmod 3) or n2(mod3)n \equiv 2(\bmod 3). It is easy to verify that in this case q=Sq=|S| and the grid has no number 0. Thus, qmin =[n+23]2q_{\text {min }}=\left[\frac{n+2}{3}\right]^{2}.
Therefore, kmax =qmin 1=[n+23]21k_{\text {max }}=q_{\text {min }}-1=\left[\frac{n+2}{3}\right]^{2}-1.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.