Source: IMO-2021-P5
Category: Operations and Strategies

Problem:
Two squirrels, Bushy and Jumpy, have collected $2021$ walnuts for the winter. Jumpy numbers the walnuts from $1$ through $2021$, and digs $2021$ little holes in a circular pattern in the ground around their favourite tree. The next morning Jumpy notices that Bushy had placed one walnut into each hole, but had paid no attention to the numbering. Unhappy, Jumpy decides to reorder the walnuts by performing a sequence of $2021$ moves. In the $k$th move, Jumpy swaps the positions of the two walnuts adjacent to walnut $k$. Prove that there exists a value of $k$ such that, on the $k$th move, Jumpy swaps some walnuts $a$ and $b$ such that $a<k<b$.

Solution:
Assume for contradiction that no such $k$ exists. We will use a so-called "threshold trick". This process takes exactly $2021$ steps. Right after the $k$-th move, we consider a situation where we color walnut $k$ red, so at the $k$-th step there are $k$ red walnuts. For brevity, a non-red walnut is called black. 

At each step, the $k$-th move swaps the two walnuts adjacent to $k$. By the assumption that no $a < k < b$ swap occurs, these two adjacent walnuts are either both less than $k$ (both red) or both greater than $k$ (both black). Because they share the same color, the swap does not change the color sequence. Then, walnut $k$ turns red. Thus, at each step, the walnut that becomes red is between two non-red or two red walnuts.

On the other hand, since there are $2021$ walnuts, one obtains a parity obstruction to this simplified process. We claim that after the first step, there is always a consecutive block of black walnuts of positive even length. After the first step, there is a block of $2020$ black walnuts. Thereafter, note that a length $2$ block of black walnuts can never be changed, because a black walnut turning red must be between two black walnuts, requiring a black block of length at least $3$. Meanwhile, for even lengths of at least $4$, if one places a red walnut inside it (meaning a black walnut in the block turns red), the even-length block splits into an odd-length block and an even-length block, since the remaining odd number of black walnuts is partitioned into two blocks.


Grading guidelines:
(Partial) 1. Introduced the threshold/coloring idea: after the k-th move declare walnuts 1,2,…,k red (others black), and observed that if no swap with a<k<b occurs then the k-th swap exchanges two walnuts of the same color, so the cyclic red/black pattern is unchanged by the swap itself. 2. Proved the key structural consequence under the negation assumption: the walnut that turns from black to red at step k must lie between two red walnuts or between two black walnuts (equivalently, it cannot be adjacent to exactly one red and one black walnut at the moment it turns red). 3. Established a parity/block invariant for black segments on the circle (e.g. after step 1 there is a black block of length 2020, and argued that some positive even-length block of consecutive black walnuts must persist or reappear under the allowed “turn a black walnut to red between two blacks” operation). (Almost) 1. Carried out the coloring reduction and correctly analyzed how black blocks change when a black walnut between two blacks turns red (even block splits into one odd and one even block; a black block of length 2 cannot be affected), but did not finish the final contradiction (e.g. did not explicitly deduce impossibility at step 2021 when no black walnuts remain). 2. Proved the existence of a persistent positive even-length black block for all steps k≥1, but left a small gap in justifying why the process cannot eliminate all black walnuts by step 2021 (missing boundary case for a single remaining black block or an unproved monotonicity/parity claim). 3. Solution is almost complete, but made minor mistakes which are not negligible.