Source: IMO-2022-P1
Category: Operations and Strategies

Problem:
The Bank of Oslo issues two types of coin: aluminum (denoted $A$) and bronze (denoted $B$). Marianne has $n$ aluminum coins and $n$ bronze coins arranged in a row in some arbitrary initial order. A chain is any subsequence of consecutive coins of the same type. Given a fixed positive integer $k \le 2n$, Gilberty repeatedly performs the following operation: he identifies the longest chain containing the $k$th coin from the left and moves all coins in that chain to the left end of the row. For example, if $n=4$ and $k=4$, the process starting from the ordering $AABBBABA$ would be $AABBBABA \to BBBAAABA \to AAABBBBA \to BBBBAAAA \to \dotsb$. Find all pairs $(n,k)$ with $1 \le k \le 2n$ such that for every initial ordering, at some moment during the process, the leftmost $n$ coins will all be of the same type.

Solution:
The valid pairs $(n, k)$ are those satisfying $n \le k \le \left\lceil \frac{3}{2} n \right\rceil$.

Call a maximal chain a \emph{block}. Then the line of coins can be described as a sequence of blocks: it is one of
\[
\underbrace{A\dots A}_{e_1} \underbrace{B\dots B}_{e_2} \underbrace{A\dots A}_{e_3} \dots \underbrace{A\dots A}_{e_m} \quad \text{for odd } m,
\]
\[
\underbrace{A\dots A}_{e_1} \underbrace{B\dots B}_{e_2} \underbrace{A\dots A}_{e_3} \dots \underbrace{B\dots B}_{e_m} \quad \text{for even } m,
\]
or the same thing with the roles of $A$ and $B$ flipped. The main claim is the following: 

\textbf{Claim.} The number $m$ of blocks will never increase after an operation. Moreover, it stays the same if and only if 
\begin{itemize}
\item $k \le e_1$; or 
\item $m$ is even and $e_m \ge 2n+1-k$.
\end{itemize}

\textit{Proof.} This can be seen by directly applying the operation. Moving a block to the front will strictly decrease the number of blocks unless the moved block is already the first block (which happens when $k \le e_1$) or it is the last block and does not share a type with the first block (which happens when $m$ is even and the $k$-th coin falls in the last block, meaning $e_m \ge 2n+1-k$). In these two specific cases, the number of blocks remains unchanged.

The problem asks for which values of $k$ we always reach $m=2$ eventually; we already know that $m$ is non-increasing. We consider a few cases: 
\begin{itemize}
\item If $k < n$, then any configuration with $e_1 = n-1$ will never change, since $k \le e_1$.
\item If $k > \left\lceil \frac{3}{2} n \right\rceil$, then take $m=4$ and $e_1 = e_2 = \left\lfloor n/2 \right\rfloor$ and $e_3 = e_4 = \left\lceil n/2 \right\rceil$. This configuration retains $m=4$ always: the blocks simply rotate.
\item Conversely, suppose $k \ge n$ has the property that $m > 2$ stays fixed. Since $m > 2$, the first block cannot contain all $n$ coins of its type, so $e_1 < n \le k$. Thus, the condition $k \le e_1$ is never satisfied. If after the first three operations $m$ hasn't changed, then we must repeatedly fall into the second case, meaning we must have $m \ge 4$ even, and $e_m, e_{m-1}, e_{m-2} \ge 2n+1 - k$. Now, since $e_m$ and $e_{m-2}$ are blocks of the same coin type, their sum cannot exceed the total number of coins of that type, which is $n$. Therefore,
\[
n \ge e_m + e_{m-2} \ge 2(2n+1-k) \implies k \ge \frac{3}{2} n + 1,
\]
so this completes the proof.
\end{itemize}

Answer: \(n \le k \le \left\lceil \frac{3}{2} n \right\rceil\)

Grading guidelines:
(Partial) 1. Introduced the block (maximal chain) decomposition and proved the monotonicity claim that the number of blocks never increases under the operation (possibly without fully characterising equality cases). 2. Gave a correct counterexample construction for one forbidden range of k (e.g. showed k<n fails by exhibiting a fixed configuration with first block length e1=n−1, or showed k>ceil(3n/2) fails by giving a 4-block “rotation” example). 3. Proved a correct necessary condition for “blocks can stay constant for several moves”, e.g. deduced that if the block count does not drop on a move with m>2 then the k-th coin must lie in the last block and m must be even (or an equivalent structural restriction). (Almost) 1. Proved that the answer set is n≤k≤ceil(3n/2), but left a small gap in justifying the exact equality cases for when the number of blocks stays the same after an operation (e.g. missed one direction of the “iff” for k≤e1 or m even with em≥2n+1−k). 2. Completed the two negative directions (k<n and k>ceil(3n/2)) and gave the main “if k is in range then we must eventually reach m=2” argument, but the final inequality step forcing k≥3n/2+1 from em+e_{m−2}≤n (or the justification that three consecutive non-decreases imply em,e_{m−1},e_{m−2}≥2n+1−k) is not fully justified. 3. Solution is almost complete, but made minor mistakes which are not negligible.