Olympiad Maths Prep

Track / Stage 5 / 289 of 400 #889 of 2000

Problem 889

AIME late
Combinatorics Difficulty 5.7 Find the answer

Problem 5. On a 2014×20142014 \times 2014 board, there is a lamp on each of the 201422014^{2} squares. Lamps can be on or off. In the initial situation, some of the lamps are on. In a move, you choose a row or column in which at least 1007 lamps are on and change the status of all 2014 lamps in that row or column (from on to off and from off to on). Find the smallest non-negative integer kk such that the following holds: from any initial situation, you can reach a situation in a finite number of steps where at most kk lamps are on.

Official solution

Solution. Number the rows from 1 to 2014 and the columns as well. Consider the following initial situation: in row ii, the lamps in columns i,i+1,,i+1005i, i+1, \ldots, i+1005 are on and the rest are off, where we calculate the column numbers modulo 2014. Now, in each row and each column, exactly 1006 lamps are on. Therefore, no move is possible. It is thus not always possible to reach a situation with fewer than 201410062014 \cdot 1006 lamps on.

Now, let's show that we can always reach a situation with at most 201410062014 \cdot 1006 lamps on. Suppose, for the sake of contradiction, that in a certain situation there are at least 20141006+12014 \cdot 1006 + 1 lamps on and it is not possible to reduce the number of lamps on. If there is a row or column with 1008 or more lamps on, we can change the status of the lamps in this row or column, and there will be fewer lamps on afterward, a contradiction. Therefore, in every row and column, there are at most 1007 lamps on.

Let II be the set of rows with exactly 1007 lamps on, and let J1J_{1} be the set of columns with exactly 1007 lamps on. We plan to change the status of the lamps in all rows in II. This is called the big plan. If after executing the big plan, a column has 1008 or more lamps on, we get a contradiction again, so we assume that this does not happen. Let J2J_{2} be the set of columns that will have exactly 1007 lamps on after executing the big plan. If there is a cell (i,j)(i, j) with iIi \in I and jJ1j \in J_{1} where the lamp is off, I can change row ii and get more than 1007 lamps on in column jj, a contradiction. Therefore, every lamp at (i,j)(i, j) with iIi \in I and jJ1j \in J_{1} is on. If there is a cell (i,j)(i, j) with iIi \in I and jJ2j \in J_{2} where the lamp is off after executing the big plan, I get a contradiction in the same way. Therefore, every lamp at (i,j)(i, j) with iIi \in I and jJ2j \in J_{2} is on after executing the big plan. Since the columns in J2J_{2} each have exactly 1007 lamps on after executing the big plan, they had 1007I1007 - |I| lamps on before the big plan. (The notation X|X| denotes the number of elements in the set XX.) The columns in J1J_{1} each have exactly 1007 lamps on, and this also means that J1J_{1} and J2J_{2} are disjoint (no overlapping columns). The remaining columns have at most 1006 lamps on. The total number of lamps on before the big plan is thus at most

(1007I)J2+1007J1+1006(2014J1J2)=10062014+J1+J2IJ2 (1007 - |I|) |J_{2}| + 1007 |J_{1}| + 1006 (2014 - |J_{1}| - |J_{2}|) = 1006 \cdot 2014 + |J_{1}| + |J_{2}| - |I| \cdot |J_{2}|

This must be at least 10062014+11006 \cdot 2014 + 1, so J1+J2IJ21|J_{1}| + |J_{2}| - |I| \cdot |J_{2}| \geq 1. This implies J1>(I1)J2|J_{1}| > (|I| - 1) |J_{2}|. If I2|I| \geq 2, then J1>J2|J_{1}| > |J_{2}|. By executing the big plan, the number of columns with 1007 lamps on is thus reduced. But then we have a situation again with I|I| rows with 1007 lamps on, where J1J_{1} and J2J_{2} are exactly swapped. So we can execute a new big plan, which again reduces the number of columns with 1007 lamps on. Contradiction, because we are back in the initial situation. We conclude that I=1|I| = 1 must hold.

We thus have the situation that there is exactly one row with exactly 1007 lamps on. Similarly, we can show that there must also be exactly one column with exactly 1007 lamps on. Since there are 10062014+11006 \cdot 2014 + 1 lamps on, there must be exactly 1006 lamps on in every other row and column. Now change the status of the lamps in the row with 1007 lamps on. In 1007 columns, there will then be 1006+1=10071006 + 1 = 1007 lamps on. We have already seen that in this situation, the number of lamps that are on can be reduced.

We see that if there are more than 100620141006 \cdot 2014 lamps on, it is always possible to reduce this number. Therefore, the smallest kk is 100620141006 \cdot 2014.

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