Maths Olympiad Prep

Library / /7 of 7

, 2014

Combinatorics Difficulty 7.5 National Olympiad, round 2 Prove it Thailand

Let MM and NN be positive integers. Mr. Pisut starts walking from the point (0,N)(0, N) to the point (M,0)(M, 0) in such a way that:
* each of his steps is of 1 unit length in the direction parallel to either the X-axis or the Y-axis;
* for each point (x,y)(x, y) on his path, x0x \ge 0 and y0y \ge 0.
For each step, he measures the distance from himself to the axis to which his step is parallel. If the step takes him farther away from the origin, he records the distance as a positive value; otherwise it is recorded in negative.
Prove that after he finishes his walk, the sum of all distances recorded is zero.

Solution

Suppose that Mr. Pisut walks kk steps in total and the ii-th step is from the point (xi1,yi1)(x_{i-1}, y_{i-1}) to the point (xi,yi)(x_i, y_i). Notice that if the ii-th step is parallel to the X-axis, then yi=yi1y_i = y_{i-1} and he records yi1(xixi1)y_{i-1}(x_i - x_{i-1}). Likewise, if the ii-th step is parallel to the Y-axis, then xi=xi1x_i = x_{i-1} and he records xi(yiyi1)x_i(y_i - y_{i-1}). So the distance he records for the ii-th step, regardless of the direction, is yi1(xixi1)+xi(yiyi1)y_{i-1}(x_i - x_{i-1}) + x_i(y_i - y_{i-1}). Therefore, the sum of all distances recorded is
i=1kyi1(xixi1)+xi(yiyi1)=i=1k(xiyixi1yi1)=xkykx0y0=M00N=0. \sum_{i=1}^{k} y_{i-1}(x_i - x_{i-1}) + x_i(y_i - y_{i-1}) = \sum_{i=1}^{k} (x_i y_i - x_{i-1} y_{i-1}) \\ = x_k y_k - x_0 y_0 = M \cdot 0 - 0 \cdot N = 0.

Solution 2:

First notice that if the path contains a step parallel to the X-axis followed immediately by a step parallel to the Y-axis – i.e. left-up, left-down, right-up, or right-down – then the sum of the distances recorded will remain unchanged if we swap (the directions of) those two steps, as one of the two distances recorded will increase by 1 while the other will decrease by 1. Notice also that the new path after such a swap will still satisfy all conditions for the walk.
Therefore, we can repeatedly swap two such steps as many times as possible. Notice that this procedure must terminate, resulting in a path that is parallel to the Y-axis at first, then to the X-axis later. That is, the final path consists of a walk along the Y-axis from (0,N)(0, N) to (0,0)(0, 0) and a walk along the X-axis from (0,0)(0, 0) to (M,0)(M, 0). The distance recorded for each step in this final path is 0, making the sum of all distances recorded zero. Since this sum remains unchanged throughout the procedure, we conclude that the sum of all distances recorded for the original path is zero as well.

Solution 3:

For each step that Mr. Pisut takes, we write +1+1 or 1-1 in each unit square between the step and the axis to which the step is parallel, where the choice of sign agrees with that of the recorded distance. Then the sum of all numbers written in each step is equal to the recorded distance for that step. Thus, it suffices to show that, after he finishes the walk, the sum of all numbers written in each unit square in the first quadrant is zero.
Consider the unit square Bi,jB_{i,j} with the lower left corner at (i,j)(i, j), where ii and jj are non-negative integers. Notice that in this square we write +1+1 only for every rightward step above the square and for every upward step on the right of the square. Similarly, we write 1-1 only for every leftward step above the square and for every downward step on the right of the square. In other words, we write +1+1 in Bi,jB_{i,j} whenever Mr. Pisut enters the region {(x,y):xi+12 and yj+12}\{(x, y) : x \ge i + \frac{1}{2} \text{ and } y \ge j + \frac{1}{2}\}, and we write 1-1 whenever he exits this region. Since he starts and ends his walk outside the region, the number of entries must be the same as the number of exits. Thus, the number of +1+1's written in Bi,jB_{i,j} is equal to the number of 1-1's, yielding the sum of zero as desired.

Figure 1

For each step, we write +1+1 or 1-1 in each unit square between the step and the axis.

Figure 2

This path enters and exits the shaded region twice, so we write two +1+1's and two 1-1's in the square B0,1B_{0,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: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.