Maths Olympiad Prep

Library / /10 of 18

Combinatorics Difficulty 7.1 National Olympiad, round 2 Prove it Vietnam

Let M,NM, N be two positive integers. We put a light on each unit square of the table N×NN \times N (each light is either on or off). Initially, all the lights are off. In each step, we choose either a column or a row and switch MM consecutive lights on the chosen column/row. Find the necessary and sufficient condition of M,NM, N such that we can switch on all the lights after finite steps.

Solution

We show that the necessary and sufficient condition of the problem is NN is divisible by MM.

The sufficient condition is easy. If NN is divisible by MM then N/M=dN/M = d is a positive integer. In this case, we can divide the N×NN \times N table into NdNd rectangles of size M×1M \times 1. We can easily turn on all of the lights in such a way that turn on one M×1M \times 1 rectangle at the time.

Now we show that NN is divisible by MM is also the necessary condition. We color unit squares of the table by MM colors, denoted by 00 to M1M-1 such that the square (i,j)(i, j) is colored by the color i+j2(modM)i + j - 2 \pmod M. A light on the ss-colored square is called a ss-light.

We have the following observation: At each step of implementation, we will change the status of exactly MM lights, one light in each color. Since all the lights are initially off so after each step, the total lights are switched on of each color are of the same parity. So in order to switch on all the lights, the numbers of lights of each colors must have the same parity. Suppose that NN is not divisible by MM, then N=Mk+rN = Mk + r (1rM11 \le r \le M-1). We divide the table N×NN \times N into four subtables: Mk×MkMk \times Mk, Mk×rMk \times r, r×Mkr \times Mk, r×rr \times r.

1) Each of Mk×MkMk \times Mk, Mk×rMk \times r, r×Mkr \times Mk is a union of M×1M \times 1 rectangles or 1×M1 \times M rectangles so the number of lights of each color is Mk2+2krMk^2 + 2kr.

2) In the table r×rr \times r, the number of (r1)(r-1)-lights is rr, and the number of rr-lights is r1r-1. Indeed, because rM1r \le M-1 then any row contains the light with distinct color. On the other hand, the (r1)(r-1)-lights appear in all the rows of subtable and the rr-light appears in all the rows of subtable except the first row, then the proof of this case follows.

From 1) and 2), the number of rr-lights and the number of (r1)(r-1)-lights have different parity, which is a contradiction, then we have completed the problem.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.