Maths Olympiad Prep

Library / /2 of 2

Combinatorics Difficulty 7.6 National olympiad, round 2 Prove it Argentina

There is a lamp on each cell of an infinite square grid. Initially, all lamps are off. A move consists of choosing either a 3×33 \times 3, 4×44 \times 4 or 5×55 \times 5 square contained on the grid and switch all lamps inside that square from on to off or vice versa.

a. Prove that for any finite set SS of lamps it is possible to achieve, after a finite sequence of moves, that all lamps that are on are exactly the ones in SS.

b. Prove that if a sequence of moves only involves two of the three sizes of squares available, then it is not possible to achieve that in the end all lamps that are on are exactly the ones inside a 2×22 \times 2 square.

Solution

a. It suffices to show an algorithm that leaves exactly one lamp on (afterwards, the same algorithm can be repeated using appropriate translations). We will present two such algorithms.

ALGORITHM 1. Stacking four 3×33 \times 3 squares we get a 12×312 \times 3 rectangle, and stacking three 4×44 \times 4 squares we get a 12×412 \times 4 rectangle. By overlapping these moves, we get a 12×112 \times 1 rectangle of lamps that are on.

Figure 1

Figure 2

Figure 3

In a similar fashion we can make a sequence of moves that switches all lamps inside a 20×120 \times 1 rectangle (by overlapping 20×420 \times 4 and 20×520 \times 5 rectangles), or inside a 15×115 \times 1 rectangle (by overlapping 15×615 \times 6 and 15×515 \times 5 rectangles).
Since gcd(12,20,15)=1\gcd(12, 20, 15) = 1, it is possible to get a 1×11 \times 1 square with its lamp on by combining those rectangles. (For example: we turn 40 lamps on using two 20×120 \times 1 rectangles, then we turn the last 15 lamps off with a 15×115 \times 1 rectangle, and finally we turn further 24 lamps off by using two 12×112 \times 1 rectangles.)

ALGORITHM 2. With two 4×44 \times 4 squares and two 5×55 \times 5 squares we can achieve that inside a 9×99 \times 9 square all lamps are on, except for the one on the center. Now, we can divide the 9×99 \times 9 square into nine 3×33 \times 3 squares and make moves on them to switch all 81 lamps. This leaves only the central lamp on, as wanted.
Figure 4

b. First we analyze the case where only 3×33 \times 3 and 5×55 \times 5 squares are used. We color the columns of the grid with the following pattern: two black columns, one white column, two black, one white, .... Suppose the rows of the grid are labelled, in order, as ..., 3-3, 2-2, 1-1, 00, 11, 22, 33, .... For each residue rr modulo 5 we count how many rows with a label r(mod5)\equiv r \pmod 5 have an odd number of black cells with its lamp on. These five numbers are a,b,c,d,ea, b, c, d, e. Initially, all of them are equal to 0. A move with a 3×33 \times 3 square does not alter the parity of these numbers, since each row has either 2 or 0 black cells inside any 3×33 \times 3 square. A move with a 5×55 \times 5 square either leaves all parities unchanged or changes all of them (there is one row for each residue rr, and all of those rows have the same number of black cells).
So in both cases we find that a,b,c,d,ea, b, c, d, e are always all even or all odd. Therefore, it is impossible that after a sequence of moves the only lamps that are on are those inside a 2×22 \times 2 square if this square has 2 white cells and 2 black cells. By taking a translation of the original coloring we can always assume that is the case for our goal 2×22 \times 2 square.
A similar argument works for the remaining two cases.
If the squares used are 3×33 \times 3 and 4×44 \times 4, then we color the columns with the pattern 2 black, 2 white, 2 black, 2 white, ..., and we classify rows according to their residue modulo 3.
If the squares used are 4×44 \times 4 and 5×55 \times 5, we use the same coloring as in the previous case and we classify rows modulo 5.

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: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.