Browse · MathNet
PrintVN IMO Booklet
Vietnam counting and probability
Problem
Consider a rectangle board of size with intersections. Some engineers want to build a route from which goes along the segments parallel to the sides of the board, passes through each intersection exactly once and finally turns back to .
a. Prove that they can build the route if and only if either is odd or is odd.
b. With satisfying the condition in (a), find the least number of intersections at each there is a turn.

a. Prove that they can build the route if and only if either is odd or is odd.
b. With satisfying the condition in (a), find the least number of intersections at each there is a turn.
Solution
We number the rows to from left to right, the columns to from top to bottom and suppose that the point is (at the top left of the board).
a. Necessary condition: The route can be written as a letter sequence consisting of and , which respectively represents left, right, up and down direction. Since there are intersections, the length of the sequence is .
Since the route starts at and returns to , it follows that the number of left turns is the same as the number of right turns and the number of up turns is equal to the number of down turns. In other words, the number of letter Ls is the same as the number of letter Rs, as well as the number of letter Us and the number of letter Ds are equal. This implies is even. Thus is odd or is odd.
Sufficient condition: Without loss of generality, suppose that is odd. We will construct the route by the following rules:
The first horizontal movement: we start at , go through the columns to . Every vertical movement is only one unit; if we move horizontally, move between columns and . The last horizontal movement: move from column to , then move vertically to .
This process can be done since is odd. We reach the conclusion of (a).
b. Consider two intersections at each of which there is a turn and the distance between those two turns are the closest ( is also counted as an intersection). Between the two intersections, there is a horizontal or vertical route.
Let be the number of horizontal sub-routes of the route, be the number of vertical sub-routes of the route and be the number of turns (not counted at ). We will prove the following remarks.
Remark 1. .
Proof. For each intersection at which there is a turn, there is exactly one horizontal sub-route and vertical sub-route. The number of turns, also counted at , is also the number of non-ordered pairs of the form
(horizontal sub-route, vertical sub-route)
where the horizontal sub-route and vertical sub-route intersects at some intersection. Moreover, each horizontal sub-route has common intersections with exactly two vertical sub-routes, and similarly each vertical sub-route has common intersections with exactly two horizontal sub-routes, thus
To find the least value of , we only need to find the least value of and .
Remark 2. or .
Proof. Suppose that , then there is a row on which each intersection lies on some vertical sub-route, which implies . Similarly, if then .
We consider the following cases:
If is odd, is even: suppose , by the above remark, there is a row on which each of intersections lies on some vertical sub-route, but since there is an odd number of intersections on this row, we cannot return to , a contradiction. Thus and . We can construct a route with exactly vertical sub-routes similarly to (a). Therefore, .
If is even, is odd: following the same pattern, we have .
If are odd: Equalities occur in the inequalities and , which implies that
In conclusion,
If are odd then . If is even and is odd then . * If is odd and is even then .
a. Necessary condition: The route can be written as a letter sequence consisting of and , which respectively represents left, right, up and down direction. Since there are intersections, the length of the sequence is .
Since the route starts at and returns to , it follows that the number of left turns is the same as the number of right turns and the number of up turns is equal to the number of down turns. In other words, the number of letter Ls is the same as the number of letter Rs, as well as the number of letter Us and the number of letter Ds are equal. This implies is even. Thus is odd or is odd.
Sufficient condition: Without loss of generality, suppose that is odd. We will construct the route by the following rules:
The first horizontal movement: we start at , go through the columns to . Every vertical movement is only one unit; if we move horizontally, move between columns and . The last horizontal movement: move from column to , then move vertically to .
This process can be done since is odd. We reach the conclusion of (a).
b. Consider two intersections at each of which there is a turn and the distance between those two turns are the closest ( is also counted as an intersection). Between the two intersections, there is a horizontal or vertical route.
Let be the number of horizontal sub-routes of the route, be the number of vertical sub-routes of the route and be the number of turns (not counted at ). We will prove the following remarks.
Remark 1. .
Proof. For each intersection at which there is a turn, there is exactly one horizontal sub-route and vertical sub-route. The number of turns, also counted at , is also the number of non-ordered pairs of the form
(horizontal sub-route, vertical sub-route)
where the horizontal sub-route and vertical sub-route intersects at some intersection. Moreover, each horizontal sub-route has common intersections with exactly two vertical sub-routes, and similarly each vertical sub-route has common intersections with exactly two horizontal sub-routes, thus
To find the least value of , we only need to find the least value of and .
Remark 2. or .
Proof. Suppose that , then there is a row on which each intersection lies on some vertical sub-route, which implies . Similarly, if then .
We consider the following cases:
If is odd, is even: suppose , by the above remark, there is a row on which each of intersections lies on some vertical sub-route, but since there is an odd number of intersections on this row, we cannot return to , a contradiction. Thus and . We can construct a route with exactly vertical sub-routes similarly to (a). Therefore, .
If is even, is odd: following the same pattern, we have .
If are odd: Equalities occur in the inequalities and , which implies that
In conclusion,
If are odd then . If is even and is odd then . * If is odd and is even then .
Final answer
a) A route exists if and only if at least one of the side lengths is odd. b) The minimum number of turns is: if both side lengths are odd, then two times the smaller plus one; if one is even and the other is odd, then two times the odd one plus one.
Techniques
Graph TheoryCounting two waysInvariants / monovariantsColoring schemes, extremal arguments