Source: TSTST-2020-P1
Category: Extremal Problems

Problem:
Let $a$, $b$, $c$ be fixed positive integers. There are $a+b+c$ ducks sitting in a circle, one behind the other. Each duck picks either rock, paper, or scissors, with $a$ ducks picking rock, $b$ ducks picking paper, and $c$ ducks picking scissors. A move consists of an operation of one of the following three forms: If a duck picking rock sits behind a duck picking scissors, they switch places. If a duck picking paper sits behind a duck picking rock, they switch places. If a duck picking scissors sits behind a duck picking paper, they switch places. Determine, in terms of $a$, $b$, and $c$, the maximum number of moves which could take place, over all possible initial configurations.

Solution:
The maximum possible number of moves is $\max(ab, bc, ca)$. First, we prove this upper bound. We define a *feisty triplet* to be an unordered triple of ducks, one of each of rock (R), paper (P), and scissors (S), such that in the forward direction (the direction the ducks are facing), their cyclic order is P, R, S. (There may be other ducks between them, but their relative cyclic order is what matters.)

If a paper duck P swaps places with a rock duck R, P must be sitting behind R. Their relative order in the forward direction changes from P-then-R to R-then-P. For each of the $c$ scissors ducks S, the cyclic order of the triplet changes from P, R, S to P, S, R. Thus, the number of feisty triplets decreases by exactly $c$. Similarly, if a rock duck R swaps with a scissors duck S, R is behind S, and their relative order changes from R-then-S to S-then-R. For each of the $b$ paper ducks P, the cyclic order of the triplet changes from P, R, S to P, S, R, so the number of feisty triplets decreases by exactly $b$. Finally, if a scissors duck S swaps with a paper duck P, S is behind P, and their relative order changes from S-then-P to P-then-S. For each of the $a$ rock ducks R, the cyclic order changes from S, P, R (which is cyclically equivalent to P, R, S) to P, S, R. Thus, the number of feisty triplets decreases by exactly $a$.

Obviously, the number of feisty triplets is at most $abc$ to start. Let $N_1, N_2, N_3$ be the number of P-R, R-S, and S-P swaps, respectively. The total decrease in the number of feisty triplets is $c N_1 + b N_2 + a N_3$. Because the number of feisty triplets must always be nonnegative, we have $c N_1 + b N_2 + a N_3 \le abc$. The total number of moves is $N_1 + N_2 + N_3$, which we can bound by:
$$ N_1 + N_2 + N_3 \le \frac{c N_1 + b N_2 + a N_3}{\min(a, b, c)} \le \frac{abc}{\min(a, b, c)} = \max(ab, bc, ca). $$
Thus, at most $\max(ab, bc, ca)$ moves may occur.

To see that this many moves is possible, assume without loss of generality that $a = \min(a, b, c)$. Suppose we arrange the ducks in blocks of rocks, papers, and scissors, such that the block of rocks is immediately in front of the block of papers, and the block of papers is immediately in front of the block of scissors. In this configuration, the scissors ducks are behind the paper ducks, so we can allow the scissors to filter forward through the papers while the rocks stay put. Each of the $c$ scissors ducks swaps with each of the $b$ paper ducks exactly once, for a total of $bc = \max(ab, bc, ca)$ swaps.

Answer: The maximum of $ab$, $ac$, and $bc$ is $\max(ab, ac, bc)$.

Grading guidelines:
(Partial) 1. Introduced a valid invariant/monovariant based on counting certain R–P–S triples in a specified cyclic order, and proved that each legal adjacent swap changes this count by a fixed amount (e.g. decreases by exactly a, b, or c depending on the swap type). 2. Derived a nontrivial global inequality on the numbers N1,N2,N3 of the three swap types, such as cN1+bN2+aN3 ≤ abc (or an equivalent bound implying finiteness of the process). 3. Gave a concrete initial configuration (e.g. three consecutive blocks) and correctly argued it produces at least one of the products ab, bc, ca moves (not necessarily the maximum). (Almost) 1. Proved the upper bound max(ab,bc,ca) using a correct triple-count monovariant, but made a localized mistake when converting cN1+bN2+aN3 ≤ abc into N1+N2+N3 ≤ abc/min(a,b,c) (e.g. mishandled the min/max step). 2. Gave the sharp construction achieving max(ab,bc,ca) (choosing the smallest of a,b,c and arranging three blocks so one type filters through another), but did not fully justify that each relevant pair swaps exactly once / no other swaps interfere. 3. Solution is almost complete, but made minor mistakes which are not negligible.