Skip to main content
OlympiadHQ

Browse · MathNet

Print

Argentine National Olympiad 2015

Argentina 2015 counting and probability

Problem

The lower row of a rectangle is filled up with 13 markers labeled in this order. An operation is moving a marker from its cell to an adjacent (by side) empty cell. The task is to rearrange the markers in the reverse order, in the lower row again. Do this with a minimal number of operations.
Solution
Marker needs at least horizontal operations to reach its final position ; by symmetry the same holds for marker . Similarly markers and need at least horizontal operations each. The analogous observation about the pairs of markers ; ; ; implies that at least horizontal operations are needed to complete the task. As for the vertical operations, we claim that all markers except possibly one must move up vertically at some point, and hence go down by one more vertical operation. Assume on the contrary that markers and , , never leave row . Then their mutual disposition will not change, will always precede no matter the remaining operations. However has to precede in the final position. The contradiction shows that at least markers need vertical operations each. In all, at least operations are needed to achieve the goal. Let us show that operations are enough. Carry out steps (1) – (5) in the order they are described below.

(1) For each let be the following sequence of operations: Move marker up to the second row, then move it to the right to position . Carry out sequences in this order; this is clearly possible. Positions in row are now occupied by markers . The number of operations used is .

(2) Move marker up to the second row.

(3) For each let be the following sequence of operations: move marker to position in row , then lift it up to row . Carry out the sequences in this order. Positions in row are now occupied by markers . The number of operations used is .

(4) Move marker to position in row without lifting it up; operations are used.

(5) Move down all markers in row ; operations are used.

The problem is solved with the minimum possible number of operations.
Final answer
108

Techniques

Invariants / monovariantsGames / greedy algorithms