ComBench / data /analysis.jsonl
zzzhr97's picture
Upload ComBench dataset files
39af568 verified
Raw
History Blame Contribute Delete
262 kB
{"split": "analysis", "source": "IMO-2025-P1", "category": "Existence and Construction", "id": "IMO2025_1", "query": "A line in the plane is called *sunny* if it is not parallel to any of the $x$-axis, the $y$-axis, or the line $x+y=0$.\n\nLet $n \\ge 3$ be a given integer. Determine all nonnegative integers $k$ such that there exist $n$ distinct lines in the plane satisfying both of the following:\n\n- for all positive integers $a$ and $b$ with $a+b\\le n+1$, the point $(a,b)$ lies on at least one of the lines;\n- exactly $k$ of the $n$ lines are sunny.", "ref_solution": "We claim that the only possible numbers of sunny lines are $k \\in \\{0, 1, 3\\}$.\n\nWe view the set of lattice points $(a, b)$ with $a, b > 0$ and $a + b \\le n + 1$ as a triangular grid of points. We define a *long line* to be one of the three boundary lines of this grid, which are the lines passing through exactly $n$ grid points. Notice that each long line is not a sunny line, as it is parallel to either the $x$-axis, the $y$-axis, or the line $x + y = 0$.\n\nThe key claim is that if $n \\ge 4$, then any set of $n$ distinct lines covering all the required grid points must contain at least one long line.\n\nProof of the claim: Consider the $3(n - 1)$ points on the outer edge of the triangular grid. If no long line were present in our set of $n$ covering lines, then each of the $n$ lines would intersect the boundary of the triangular grid in at most two points, meaning each line could pass through at most two edge points. Since the $n$ lines must cover all $3(n - 1)$ edge points, we would obtain the inequality\n\\[\n2n \\ge 3(n - 1).\n\\]\nSolving this inequality yields $n \\le 3$, which contradicts our assumption that $n \\ge 4$. Thus, the claim is proven.\n\nTherefore, for any configuration with $n \\ge 4$, at least one long line must exist among the $n$ lines. We may delete this long line and remove the $n$ grid points it covers. The remaining grid points form a smaller triangular grid corresponding to size $n - 1$. Since the deleted long line is not sunny, this reduction from size $n$ to size $n - 1$ does not change the number of sunny lines in the configuration. By repeating this process, we can continually reduce the configuration until we reach the base case of $n = 3$. Conversely, once a valid configuration of lines is known for a smaller value of $n$, we can increase $n$ by adding a long line (which covers the new boundary points and is not sunny), maintaining the exact same number of sunny lines. Consequently, the possible counts of sunny lines for any $n \\ge 3$ are exactly those that arise in the base case $n = 3$.\n\nWe now classify all possible coverings of the six grid points in the $n = 3$ triangular grid by exactly three lines.\n\nCase 1: A long line is present. This long line covers exactly three grid points. The remaining three grid points must be covered by the remaining two lines. By the Pigeonhole Principle, one of these two remaining lines must pass through at least two of the remaining three points and hence is not sunny (since any line passing through two points of the remaining grid points in this configuration is necessarily parallel to a boundary line). The third and final line may or may not be sunny. Therefore, in this case, the possible numbers of sunny lines are $0$ or $1$.\n\nCase 2: No long line is present. Then each of the three lines can pass through at most two grid points. Since there are six grid points in total and only three lines, each line must in fact pass through exactly two points. The only possible configuration is the symmetric one in which all three lines are sunny. Hence this case gives exactly $3$ sunny lines.\n\nThus the only possible values of $k$ are\n\\[\n0, \\ 1, \\ 3.\n\\]\n\nIt remains to see that all three values are achievable. The $n = 3$ case above already realizes these possibilities, and by adding long lines we obtain constructions for every larger $n$. Therefore, the answer is precisely $k \\in \\{0, 1, 3\\}$.", "ref_answer": "$k \\in \\{0,1,3\\}$", "grading_guidelines": "(Partial) 1. Verified by explicit configurations (at least for n=3) that k=0, k=1, and/or k=3 are attainable, and explained how to extend a valid configuration from n to n+1 by adding a non-sunny boundary (“long”) line. 2. Defined the three boundary long lines of the triangular grid and observed they are exactly the non-sunny directions (parallel to x-axis, y-axis, or x+y=0), and that deleting such a long line reduces the problem from size n to size n−1 without changing k. 3. Proved the key counting inequality on boundary points for n≥4: if no long line is used then each line meets the outer edge in at most 2 grid points, giving 2n≥3(n−1) and hence a contradiction for n≥4. (Almost) 1. Proved that for n≥4 any covering must contain a long line and correctly reduced to the base case n=3, and classified the n=3 coverings to get k∈{0,1,3}, but did not explicitly justify the induction step that constructions for n=3 extend to all n (or omitted verifying attainability for all n). 2. Gave a complete reduction to n=3 and correct constructions showing all k∈{0,1,3} occur, but the boundary-point counting argument (or the claim that a non-long line hits at most two boundary points) is not fully justified or has a small logical gap. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2025-P5", "category": "Operations and Strategies", "id": "IMO2025_5", "query": "Alice and Bazza are playing the *inekoalaty game*, a two-player game whose rules depend on a positive real number $\\lambda$ known to both players. On the $n$th turn of the game (starting with $n=1$):\n\n- If $n$ is odd, Alice chooses a nonnegative real number $x_n$ such that\n \\[\n x_1+x_2+\\cdots+x_n \\le \\lambda n.\n \\]\n- If $n$ is even, Bazza chooses a nonnegative real number $x_n$ such that\n \\[\n x_1^2+x_2^2+\\cdots+x_n^2 \\le n.\n \\]\n\nIf a player cannot choose a suitable $x_n$, the game ends and the other player wins. If the game goes on forever, neither player wins. All chosen numbers are known to both players.\n\nDetermine all values of $\\lambda$ for which Alice has a winning strategy and all those for which Bazza has a winning strategy.", "ref_solution": "The threshold is $\\lambda = \\frac{1}{\\sqrt{2}}$. Alice has a winning strategy for $\\lambda > \\frac{1}{\\sqrt{2}}$, Bazza has a winning strategy for $\\lambda < \\frac{1}{\\sqrt{2}}$, and neither player can force a win when $\\lambda = \\frac{1}{\\sqrt{2}}$.\n\nFirst, consider Alice when $\\lambda \\ge \\frac{1}{\\sqrt{2}}$. She plays\n\\[\nx_{2i+1}=0\n\\]\non every odd turn until she decides to finish the game.\nAt time $n=2k+1$, we have\n\\[\nx_1+x_2+\\cdots+x_{2k} = x_2+x_4+\\cdots+x_{2k}.\n\\]\nBy the Cauchy-Schwarz inequality,\n\\[\nx_2+x_4+\\cdots+x_{2k}\n\\le k\\sqrt{\\frac{x_2^2+x_4^2+\\cdots+x_{2k}^2}{k}}.\n\\]\nBecause Alice plays $0$ on odd turns, we have $x_2^2+x_4^2+\\cdots+x_{2k}^2 = x_1^2+x_2^2+\\cdots+x_{2k}^2$. From Bazza's constraint on turn $2k$, this sum of squares is at most $2k$. Thus,\n\\[\nx_2+x_4+\\cdots+x_{2k} \\le k\\sqrt{\\frac{2k}{k}} = \\sqrt{2}k.\n\\]\nHence, the legal interval for Alice's next move is bounded below by $0$ and above by $\\lambda(2k+1) - (x_1+\\cdots+x_{2k})$, meaning she can pick any\n\\[\nx_{2k+1} \\in \\bigl[0,\\lambda(2k+1)-\\sqrt{2}k\\bigr].\n\\]\nIf $\\lambda \\ge \\frac{1}{\\sqrt{2}}$, this interval is always nonempty since $\\lambda(2k+1)-\\sqrt{2}k \\ge \\frac{1}{\\sqrt{2}}(2k+1)-\\sqrt{2}k = \\frac{1}{\\sqrt{2}} > 0$. Thus, Alice can always play $0$ to avoid losing forever.\n\nIf in fact $\\lambda > \\frac{1}{\\sqrt{2}}$, Alice can choose $k$ large enough such that\n\\[\n\\sqrt{2}k < \\lambda(2k+1)-\\sqrt{2k+2}.\n\\]\nThen on move $2k+1$, the upper bound of her legal interval is strictly greater than $\\sqrt{2k+2}$, allowing Alice to choose\n\\[\nx_{2k+1} > \\sqrt{2k+2}.\n\\]\nAt the next step, Bazza would need to choose $x_{2k+2}$ such that\n\\[\nx_1^2+\\cdots+x_{2k+1}^2 + x_{2k+2}^2 \\le 2k+2,\n\\]\nbut since $x_{2k+1}^2 > 2k+2$, this is impossible. Thus, Bazza has no legal move, and Alice wins for $\\lambda > \\frac{1}{\\sqrt{2}}$.\n\nNow, consider Bazza when $\\lambda \\le \\frac{1}{\\sqrt{2}}$. He plays on every even turn the largest possible value,\n\\[\nx_{2i+2}=\\sqrt{2-x_{2i+1}^2}.\n\\]\nThis keeps each pair $(x_{2i+1},x_{2i+2})$ contributing exactly $2$ to the quadratic budget, so $x_1^2 + \\cdots + x_{2i+2}^2 = 2(i+1)$, which perfectly satisfies Bazza's condition for any even turn.\nTo estimate Alice's move $x_{2k+1}$, we use her constraint:\n\\[\n\\lambda(2k+1) \\ge x_1+x_2+\\cdots+x_{2k+1}.\n\\]\nGrouping the terms in pairs gives\n\\[\n\\lambda(2k+1)\n\\ge \\bigl(x_1+\\sqrt{2-x_1^2}\\bigr)+\\cdots+\\bigl(x_{2k-1}+\\sqrt{2-x_{2k-1}^2}\\bigr)+x_{2k+1}.\n\\]\nFor every $t\\in[0,\\sqrt{2}]$, we have $(t+\\sqrt{2-t^2})^2 = 2 + 2t\\sqrt{2-t^2} \\ge 2$, which implies\n\\[\nt+\\sqrt{2-t^2} \\ge \\sqrt{2}.\n\\]\nApplying this to each pair yields\n\\[\n\\lambda(2k+1) \\ge \\sqrt{2}k + x_{2k+1}.\n\\]\nTherefore,\n\\[\nx_{2k+1} \\le \\lambda(2k+1)-\\sqrt{2}k.\n\\]\nWhen $\\lambda \\le \\frac{1}{\\sqrt{2}}$, this upper bound is at most $\\frac{1}{\\sqrt{2}}(2k+1) - \\sqrt{2}k = \\frac{1}{\\sqrt{2}} < \\sqrt{2}$. Thus, Alice is forced to play $x_{2k+1} \\le \\sqrt{2}$, ensuring that Bazza can indeed play\n\\[\nx_{2k+2}=\\sqrt{2-x_{2k+1}^2}\n\\]\nand never gets stuck.\n\nIf moreover $\\lambda < \\frac{1}{\\sqrt{2}}$, then for all sufficiently large $k$,\n\\[\n\\lambda(2k+1)-\\sqrt{2}k < 0.\n\\]\nSince Alice must choose $x_{2k+1} \\ge 0$, she eventually has no legal move at all. Hence, Bazza wins for $\\lambda < \\frac{1}{\\sqrt{2}}$.\n\nAt the boundary value $\\lambda = \\frac{1}{\\sqrt{2}}$, Alice's strategy of playing $0$ shows she can survive forever, while Bazza's maximal strategy also shows he can survive forever. Thus, neither player can force a win at the critical value.", "ref_answer": "Alice wins for $\\lambda > 1/\\sqrt2$; Bazza wins for $\\lambda < 1/\\sqrt2$; neither can force a win at $\\lambda = 1/\\sqrt2$", "grading_guidelines": "(Partial) 1. Identified the correct threshold value \\(\\lambda=1/\\sqrt2\\) (e.g. by optimizing a Cauchy–Schwarz type inequality or by analyzing one full odd-even pair). 2. Gave a correct strategy for one player in one direction, with a real supporting estimate (e.g. Alice plays \\(x_{2i+1}=0\\) and shows \\(x_2+x_4+\\cdots+x_{2k}\\le \\sqrt2k\\); or Bazza plays \\(x_{2i+2}=\\sqrt{2-x_{2i+1}^2}\\) and derives \\(x_{2i+1}+x_{2i+2}\\ge \\sqrt2\\)). 3. Correctly proved at least one of the strict win statements: Alice wins for all \\(\\lambda>1/\\sqrt2\\) (by eventually choosing \\(x_{2k+1}^2>2k+2\\)); or Bazza wins for all \\(\\lambda<1/\\sqrt2\\) (by forcing \\(\\lambda(2k+1)-\\sqrt2k<0\\) for large \\(k\\)). (Almost) 1. Correctly handled both strict regimes \\(\\lambda>1/\\sqrt2\\) and \\(\\lambda<1/\\sqrt2\\) with valid strategies and inequalities, but did not correctly treat the boundary case \\(\\lambda=1/\\sqrt2\\) (e.g. claimed one player wins there, or omitted showing neither can force a win). 2. Gave essentially the full solution including the critical case, but left a localized gap in the key estimate (e.g. misapplied Cauchy–Schwarz in bounding \\(x_2+\\cdots+x_{2k}\\), or did not justify \\(t+\\sqrt{2-t^2}\\ge \\sqrt2\\) on the needed domain). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2024-P3", "category": "Extremal Problems", "id": "IMO2024_3", "query": "Let $a_1,a_2,a_3,\\dots$ be an infinite sequence of positive integers, and let $N$ be a positive integer. Suppose that, for each $n>N$, the number $a_n$ is equal to the number of times $a_{n-1}$ appears in the list $(a_1,a_2,\\dots,a_{n-1})$. Prove that at least one of the sequences $a_1,a_3,a_5,\\dots$ and $a_2,a_4,a_6,\\dots$ is eventually periodic.", "ref_solution": "Let $M=\\max(a_1,\\dots,a_N)$. We can organize the process by building towers: when the term $a_i$ appears, place a block $B_i$ on top of tower $a_i$. For $i>N$, the sequence rule states that if $B_i$ is added to tower $a_i$, then the next block $B_{i+1}$ is added to the tower whose index equals the height reached by tower $a_i$.\n\nWe first establish two basic structural facts.\n\n1. If tower $k+1$ grows arbitrarily high, then tower $k$ also grows arbitrarily high. In fact, there is a constant $C$ such that at every time,\n\\[\nh_k \\ge h_{k+1}-C,\n\\]\nwhere $h_j$ denotes the current height of tower $j$. This holds because almost every sufficiently high block in tower $k+1$ can be traced back injectively to a block in tower $k$.\n\n2. If $a_n>M$, then $a_{n+1}\\le M$. Otherwise, there would be a first moment when two consecutive terms both exceed $M$. This would force more than $M$ towers to have height greater than $M$ before that time, which is impossible by the minimality of the first such moment.\n\nFrom the second fact, terms at most $M$ occur with density at least $1/2$, so some values occur infinitely often. Let $L$ be the largest index such that towers $1,2,\\dots,L$ are unbounded, while towers $L+1,\\dots,M$ are eventually frozen. After some time $N'>N$, we may assume that:\n- towers $1$ through $L$ are already very tall;\n- towers $L+1$ through $M$ will never receive another block;\n- $a_{N'}\\le L$.\n\nFrom that point onward, the terms alternate between small and big: if $n\\equiv N' \\pmod 2$, then $a_n\\le L$, while if $n\\equiv N'+1 \\pmod 2$, then $a_n>M$. Thus, one parity subsequence consists of all the small terms.\n\nConsider only indices $n\\equiv N' \\pmod 2$. At such a time, define the state\n\\[\nS(n)=(h_1,h_2,\\dots,h_L; a_n).\n\\]\nThe next two steps are completely determined by this state: the intermediate large term is the height of the tower just hit, and the following small term is the number of towers among $1,\\dots,L$ whose heights are at least that large. Thus, $S(n+2)$ depends only on $S(n)$.\n\nBecause only relative heights matter, it is enough to replace $S(n)$ by\n\\[\nT(n)=(h_1-h_2, h_2-h_3, \\dots, h_{L-1}-h_L; a_n).\n\\]\nUsing the first structural fact repeatedly, one obtains upper bounds for these differences. A second contradiction argument gives lower bounds as well: for every $1\\le \\ell<L$, there is a uniform bound\n\\[\nh_\\ell \\le h_{\\ell+1}+C(L-1).\n\\]\nHence, each coordinate of $T(n)$ is bounded, so $T(n)$ takes only finitely many values. Since the transition $T(n)\\mapsto T(n+2)$ is deterministic, the sequence $T(n)$ is eventually periodic. Therefore, the subsequence $a_{N'},a_{N'+2},a_{N'+4},\\dots$ is eventually periodic.\n\nConsequently, at least one of the two parity subsequences $a_1,a_3,a_5,\\dots$ and $a_2,a_4,a_6,\\dots$ is eventually periodic, as required.", "ref_answer": "At least one of the two subsequences $a_1,a_3,a_5,\\dots$ or $a_2,a_4,a_6,\\dots$ is eventually periodic", "grading_guidelines": "(Partial) 1. Proved that if some value >M:=max(a1,…,aN) occurs at position n, then an adjacent term must be ≤M (e.g. established a statement of the form: there cannot be a first time when both an and a_{n+1} exceed M). 2. Showed that at least one integer occurs infinitely often (for instance, deduced from the previous item that terms ≤M occur infinitely often / with density ≥1/2, hence by pigeonhole some value repeats infinitely many times). 3. Introduced a meaningful global organizing structure (e.g. “towers/blocks” where tower k counts occurrences of k) and proved at least one nontrivial monotonicity/comparison fact between towers (such as: unboundedness of tower k+1 forces unboundedness of tower k, or a uniform bound h_k ≥ h_{k+1}−C). (Almost) 1. Reduced to a late stage N′ where the set of “unbounded small values” is {1,…,L} and values >L never reappear among ≤M, and correctly deduced the alternation pattern from that point: one parity consists entirely of terms ≤L and the other parity consists entirely of terms >M, but did not finish the periodicity-from-finite-states step. 2. Defined a correct finite state (e.g. T(n) built from bounded height differences and the current small term) and proved that T(n+2) is a deterministic function of T(n), and that the coordinates of T(n) are bounded so only finitely many states occur, but left a localized gap in bounding the differences or in justifying that only relative heights matter. 3. Completed the argument that the deterministic finite-state evolution forces eventual periodicity of one parity subsequence, but omitted/garbled one boundary case (e.g. L=1, or the justification that towers L+1,…,M are eventually frozen) or made a small but non-negligible logical slip near the end."}
{"split": "analysis", "source": "IMO-2024-P5", "category": "Operations and Strategies", "id": "IMO2024_5", "query": "Turbo the snail is in the top row of a grid with $2024$ rows and $2023$ columns and wants to get to the bottom row. However, there are $2022$ hidden monsters, one in every row except the first and last, with no two monsters in the same column.\n\nTurbo makes a series of attempts to go from the first row to the last row. On each attempt, he chooses to start on any cell in the first row, then repeatedly moves to an orthogonal neighbor. If Turbo reaches a cell with a monster, his attempt ends and he is transported back to the first row to start a new attempt. The monsters do not move between attempts, and Turbo remembers whether or not each cell he has visited contains a monster. If he reaches any cell in the last row, his attempt ends and Turbo wins.\n\nFind the smallest integer $n$ such that Turbo has a strategy which guarantees being able to reach the bottom row in at most $n$ attempts, regardless of how the monsters are placed.", "ref_solution": "The minimum number of attempts is $n=3$. In fact, the same argument works for any $s \\times (s-1)$ grid with $s \\ge 4$; here the grid is $2024 \\times 2023$, so $s = 2024$.\n\nFirst, we show that at least three attempts are necessary. On the first attempt, when Turbo first enters the second row, he may immediately hit a monster $M_1$. Because his attempt ends immediately, he learns nothing else about the grid. On his second attempt, he must avoid the cell containing $M_1$, so he must enter the third row in a different column. However, upon entering the third row, he may again immediately hit a monster $M_2$. In this scenario, his second attempt ends, and he still has not reached the bottom row. Thus, no strategy can guarantee success in only two attempts.\n\nNow we prove that three attempts always suffice by providing a strategy that guarantees reaching the bottom row in at most three attempts.\n\nOn the first attempt, Turbo moves into the second row and explores it horizontally until he discovers the unique monster $M_1$ located in that row. Upon hitting $M_1$, his first attempt ends. There are two cases to consider based on the position of $M_1$.\n\nCase 1: $M_1$ is not on an edge cell of the second row. \nSince $M_1$ is not in the leftmost or rightmost column, Turbo knows that the two cells adjacent to $M_1$ in the second row (one on the left and one on the right) are safe. Starting from either of these safe cells, he can attempt to follow a path going downward on the corresponding side of $M_1$, and then continue to the bottom row. These two candidate paths lie on opposite sides of the column containing $M_1$. Because there is only one monster in each lower row and no two monsters share a column, at least one of the two downward routes avoids all monsters. On his second attempt, Turbo tries one of these routes. If he succeeds, he reaches the bottom row. If he encounters a monster, his second attempt ends, but he now knows that the other route must be completely free of monsters. Hence, on his third attempt, Turbo can take the other route and is guaranteed to succeed. Thus, he succeeds within the next two attempts.\n\nCase 2: $M_1$ lies on an edge cell of the second row. \nBy symmetry, suppose $M_1$ is in the leftmost cell of the second row (column 1). On the second attempt, Turbo follows a staircase path heading down and gradually to the right. If this staircase path reaches the last row without hitting any monsters, he wins immediately on the second attempt. Otherwise, he encounters a second monster $M_2$ somewhere on the staircase path. At this point, his second attempt ends. However, because he reached $M_2$, everything strictly to the left of that encountered point on the staircase path has been verified as safe. Furthermore, Turbo also knows that the entire first column below $M_1$ is completely free of monsters, because $M_1$ already occupies the unique monster position for the first column (recall that no two monsters share a column). Using this combined information, on the third attempt Turbo can safely travel down along the verified safe region to the left of $M_2$, move horizontally into the first column (the column of $M_1$), and then continue straight down to the bottom row. This route avoids every monster.\n\nThus, Turbo always has a strategy that guarantees success in at most three attempts, and two attempts are impossible. Therefore, the answer is\n\\[\n\\boxed{3}\n\\]", "ref_answer": "$3$", "grading_guidelines": "(Partial) 1. Proved the lower bound n\\ge 3 by exhibiting an adversarial placement causing failure in 2 attempts (e.g. first hit a monster upon first entering row 2, then forced to enter row 3 in a different column and can be hit immediately again). 2. Gave the key idea for the upper bound strategy: first locate the monster in row 2 by sweeping along that row until hitting it, and then use information from this to plan later attempts. 3. Solved Case 1 (monster in row 2 not on an edge): proposed the two “routes on opposite sides of the row-2 monster” and correctly argued that, since monsters occupy distinct columns, at least one route is monster-free so success is guaranteed within 3 attempts. (Almost) 1. Correctly proved n\\ge 3 and presented a complete 3-attempt strategy for the non-edge Case 1, but handled the edge Case 2 only heuristically (missing a rigorous construction of the final safe path after the staircase hits a monster). 2. Gave the full two-case strategy (non-edge and edge) and the distinct-columns argument, but left one localized gap, such as not justifying why the “other side” route must be completely free after one failure, or not proving that the claimed safe region in the edge case can always be reached without stepping on unknown cells. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2022-P1", "category": "Operations and Strategies", "id": "IMO2022_1", "query": "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.", "ref_solution": "The valid pairs $(n, k)$ are those satisfying $n \\le k \\le \\left\\lceil \\frac{3}{2} n \\right\\rceil$.\n\nCall a maximal chain a \\emph{block}. Then the line of coins can be described as a sequence of blocks: it is one of\n\\[\n\\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,\n\\]\n\\[\n\\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,\n\\]\nor the same thing with the roles of $A$ and $B$ flipped. The main claim is the following: \n\n\\textbf{Claim.} The number $m$ of blocks will never increase after an operation. Moreover, it stays the same if and only if \n\\begin{itemize}\n\\item $k \\le e_1$; or \n\\item $m$ is even and $e_m \\ge 2n+1-k$.\n\\end{itemize}\n\n\\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.\n\nThe 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: \n\\begin{itemize}\n\\item If $k < n$, then any configuration with $e_1 = n-1$ will never change, since $k \\le e_1$.\n\\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.\n\\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\\[\nn \\ge e_m + e_{m-2} \\ge 2(2n+1-k) \\implies k \\ge \\frac{3}{2} n + 1,\n\\]\nso this completes the proof.\n\\end{itemize}", "ref_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."}
{"split": "analysis", "source": "IMO-2021-P1", "category": "Graph Theory", "id": "IMO2021_1", "query": "Let $n \\ge 100$ be an integer. Ivan writes the numbers $n, n+1, \\dots, 2n$ each on different cards. He then shuffles these $n+1$ cards, and divides them into two piles. Prove that at least one of the piles contains two cards such that the sum of their numbers is a perfect square.", "ref_solution": "We will find three cards $a<b<c$ such that the sum of any two is a perfect square. By the Pigeonhole Principle, if these three cards are divided into two piles, at least one pile must contain two of them, yielding a pair whose sum is a perfect square. \n\nWe look for $a, b, c$ such that\n\\[\nb+c=(2k+1)^2,\\qquad\nc+a=(2k)^2,\\qquad\na+b=(2k-1)^2\n\\]\nfor some integer $k$. Solving the system of equations for $a$, $b$, and $c$ gives\n\\[\na=\\frac{(2k)^2+(2k-1)^2-(2k+1)^2}{2}=2k^{2}-4k,\n\\]\n\\[\nb=\\frac{(2k+1)^2+(2k-1)^2-(2k)^2}{2}=2k^{2}+1,\n\\]\n\\[\nc=\\frac{(2k+1)^2+(2k)^2-(2k-1)^2}{2}=2k^{2}+4k.\n\\]\n\nWe need to show that for any given integer $n\\ge 100$, one can find a suitable $k$ such that the cards $a, b, c$ are drawn from the available numbers $\\{n, n+1, \\dots, 2n\\}$. This requires $n \\le a < b < c \\le 2n$. Let\n\\[\nI_k\\coloneq\\{\\,n\\in\\mathbb Z\\mid n\\le a<b<c\\le 2n\\,\\}\n\\]\nbe the set of valid integers $n$ for a given $k$. Since $a < b < c$ holds for all $k \\ge 2$, the condition $n \\le a$ requires $n \\le 2k^2 - 4k$, and the condition $c \\le 2n$ requires $2k^2 + 4k \\le 2n$, which simplifies to $k^2 + 2k \\le n$. Thus, the interval is\n\\[\nI_k = \\{\\,n\\in\\mathbb Z\\mid k^{2}+2k\\le n\\le 2k^{2}-4k\\,\\}.\n\\]\nWhen $n\\in I_k$, the problem is solved for that choice of $k$. It is therefore sufficient to show that the union of these intervals $I_k$ covers all integers $n \\ge 100$. \n\nStarting with $k=9$, we have $k^2+2k = 99$ and $2k^2-4k = 126$, so\n\\[\nI_{9}=\\{\\,n\\in\\mathbb Z \\mid 99\\le n\\le 126\\,\\}.\n\\]\nFor the intervals to overlap and cover all subsequent integers, the right endpoint of $I_k$ must be greater than or equal to the left endpoint of $I_{k+1}$ minus $1$. In fact, we can show a stronger inequality for $k \\ge 9$:\n\\[\n2k^{2}-4k\\ge (k+1)^{2}+2(k+1).\n\\]\nExpanding the right side gives $k^2 + 4k + 3$. The inequality rearranges to\n\\[\nk^2 - 8k - 3 \\ge 0,\n\\]\nwhich is clearly true for $k \\ge 9$ since $9^2 - 8(9) - 3 = 6 \\ge 0$, and the quadratic is increasing for $k \\ge 4$. \n\nThis confirms that the right endpoint of $I_k$ strictly exceeds the left endpoint of $I_{k+1}$ for all $k \\ge 9$. Since $I_9$ begins at $99$, the intervals $I_k$ for $k \\ge 9$ collectively cover all integers $n \\ge 99$. Hence, for any $n\\ge 100$, a suitable $k$ exists, and the statement holds.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Reduced the problem to finding three numbers a<b<c in {n,n+1,…,2n} such that at least two of them lie in the same pile (pigeonhole), and stated that it suffices to have at least one pair among {a,b,c} with square sum. 2. Constructed (or correctly derived) a triple a,b,c with all pairwise sums being consecutive odd/even squares, e.g. a=2k^2−4k, b=2k^2+1, c=2k^2+4k, and checked that a+b, a+c, b+c are perfect squares. 3. Obtained correct inequality conditions on k ensuring a,b,c all lie in [n,2n] (typically n≤a and c≤2n, equivalent to n≤2k^2−4k and k^2+2k≤n), even if the coverage for all n≥100 is not finished. (Almost) 1. Found a valid k for each n≥100 via the interval method Ik={n: k^2+2k≤n≤2k^2−4k}, but left a small gap in proving that the intervals Ik overlap/cover all integers n≥100 (e.g. the inequality 2k^2−4k≥(k+1)^2+2(k+1) not fully justified or the starting k not checked carefully). 2. Completed the construction of a,b,c and the pigeonhole step, and correctly argued existence of k for all n≥100, but made a localized algebraic slip in computing a,b,c or in one endpoint inequality while the intended interval-covering argument is clear and otherwise correct. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2021-P5", "category": "Operations and Strategies", "id": "IMO2021_5", "query": "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$.", "ref_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. \n\nAt 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.\n\nOn 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.", "ref_answer": "", "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."}
{"split": "analysis", "source": "IMO-2020-P3", "category": "Existence and Construction", "id": "IMO2020_3", "query": "There are $4n$ pebbles of weights $1, 2, 3, \\dots, 4n$. Each pebble is coloured in one of $n$ colours and there are four pebbles of each colour. Show that we can arrange the pebbles into two piles such that the total weights of both piles are the same, and each pile contains two pebbles of each colour.", "ref_solution": "We begin by pairing the weights such that the sum of each pair is constant:\n\\[ 1+4n = 2+(4n-1) = 3+(4n-2) = \\dots = 2n+(2n+1) = 4n+1. \\]\nPlace all four pebbles of the same colour into a single box, yielding $n$ boxes in total. For each $k=1,2,\\dots,2n$, we connect pebble $k$ and pebble $4n+1-k$ with a piece of string. This creates $2n$ strings, each connecting a pair of pebbles whose weights sum to $4n+1$.\n\nTo solve the problem, it suffices to paint each string either blue or green such that each box has exactly two blue strings and two green strings attached to its pebbles (where a string connecting two pebbles within the same box counts twice for that box). If we can achieve this, we can assign the pairs of pebbles connected by blue strings to the first pile and those connected by green strings to the second pile. Since each box has two string ends of each colour, each pile will contain exactly two pebbles of each colour. Furthermore, since there are exactly $n$ blue strings and $n$ green strings, each pile will consist of $n$ pairs of pebbles, giving both piles an equal total weight of $n(4n+1)$.\n\nWe can rephrase the problem in terms of graph theory by viewing the $n$ boxes as vertices and the $2n$ strings as edges. This forms a $4$-regular multigraph on $n$ vertices, where self-loops are allowed and contribute $2$ to the degree of a vertex. We wish to colour the edges blue and green such that each vertex is incident to exactly two blue edges and two green edges.\n\nSince every vertex in this multigraph has an even degree of $4$, each connected component of the graph admits an Eulerian circuit. Consider a connected component with $k$ vertices. The sum of the degrees of the vertices in this component is $4k$, so it contains exactly $2k$ edges. Because the Eulerian circuit for this component has an even length ($2k$ edges), we may colour the edges along the circuit in alternating colours: green and blue.\n\nThis alternating colouring ensures that every time the circuit passes through a vertex (entering via one edge and leaving via the next), the two edges involved have different colours. Since each vertex has a degree of $4$, the Eulerian circuit passes through each vertex exactly twice. If the vertex has no self-loops, it is visited on two separate occasions, with each visit contributing one blue and one green edge, yielding exactly two blue and two green edges in total. If a vertex has a self-loop, the self-loop is traversed as a single edge of one colour, contributing two ends of that colour to the vertex; the alternating nature of the circuit ensures that the edges immediately preceding and following the self-loop are of the opposite colour, providing two ends of the other colour. A vertex with two self-loops simply receives one blue self-loop and one green self-loop. Thus, every vertex receives exactly two blue and two green ends. This yields the desired arrangement, completing the proof.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Used the pairing 1+4n=2+(4n-1)=...=4n+1, and reduced the task to selecting exactly n of these 2n pairs so that each colour appears exactly twice among the selected pebbles. 2. Reformulated the problem as a 4-regular multigraph on n vertices (colours as vertices; each complementary-weight pair as an edge, allowing loops), and stated the goal as a 2-edge-colouring with exactly two edges of each colour incident to every vertex. 3. Proved (or correctly invoked) that each connected component of an even-degree graph has an Euler tour, with the intention to alternate colours along such a tour. (Almost) 1. Carried out the Euler-circuit alternating-colouring argument to obtain two edges of each colour at every vertex, but did not correctly justify the handling of self-loops (counting two incidences) or multiple edges in the incidence count. 2. Completed the graph-colouring construction, but made an arithmetic/logic slip in translating back to pebbles (e.g. did not explicitly conclude both piles have weight n(4n+1), or miscounted the number of pairs/pebbles per pile while the colouring condition is correct). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2020-P6", "category": "Existence and Construction", "id": "IMO2020_6", "query": "Consider an integer $n > 1$, and a set $\\mathcal S$ of $n$ points in the plane such that the distance between any two different points in $\\mathcal S$ is at least $1$. Prove there is a line $\\ell$ separating $\\mathcal S$ such that the distance from any point of $\\mathcal S$ to $\\ell$ is at least $\\Omega\\!\\bigl(n^{-1/3}\\bigr)$. (A line $\\ell$ separates a set of points $S$ if some segment joining two points in $\\mathcal S$ crosses $\\ell$.)", "ref_solution": "Let $\\delta$ be the maximum possible distance between two consecutive projections of the points of $\\mathcal S$ onto any line $m$. (This maximum is achieved by a standard compactness argument.) We will prove that $\\delta \\ge \\Omega(n^{-1/3})$. This solves the problem, because we can choose a line $m$ achieving this maximum gap $\\delta$ and place a line $\\ell$ perpendicular to $m$ in the exact middle of the gap. The line $\\ell$ separates $\\mathcal S$, and the distance from any point of $\\mathcal S$ to $\\ell$ is at least $\\frac{\\delta}{2} = \\Omega(n^{-1/3})$.\n\nLet $A$ and $B$ be two points in $\\mathcal S$ that are farthest apart. Let $R = AB$; since all pairwise distances between points in $\\mathcal S$ are at least $1$, we have $R \\ge 1$. All points of $\\mathcal S$ lie in the intersection of the disks centered at $A$ and $B$ with radius $R$. Consider the circle $\\odot(B)$ centered at $B$ with radius $R$. Let $\\overline{XY}$ be the chord of $\\odot(B)$ such that $\\overline{XY} \\perp \\overline{AB}$ and the distance from $A$ to $\\overline{XY}$ is exactly $\\frac12$. (Such a chord exists since $R \\ge 1 > \\frac12$.) Let $\\mathcal T$ denote the smaller region bounded by $\\odot(B)$ and the chord $\\overline{XY}$ (this is the cap containing $A$). \n\nFirst, note that $R = AB \\le (n-1)\\delta < n\\delta$, since the $n$ projections of the points in $\\mathcal S$ onto the line $AB$ are spaced at most $\\delta$ apart. The distance from $B$ to the chord $\\overline{XY}$ is $R - \\frac12$. The Pythagorean theorem gives the length of the chord as\n\\[\nXY = 2\\sqrt{R^{2} - \\left(R-\\frac12\\right)^{2}} = 2\\sqrt{R - \\frac14} < 2\\sqrt{R} < 2\\sqrt{n\\delta}.\n\\]\n\nBy definition, the region $\\mathcal T$ corresponds to an interval of length $\\frac12$ along the line $AB$, starting from $A$. Since all points of $\\mathcal S$ lie in the intersection of the disks $D(A, R)$ and $D(B, R)$, their projections onto the line $AB$ all lie in the segment $AB$. Let these projections be $x_1 \\le x_2 \\le \\dots \\le x_n$, where $x_1 = 0$ corresponds to $A$ and $x_n = R$ corresponds to $B$. The points in $\\mathcal T$ are exactly those whose projections satisfy $x_i \\le \\frac12$. Let $k = |\\mathcal T|$ be the number of such points. Then $x_k \\le \\frac12 < x_{k+1}$. Because the maximum gap between consecutive projections is at most $\\delta$, we have\n\\[\n\\frac12 < x_{k+1} \\le x_1 + k\\delta = k\\delta.\n\\]\nThus, the number of points in $\\mathcal T$ satisfies\n\\[\n\\lvert\\mathcal T\\rvert = k > \\frac{1}{2\\delta}.\n\\]\n\nNext, consider the projections of the points in $\\mathcal T$ onto the line $XY$. Any two points $P, Q \\in \\mathcal T$ are at distance at least $1$. The distance between their projections onto the line $AB$ is at most the width of $\\mathcal T$ in the direction of $AB$, which is $\\frac12$. Therefore, the distance between their projections onto the line $XY$ is at least\n\\[\n\\sqrt{PQ^2 - \\left(\\frac12\\right)^2} \\ge \\sqrt{1^2 - \\frac14} = \\frac{\\sqrt3}{2}.\n\\]\nThe region $\\mathcal T$ is bounded by the chord $\\overline{XY}$ and the arc of $\\odot(B)$. Thus, the projections of all points in $\\mathcal T$ onto the line $XY$ lie on the segment $\\overline{XY}$. The distance between the extreme projections among these $|\\mathcal T|$ points is at most the length of $\\overline{XY}$. On the other hand, since the projections are spaced at least $\\frac{\\sqrt3}{2}$ apart, this distance is at least $\\frac{\\sqrt3}{2}(\\lvert\\mathcal T\\rvert - 1)$. This implies\n\\[\nXY \\ge \\frac{\\sqrt3}{2}\\left(\\lvert\\mathcal T\\rvert - 1\\right).\n\\]\n\nSubstituting the lower bound for $|\\mathcal T|$, we obtain\n\\[\nXY > \\frac{\\sqrt3}{2}\\left(\\frac{1}{2\\delta} - 1\\right).\n\\]\nCombining this with the upper bound $XY < 2\\sqrt{n\\delta}$, we have\n\\[\n2\\sqrt{n\\delta} > \\frac{\\sqrt3}{4\\delta} - \\frac{\\sqrt3}{2}.\n\\]\nIf $\\delta \\ge \\frac{1}{4}$, then $\\delta \\ge \\frac{1}{4} n^{-1/3}$ trivially holds since $n \\ge 2$. Otherwise, if $\\delta < \\frac{1}{4}$, we have $\\frac{1}{2\\delta} > 2$, so $\\frac{\\sqrt3}{4\\delta} - \\frac{\\sqrt3}{2} > \\frac{\\sqrt3}{8\\delta}$. This gives\n\\[\n2\\sqrt{n\\delta} > \\frac{\\sqrt3}{8\\delta} \\implies \\delta^{3/2} > \\frac{\\sqrt3}{16\\sqrt{n}} \\implies \\delta > \\left(\\frac{3}{256}\\right)^{1/3} n^{-1/3}.\n\\]\nIn either case, we have $\\delta \\ge \\Omega(n^{-1/3})$. This completes the proof.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Reformulated the task via projections: defined $\\delta$ as the maximum gap between consecutive projections of the $n$ points onto some line, and explained how a gap of size $\\delta$ yields a separating line at distance $\\gtrsim \\delta$ (e.g. by taking a line parallel to the projection line placed in such a gap). 2. Introduced the diameter endpoints $A,B$ (farthest pair) and deduced a global bound $R=AB \\le (n-1)\\delta$ (or $R < n\\delta$) from spacing of projections onto $AB$. 3. Constructed the chord $XY$ of the circle centered at $B$ with $XY \\perp AB$ and $\\operatorname{dist}(A,XY)=1/2$ (or an equivalent thin cap region $T$), and correctly computed/estimated $XY = 2\\sqrt{R^2-(R-1/2)^2}=2\\sqrt{R-1/4}$ to relate $XY$ to $R$ and hence to $\\delta$. (Almost) 1. Completed the cap-counting strategy (using the thin region $T$ cut off by $XY$) and derived $\\delta \\ge c n^{-1/3}$, but left a small gap in justifying one of the key spacing/count estimates inside $T$ (e.g. why projections onto $XY$ are at least $\\sqrt{3}/2$ apart, or why $|T| \\gtrsim (1/2)\\delta^{-1}$). 2. Obtained the final inequality $\\delta \\ge \\Omega(n^{-1/3})$ with correct dependence on $n$, but made a localized computational slip in combining bounds (e.g. lost a constant/power when passing from $XY < 2\\sqrt{n\\delta}$ and $XY > c(\\delta^{-1}-1)$ to $\\delta \\ge c'n^{-1/3}$), while the main argument is otherwise complete. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2019-P3", "category": "Graph Theory", "id": "IMO2019_3", "query": "A social network has $2019$ users, some pairs of which are friends (friendship is symmetric). If $A$, $B$, $C$ are three users such that $AB$ are friends and $AC$ are friends but $BC$ is not, then the administrator may perform the following operation: change the friendships such that $BC$ are friends, but $AB$ and $AC$ are no longer friends.\n\nInitially, $1009$ users have $1010$ friends and $1010$ users have $1009$ friends. Prove that the administrator can make a sequence of operations such that all users have at most $1$ friend.", "ref_solution": "We reformulate the problem in graph-theoretic terms. Let the users be vertices and the friendships be edges of a graph $G$. The given operation, which we call a \\emph{toggle}, consists of taking three vertices $a, b, c$ such that $ab$ and $ac$ are edges but $bc$ is not, and replacing the edges $ab$ and $ac$ with the edge $bc$.\n\n\\begin{claim*}\n Let $G$ be a connected graph. Then one can toggle $G$ without disconnecting the graph, unless $G$ is a clique, a cycle, or a tree.\n\\end{claim*}\n\\begin{proof}\n Assume $G$ is connected and is not a clique, a cycle, or a tree. Since $G$ is not a tree, it contains a cycle. Let $C$ be a cycle of minimal length in $G$; by hypothesis, $C \\neq G$.\n\n If $C$ is not a triangle (equivalently, $G$ is triangle-free), then since $G$ is connected, there exists a vertex $b \\notin C$ adjacent to some vertex $a \\in C$. Let $c \\in C$ be a neighbor of $a$ on the cycle. Since $G$ is triangle-free, $b$ is not adjacent to $c$. Thus, we can toggle $a, b, c$, replacing edges $ab$ and $ac$ with $bc$. This operation does not disconnect the graph because $a$ and $c$ remain connected through the remaining path in the cycle $C$, and $b$ remains connected to the rest of the graph via $c$.\n\n Now assume that $G$ contains a triangle. Let $K$ be a maximal clique of size at least $3$ (which exists since $G$ contains a triangle). By hypothesis, $K \\neq G$. Since $G$ is connected, there exists an edge $e = ab$ with $a \\in K$ and $b \\notin K$. Since $K$ is a maximal clique, $b$ cannot be adjacent to all vertices in $K$. Choose a vertex $c \\in K$ that is not adjacent to $b$. We can then toggle $a, b, c$, replacing edges $ab$ and $ac$ with $bc$. This does not disconnect the graph because $K$ has size at least $3$, meaning there is another vertex $d \\in K$ through which $a$ and $c$ remain connected (since $ad$ and $cd$ are edges in $K$), and $b$ remains connected to the rest of the graph via $c$.\n\\end{proof}\n\nBack to the original problem; let $G_{\\text{imo}}$ be the given initial graph. We can apply toggles (by the claim) repeatedly, without disconnecting the graph, until we reach a tree. This is guaranteed because:\n\\begin{itemize}\n \\item $G_{\\text{imo}}$ is initially connected. Any two non-adjacent vertices have a common neighbor by the Pigeonhole Principle, since the sum of their degrees is at least $1009 + 1009 = 2018$, and there are only $2017$ other vertices in the graph ($1009 + 1009 + 2 > 2019$).\n \\item $G_{\\text{imo}}$ cannot become a cycle. Initially, $1010$ vertices have an odd degree of $1009$. A toggle at vertex $a$ involving neighbors $b$ and $c$ decreases the degree of $a$ by $2$ and leaves the degrees of $b$ and $c$ unchanged, so toggles preserve the parity of the degree of every vertex. Since $G_{\\text{imo}}$ always contains vertices of odd degree, it can never become a cycle (which requires all vertices to have an even degree).\n \\item $G_{\\text{imo}}$ is not a clique initially, since its maximum degree is $1010$, which is strictly less than $2018$. It cannot become a clique later because each toggle strictly decreases the total number of edges.\n\\end{itemize}\nThus, repeatedly applying these connectivity-preserving toggles must eventually reduce $G_{\\text{imo}}$ to a tree.\n\nOnce $G_{\\text{imo}}$ is a tree, we repeatedly apply toggles arbitrarily until no more are possible. In a forest, any toggle replaces edges $ab$ and $ac$ with $bc$. This operation cannot create a cycle because, after removing $ab$ and $ac$, $b$ and $c$ belong to different connected components, so adding $bc$ simply merges these components. Thus, the graph remains acyclic (a forest). Since each toggle strictly decreases the total number of edges, the process must terminate. The process can only terminate when no vertex has degree $2$ or more; otherwise, in a forest, any two neighbors of a vertex are non-adjacent, allowing for another toggle. Therefore, the terminal graph has a maximum degree of at most $1$, as desired.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Reformulated the operation as a graph toggle on a triple (a,b,c): delete edges ab,ac and add bc, and correctly observed that each toggle strictly decreases the number of edges. 2. Proved the parity invariant: in a toggle, only deg(a) changes (by −2), so the parity of the degree of every vertex is preserved throughout. 3. Proved the initial graph is connected, e.g. by showing any two non-adjacent vertices have a common neighbor using the degree condition (so there is a path of length 2 between any such pair). (Almost) 1. Gave the full reduction strategy “apply toggles while keeping the graph connected until reaching a tree; then keep toggling in the forest until no vertex has degree ≥2”, but left a small gap in justifying that one can always choose a toggle that does not disconnect the graph unless the graph is a clique/cycle/tree. 2. Proved termination and the final step in a forest (if a vertex has degree ≥2 then a toggle is possible; edge count decreases so the process ends with max degree ≤1), but did not fully justify why the process cannot get stuck earlier in a connected non-tree state (e.g. missed ruling out the cycle/clique possibilities via invariants). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2019-P5", "category": "Operations and Strategies", "id": "IMO2019_5", "query": "Let $n$ be a positive integer. Harry has $n$ coins lined up on his desk, which can show either heads or tails. He does the following operation: if there are $k$ coins which show heads and $k > 0$, then he flips the $k$th coin over; otherwise he stops the process. (For example, the process starting with $THT$ would be $THT \\to HHT \\to HTT \\to TTT$, which takes three steps.)\n\nProve the process will always terminate, and determine the average number of steps this takes over all $2^{n}$ configurations.", "ref_solution": "We will prove that the process always terminates and that the expected number of steps over all $2^n$ initial configurations is\n\\[\nE_n = \\frac{1}{2} (1 + 2 + \\dots + n) = \\frac{1}{4} n(n+1),\n\\]\nwhich is finite.\n\nWe represent the operation by a directed graph $G_n$ whose vertices are the strings in $\\{0,1\\}^n$, where $1$ corresponds to heads and $0$ corresponds to tails. Each string points to its successor under the operation. For a bit $b \\in \\{0,1\\}$, we let $\\overline{b} = 1-b$, and we denote binary strings as a sequence of $n$ symbols.\n\nThe main claim is that the graph $G_n$ can be described explicitly in terms of $G_{n-1}$. Specifically, the vertex set of $G_n$ can be partitioned into two halves, which we will call $X$ and $Y$, such that each half is isomorphic to $G_{n-1}$ in its edge structure, with a single connecting edge from $Y$ to $X$. The construction is as follows:\n\\begin{itemize}\n \\item We take two copies $X$ and $Y$ of the graph $G_{n-1}$.\n \\item To form the vertices of $X$, we take each string of length $n-1$ from $G_{n-1}$ and append a $0$ to it. In symbols, we apply the mapping $s_1 s_2 \\dots s_{n-1} \\mapsto s_1 s_2 \\dots s_{n-1}0$.\n \\item To form the vertices of $Y$, we take each string of length $n-1$ from $G_{n-1}$, toggle every bit, reverse the order of the bits, and then append a $1$ to the end. In symbols, we apply the mapping $s_1 s_2 \\dots s_{n-1} \\mapsto \\overline{s}_{n-1} \\overline{s}_{n-2} \\dots \\overline{s}_1 1$.\n \\item Finally, we add one new edge from $Y$ to $X$, specifically from the state $11\\dots1$ to the state $11\\dots10$.\n\\end{itemize}\n\nTo prove this claim, we need only show that the arrows in this recursively defined directed graph match the actual operation rules. \n\nFirst, consider the subgraph $X$. For any string in $X$, the $n$-th bit is $0$. Appending a $0$ to a string $s_1 \\dots s_{n-1}$ does not change the total number of $1$s. Thus, if the original string had $k$ ones, the new string also has $k$ ones, and the operation will flip the $k$-th bit. This perfectly matches the transitions in $G_{n-1}$, meaning $X$ is a valid subgraph of $G_n$ and the process operates exactly as it does in $G_{n-1}$.\n\nNext, consider the subgraph $Y$. Suppose a string $s = s_1 \\dots s_{n-1}$ in $G_{n-1}$ has exactly $k$ ones. The modified string in $Y$ is given by $\\overline{s}_{n-1} \\dots \\overline{s}_1 1$. The number of ones in the first $n-1$ bits of this new string is $(n-1) - k$, because every bit was toggled. Including the final $1$, the total number of ones in the new string is $(n-1-k) + 1 = n-k$. \nTherefore, the operation on this new string will flip its $(n-k)$-th bit. The $(n-k)$-th bit of the string $\\overline{s}_{n-1} \\dots \\overline{s}_1 1$ corresponds to the bit $\\overline{s}_{n - (n-k)} = \\overline{s}_k$. Flipping this bit changes it to $s_k$. Thus, the transition in $G_n$ maps the string to:\n\\[\n\\overline{s}_{n-1} \\dots \\overline{s}_{k+1} s_k \\overline{s}_{k-1} \\dots \\overline{s}_1 1.\n\\]\nThis is exactly the image we would get by applying the transformation for $Y$ to the successor of $s$ in $G_{n-1}$ (since the successor of $s$ in $G_{n-1}$ is obtained by flipping $s_k$). This confirms that the internal transitions within $Y$ are isomorphic to those in $G_{n-1}$.\n\nThe only exception in $Y$ is the string corresponding to the terminal state of $G_{n-1}$. The terminal state of $G_{n-1}$ is $00\\dots0$ (which has zero $1$s, so the process stops). Under the mapping for $Y$, the state $00\\dots0$ becomes $11\\dots1$. In $G_n$, the string $11\\dots1$ has exactly $n$ ones, so the operation flips its $n$-th bit, changing it to $11\\dots10$. This exactly matches the single new edge from $Y$ to $X$ defined in our construction.\n\nSince $G_{n-1}$ is assumed by induction to terminate at $00\\dots0$, all paths in $Y$ eventually reach $11\\dots1$, which then transitions to $11\\dots10$ in $X$. From there, the process follows the rules of $X$ (which is isomorphic to $G_{n-1}$) and must eventually terminate at $00\\dots0$. This proves that the process always terminates for any initial configuration in $G_n$.\n\nTo finish the problem, let $E_n$ denote the expected number of steps for a randomly chosen initial configuration in $G_n$. \nThe vertices of $G_n$ are split equally between $X$ and $Y$. \nFor a string starting in $X$, the expected number of steps to reach the terminal state $00\\dots0$ is exactly $E_{n-1}$. \nFor a string starting in $Y$, the process first traverses the internal edges of $Y$. Since $Y$ is isomorphic to $G_{n-1}$, the expected number of steps to reach the local sink $11\\dots1$ is $E_{n-1}$. Once at $11\\dots1$, the process transitions to $11\\dots10$, and from there it takes exactly $n-1$ more steps to reach $00\\dots0$ (since $11\\dots10 \\to 11\\dots00 \\to \\dots \\to 00\\dots0$). Thus, from $11\\dots1$, it takes exactly $n$ steps to finish. The expected number of steps for a string in $Y$ is therefore $E_{n-1} + n$.\n\nAveraging over all $2^n$ configurations (half in $X$ and half in $Y$), we obtain the recurrence relation:\n\\[\nE_n = \\frac{1}{2} \\left[ E_{n-1} + (E_{n-1} + n) \\right] = E_{n-1} + \\frac{n}{2}.\n\\]\nWith the base case $E_0 = 0$, we can solve this recurrence by induction:\n\\[\nE_n = \\sum_{i=1}^n \\frac{i}{2} = \\frac{1}{2} (1 + 2 + \\dots + n) = \\frac{1}{4} n(n+1).\n\\]\nThis completes the proof.", "ref_answer": "$E_n = \\frac{1}{4}n(n+1)$", "grading_guidelines": "(Partial) 1. Proved termination by exhibiting a strictly decreasing invariant (e.g. interpreting the configuration as a binary number / a sum of distinct powers of 2) and checking that one move always decreases it. 2. Set up a correct recursion/partition of the state space into two parts of size 2^{n-1} each which evolve like the (n−1)-coin process (e.g. identifying the two copies corresponding to the last coin being T/H after a suitable transformation). 3. Derived a correct recurrence for the expectation E_n of the form E_n = E_{n-1} + n/2 (or an equivalent averaging argument), even if not fully justified or not fully solved. (Almost) 1. Gave the full decomposition into two copies of G_{n-1} and obtained E_n = E_{n-1} + n/2, but made a localized mistake in verifying the unique connecting transition (typically the behaviour at the all-heads state) or in proving the isomorphism on one half. 2. Solved the recurrence to get E_n = n(n+1)/4 and proved termination, but left a minor gap in the step-count for the special path after reaching 11…1 (e.g. claiming it takes n or n−1 steps without a complete justification of the exact number). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2018-P3", "category": "Existence and Construction", "id": "IMO2018_3", "query": "An \\emph{anti-Pascal triangle} is an equilateral triangular array of numbers such that, except for the numbers in the bottom row, each number is the absolute value of the difference of the two numbers immediately below it. For example, the following array is an anti-Pascal triangle with four rows which contains every integer from $1$ to $10$.\n\\begin{center}\n\\begin{tikzpicture}[scale = 0.8]\n\\node at (1.5,2.58) {$4$};\n\\node at (1,1.72) {$2$};\n\\node at (2,1.72) {$6$};\n\\node at (0.5,0.86) {$5$};\n\\node at (1.5,0.86) {$7$};\n\\node at (2.5,0.86) {$1$};\n\\node at (0,0) {$8$};\n\\node at (1,0) {$3$};\n\\node at (2,0) {$10$};\n\\node at (3,0) {$9$};\n\\end{tikzpicture}\n\\end{center}\nDoes there exist an anti-Pascal triangle with $2018$ rows which contains every integer from $1$ to $1+2+\\dots +2018$?", "ref_solution": "The answer is no; there is no anti-Pascal triangle with the required properties.\n\nLet $n = 2018$ and $N = 1+2+\\dots+n$. For every number $d$ not in the bottom row, draw an arrow from $d$ to the larger of the two numbers immediately below it (i.e., if $d=|a-b|$ and $a>b$, draw $d \\to a$). This creates an *oriented forest* of directed paths (which look like lightning strikes). Notice that along any directed path, the values strictly increase, with the increment at each step being the smaller of the two numbers below the current one.\n\nConsider the directed path starting from the top vertex $A$. The final value on the bottom row is the sum of the starting number at $A$ and the increments at each step along the path. Since the starting number and the increments at each step are distinct positive integers, and there are $n$ such numbers in total ($1$ starting number and $n-1$ increments), their sum is at least $1+2+\\dots+n = N$. Since no number in the triangle can exceed $N$, equality must hold. Thus, the path from the top ends exactly at $N$, and the starting number together with the increments must exactly comprise the set $\\{1,2,\\dots,n\\}$. Let $B$ be the position of $N$ on the bottom row.\n\nConsider the two left and right neighbors $X$ and $Y$ of the endpoint $B$ on the bottom row. Assume without loss of generality that $B$ is to the right of the midpoint of the bottom side. Complete the equilateral sub-triangle whose base is the segment of the bottom row to the left of $B$ (ending at $X$), to an apex $C$. Consider the lightning strike (directed path) starting from $C$ and hitting the bottom row at $D$. It travels at least $\\lfloor n/2-1 \\rfloor$ steps by construction, since the base of this sub-triangle has length at least $\\lfloor n/2 \\rfloor$. \n\nBecause all numbers in the triangle are distinct, and the integers $1,2,\\dots,n$ are already used on or adjacent to the $A \\to B$ lightning path, the increases along the path from $C$ must be at least $n+1$, $n+2$, \\dots. Then the number at $D$ is at least the sum of these increments:\n\\[\n (n+1) + (n+2) + \\dots + \\left( n+\\left( \\lfloor n/2-1 \\rfloor \\right) \\right) > 1 + 2 + \\dots + n\n\\]\nfor $n \\ge 2018$, which is a contradiction since no number in the triangle can exceed $N$.", "ref_answer": "No", "grading_guidelines": "(Partial) 1. Introduced the directed-arrow (\"lightning\") construction: for each non-bottom entry d=|a-b|, oriented an edge from d to the larger of {a,b}, and proved that values strictly increase along each directed path with increment equal to the smaller child. 2. From the top vertex A, proved a valid lower bound on the bottom endpoint on its lightning path by expressing it as (top value) + (sum of positive increments), and used distinctness to obtain a nontrivial bound such as endpoint ≥ 1+2+…+n. 3. Identified that if the endpoint of the top lightning path attains the maximal possible value N=1+2+…+n, then the multiset consisting of the top value and all increments on that path must equal {1,2,…,n} (or an equivalent rigidity statement). (Almost) 1. Carried out the lightning-path argument to force the top path to end at N and to use exactly the labels {1,2,…,n} as (start + increments), then selected an appropriate second apex C in a large subtriangle and set up the second lightning path to have length at least ⌊n/2−1⌋, but did not fully justify this step-count/geometric subtriangle construction. 2. Completed the contradiction scheme by arguing that the increments on the second path must avoid {1,2,…,n} and hence are ≥ n+1,n+2,…, and summed them to exceed N, but left a localized gap (e.g., why the second path’s increments are all distinct and disjoint from the first path’s used labels, or an inequality/off-by-one in the final sum). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2018-P4", "category": "Operations and Strategies", "id": "IMO2018_4", "query": "A \\emph{site} is any point $(x,y)$ in the plane for which $x,y \\in \\{1, \\dots, 20\\}$. Initially, each of the $400$ sites is unoccupied. Amy and Ben take turns placing stones on unoccupied sites, with Amy going first; Amy has the additional restriction that no two of her stones may be at a distance equal to $\\sqrt5$. They stop once either player cannot move. Find the greatest $K$ such that Amy can ensure that she places at least $K$ stones.", "ref_solution": "The answer is $K = 100$.\n\nFirst, we show Amy can always place at least $100$ stones. Indeed, treat the problem as a grid with a checkerboard coloring. Since a distance of $\\sqrt{5}$ corresponds to a knight jump, it always connects squares of different colors. Thus, Amy can choose to always play on one of the $200$ black squares without violating the distance condition. In this way, she can guarantee half the black squares, i.e., she can get $\\frac{1}{2}\\cdot 200 = 100$ stones.\n\nSecond, we show Ben can prevent Amy from placing more than $100$ stones. Divide the grid into several $4\\times4$ squares and then further partition each $4\\times4$ square according to the following labeling:\n\\[\n\\begin{array}{cccc}\n1 & 2 & 3 & 4 \\\\\n3 & 4 & 1 & 2 \\\\\n2 & 1 & 4 & 3 \\\\\n4 & 3 & 2 & 1\n\\end{array}\n\\]\nThe squares with each label form $4$-cycles by knight jumps. For each such cycle, whenever Amy plays in the cycle, Ben plays in the opposite point of the cycle, preventing Amy from playing any more stones in that original cycle. Hence Amy can play on at most $\\frac{1}{4}$ of the sites, meaning she can place at most $100$ stones, as desired.", "ref_answer": "$K = 100$", "grading_guidelines": "(Partial) 1. Observed that the forbidden distance √5 is exactly a knight move on the grid, and in particular connects opposite colors in a checkerboard coloring. 2. Gave a valid strategy for Amy guaranteeing at least 100 moves, e.g. “always play on black squares”, with a correct argument that this never violates the √5 condition and yields at least 100 stones. 3. Set up a correct partition/mirroring idea for Ben to limit Amy (e.g. decomposition into 4-cycles under knight moves, or into 4×4 blocks with a repeated 1–4 pattern), even if the cycle structure or the final counting is not fully finished. (Almost) 1. Proved both bounds K≥100 and K≤100 using the intended ideas, but left a minor gap in the game-theoretic justification of Ben’s reply strategy (e.g. why the “opposite point in the 4-cycle” is always unoccupied and always legal when needed). 2. Completed Ben’s blocking strategy up to showing Amy gets at most one stone per 4-cycle, but made a localized counting/tiling slip (e.g. not fully justifying that the 20×20 grid is partitioned into exactly 100 disjoint 4-cycles). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2017-P3", "category": "Operations and Strategies", "id": "IMO2017_3", "query": "A hunter and an invisible rabbit play a game in the plane. \nThe rabbit and the hunter start at the same point $A_0 = B_0$. \nIn the $n$th round of the game ($n \\ge 1$), three events occur in order:\n\n(i) The rabbit moves invisibly from $A_{n-1}$ to a point $A_n$ such that $A_{n-1}A_n = 1$.\n\n(ii) The hunter has a tracking device (e.g., a dog) which reports an approximate location $P_n$ of the rabbit, satisfying $P_nA_n \\le 1$.\n\n(iii) The hunter moves visibly from $B_{n-1}$ to a point $B_n$ such that $B_{n-1}B_n = 1$.\n\nLet $N = 10^9$. Can the hunter guarantee that $A_NB_N < 100$?", "ref_solution": "No.\n\nWe will show how to increase the distance in the following way:\n\n\\begin{claim*}\n Suppose the rabbit is at a distance $d \\ge 1$ from the hunter\n at some point in time.\n Then it can increase its distance to at least\n $\\sqrt{d^2+\\frac12}$ in $4d$ steps\n regardless of what the hunter already knows about the rabbit.\n\\end{claim*}\n\\begin{proof}\n Consider a positive integer $n > d$, to be chosen later.\n Let the hunter start at $B$ and the rabbit at $A$.\n Let $\\ell$ denote line $AB$.\n\n Now, we may assume the rabbit reveals its location $A$,\n so that all previous information becomes irrelevant.\n\n The rabbit chooses two points $X$ and $Y$ symmetric about $\\ell$\n such that $XY = 2$ and $AX = AY = n$. Let $M$ be the midpoint of segment $XY$; by symmetry, $M$ lies on $\\ell$, and $MX = 1$.\n The rabbit can then hop to either $X$ or $Y$,\n pinging a point on $\\ell$ each time.\n This takes $n$ hops.\n\n Now among all points $H$ the hunter can go to,\n $\\min \\max \\{HX, HY\\}$ is clearly minimized with $H \\in \\ell$ by symmetry.\n So the hunter moves to a point $H$ on the ray $BA$ such that $BH = n$ as well.\n In that case the new distance is $HX = HY$.\n\n Since $H$ and $M$ lie on $\\ell$, we have $AH = BH - AB = n - d$. Furthermore, in the right triangle $AMX$, $AM = \\sqrt{AX^2 - MX^2} = \\sqrt{n^2 - 1}$. Thus, $HM = AM - AH = \\sqrt{n^2-1} - (n-d)$.\n\n We now compute\n \\begin{align*}\n HX^2 &= 1 + HM^2 = 1 + \\left( \\sqrt{AX^2-1}-AH \\right)^2 \\\\\n &= 1 + \\left( \\sqrt{n^2-1}-(n-d) \\right)^2 \\\\\n &\\ge 1 + \\left( \\left( n-\\frac1n \\right) - (n-d) \\right)^2 \\\\\n &= 1 + \\left(d-\\frac{1}{n}\\right)^2\n \\end{align*}\n which exceeds $d^2 + \\frac12$ whenever $n \\ge 4d$.\n\\end{proof}\n\nIn particular we can always take $n = 400$ even very crudely;\napplying the lemma $2 \\cdot 100^2$ times,\nthis gives a bound of $400 \\cdot 2 \\cdot 100^2 < 10^9$, as desired.", "ref_answer": "No", "grading_guidelines": "(Partial) 1. Gave a correct rabbit strategy idea to increase distance: choose two symmetric candidate positions X,Y about the line AB, hop among them while reporting points on AB, with the aim that the hunter’s best response is forced onto AB by symmetry. 2. Established a quantitative distance-growth inequality of the form: starting from distance d, after some number of steps the rabbit can force the distance to be at least sqrt(d^2+c) for a fixed constant c>0 (even with a weaker constant or with an unspecified-but-correct dependence on d for the number of steps). 3. Correctly argued that if the rabbit can repeatedly increase distance by a fixed positive amount in squared distance (or by a multiplicative factor >1) within O(d) steps, then after sufficiently many iterations (and hence within N=10^9 steps) it can exceed 100, concluding the hunter cannot guarantee AB<100. (Almost) 1. Presented the full symmetric two-point construction (X,Y with XY=2, AX=AY=n, midpoint M on AB, rabbit pings on AB each hop) and the hunter optimality-by-symmetry reduction to a position H on AB, but made a minor computational slip in the final estimate for HX^2 (e.g., the bound sqrt(n^2-1) >= n-1/n or the concluding choice n>=4d). 2. Proved the key claim ‘from distance d the rabbit can force distance at least sqrt(d^2+1/2) in at most 4d steps’ but did not correctly finish the iteration to reach >100 within 10^9 steps (e.g., chose the number of iterations or total-step bound incorrectly, or omitted checking d>=1/base case). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2017-P5", "category": "Existence and Construction", "id": "IMO2017_5", "query": "Fix $N \\ge 1$. A collection of $N(N+1)$ soccer players of distinct heights stand in a row. Sir Alex Song wishes to remove $N(N-1)$ players from this row to obtain a new row of $2N$ players in which the following $N$ conditions hold: no one stands between the two tallest players, no one stands between the third and fourth tallest players, \\dots, no one stands between the two shortest players. Prove that this is possible.", "ref_solution": "We begin by partitioning the $N(N+1)$ players into $N$ groups based on their heights. Order the players by height and define the groups as follows:\nLet $G_1$ consist of the $N+1$ shortest players, \n$G_2$ consist of the next $N+1$ shortest players, \nand so on, up to $G_N$, which consists of the $N+1$ tallest players. \n\nIf we select exactly two players from each group $G_k$, then in the final row of $2N$ players, the two players from $G_N$ will be the 1st and 2nd tallest, the two from $G_{N-1}$ will be the 3rd and 4th tallest, and so on, down to the two from $G_1$ being the two shortest. Thus, to satisfy the problem's conditions, it suffices to select two players from each group $G_k$ such that for each $k$, the two selected players from $G_k$ end up adjacent in the final row of $2N$ players.\n\nWe prove that this is always possible by proving a more general claim by induction on $M$:\n**Claim:** *For any integer $M \\ge 1$, given a row of players and $M$ disjoint groups of players such that each group has at least $M+1$ players present in the row, we can select two players from each group such that, after removing all unselected players, the two selected players from each group are adjacent in the remaining row.*\n\n**Proof of Claim:**\nWe proceed by induction on $M$.\n\n*Base case:* For $M=1$, we have $1$ group with at least $2$ players. We simply select the first two players from this group in the row. Since all other players are removed, these two players will trivially be adjacent.\n\n*Inductive step:* Assume the claim holds for some $M-1 \\ge 1$. We are given $M$ groups, each with at least $M+1$ players. \nScan the row of players from left to right, and stop as soon as we encounter two players belonging to the same group. Let this group be $G_k$, and let the two players be $A$ and $B$, where $B$ is the player we just scanned (so $B$ is to the right of $A$). \n\nBy the definition of our stopping condition, the scanned prefix of the row contains exactly two players from $G_k$, and at most one player from each of the other $M-1$ groups. We select $A$ and $B$ as the two players for group $G_k$.\n\nNext, we delete the entire scanned prefix of the row (up to and including $B$), and we also delete all remaining players of $G_k$ from the rest of the row. For each of the remaining $M-1$ groups, we have deleted at most $1$ player (since at most one player from each of these groups appeared in the scanned prefix). Therefore, each of the remaining $M-1$ groups still has at least $(M+1) - 1 = M = (M-1) + 1$ players present in the remaining row.\n\nBy the induction hypothesis, we can select two players from each of these $M-1$ groups from the remaining row such that they are adjacent in the final selection. Because $A$ and $B$ are the only players selected from the deleted prefix, they will appear at the very left of the final row of $2M$ selected players. Thus, no other selected player can stand between $A$ and $B$, meaning $A$ and $B$ are adjacent. The pairs selected from the remaining groups are also adjacent by the induction hypothesis. This completes the inductive step.\n\n**Conclusion:**\nApplying the claim for $M = N$ to our initial partition of $N$ groups (each of size $N+1$), we can successfully choose two players from each group such that they are adjacent in the final row. As established, this selection satisfies all the conditions of the problem.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Made the key reduction by partitioning the players into height groups (e.g. the k-th group consists of the (N+1) players with ranks (k-1)(N+1)+1 through k(N+1)), and observed that it suffices to choose two players from each group so that each chosen pair is adjacent in the remaining row. 2. Stated/proved the inductive auxiliary claim (or an equivalent Hall-type/greedy statement): for M disjoint groups, each appearing at least M+1 times in the row, one can choose two from each group so that within the chosen subsequence the two from each group are consecutive. 3. In the induction/greedy step, correctly identified the “scan left to right until the first repeated group” idea and proved that in the scanned prefix there is at most one element from each other group, hence deleting this prefix reduces the required lower bound for each remaining group by at most 1. (Almost) 1. Gave the full inductive construction selecting a first pair by scanning to the first repeated group, then deleting the scanned prefix and all remaining members of that group, and applying induction to the remaining M−1 groups, but did not fully justify why the selected first pair ends up adjacent in the final row (e.g. did not argue that all other selected players come from the suffix). 2. Correctly completed the auxiliary claim, and correctly applied it to the N groups of size N+1 to finish, but left a small gap in the counting after deletions (e.g. did not justify that each remaining group still has at least (M−1)+1 elements in the reduced row). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2016-P6", "category": "Existence and Construction", "id": "IMO2016_6", "query": "There are $n\\ge 2$ line segments in the plane such that every two segments cross and no three segments meet at a point. Geoff has to choose an endpoint of each segment and place a frog on it facing the other endpoint. Then he will clap his hands $n-1$ times. Every time he claps, each frog will immediately jump forward to the next intersection point on its segment. Frogs never change the direction of their jumps. Geoff wishes to place the frogs in such a way that no two of them will ever occupy the same intersection point at the same time.\n\n\\begin{enumerate}[(a)]\n\\item Prove that Geoff can always fulfill his wish if $n$ is odd.\n\\item Prove that Geoff can never fulfill his wish if $n$ is even.\n\\end{enumerate}", "ref_solution": "Geoff can fulfill his wish if and only if $n$ is odd.\n\nThe preliminary geometric framework operates as established context. A large circle $\\omega$ encases all $\\binom{n}{2}$ intersection points. The boundary points $P_1, P_2, \\dots, P_{2n}$ are ordered clockwise. Each line segment connects $P_i$ and $P_{i+n}$.\n\n(a) For odd $n$, place the frogs on $P_1, P_3, \\dots, P_{2n-1}$. Parity dictates that no two frogs intersect simultaneously.\n\n(b) For even $n$, frogs cannot occupy consecutive $P_i$, requiring placement on alternating points. Frogs cannot occupy diametrically opposite points, yielding an immediate contradiction.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Set up (or correctly used) the standard circular model: all intersections inside a circle, the 2n boundary points P1,…,P2n in order, and each segment is the chord PiPi+n; and interpreted a frog’s positions after k claps as the k-th intersection along that chord. 2. For odd n, gave the correct placement pattern (e.g. frogs start at P1,P3,…,P2n−1 or an equivalent alternating set) and proved a nontrivial invariant/observation implying two frogs cannot land on the same intersection at the same time (e.g. a parity argument on indices of endpoints/intersections). 3. For even n, proved a necessary restriction on any collision-free placement, such as: starting endpoints cannot be consecutive among the P_i (otherwise an immediate collision occurs), hence frogs must be placed on alternating boundary points. (Almost) 1. Solved both (a) and (b) in the circle/chord model with the correct constructions and contradictions, but left a small gap in justifying the key translation between “same intersection at same time” and the derived parity/index condition on the corresponding boundary labels. 2. Gave the odd-n construction and essentially complete no-collision proof, and for even n obtained the forced “alternating endpoints” condition, but did not finish the final contradiction (e.g. did not fully justify why some diametrically opposite pair must be chosen / why that forces a collision). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2015-P1", "category": "Existence and Construction", "id": "IMO2015_1", "query": "We say that a finite set $\\mathcal{S}$ of points in the plane is *balanced* if, for any two different points $A$ and $B$ in $\\mathcal{S}$, there is a point $C$ in $\\mathcal{S}$ such that $AC=BC$. We say that $\\mathcal{S}$ is *center‑free* if for any three different points $A$, $B$ and $C$ in $\\mathcal{S}$, there are no points $P$ in $\\mathcal{S}$ such that $PA=PB=PC$.\n\n\\begin{enumerate}\n\\item[(a)] Show that for all integers $n\\ge 3$, there exists a balanced set consisting of $n$ points.\n\\item[(b)] Determine all integers $n\\ge 3$ for which there exists a balanced center‑free set consisting of $n$ points.\n\\end{enumerate}", "ref_solution": "**Part (a)**\n\nWe show that a balanced set exists for all integers $n \\ge 3$. Let $O$ be a point and $C$ be a circle centered at $O$. We construct the set $\\mathcal{S}$ by choosing $O$ and $n-1$ additional points on $C$. We can group these $n-1$ points into disjoint pairs and triples as follows:\n- A *pair* consists of two points $A, B$ on $C$ separated by an arc of $60^\\circ$.\n- A *triple* consists of three points $A, B, C$ on $C$ such that $A$ and $B$ are separated by $60^\\circ$, and $B$ and $C$ are separated by $60^\\circ$ (so $A, B, C$ are consecutive vertices of a regular hexagon).\n\nSince $n \\ge 3$, we have $n-1 \\ge 2$. Any integer $k \\ge 2$ can be expressed as $2x + 3y$ for some non-negative integers $x, y$. Thus, we can place $x$ pairs and $y$ triples on $C$ such that all $n-1$ points are distinct.\n\nWe now verify that $\\mathcal{S}$ is balanced. For any two distinct points $X, Y \\in \\mathcal{S} \\setminus \\{O\\}$, they lie on $C$, so $OX = OY$. Thus, $O$ serves as the required third point. For $O$ and a point $X \\in \\mathcal{S} \\setminus \\{O\\}$, we need a point $Y \\in \\mathcal{S}$ such that $YX = YO$. Since $Y$ must lie on $C$, $YO$ is the radius of $C$, which means $\\triangle OXY$ must be equilateral, so $X$ and $Y$ must be separated by $60^\\circ$. \n- If $X$ belongs to a pair $\\{A, B\\}$, then $A$ and $B$ are separated by $60^\\circ$, so $A$ works for $O$ and $B$, and $B$ works for $O$ and $A$.\n- If $X$ belongs to a triple $\\{A, B, C\\}$, then $B$ works for $O$ and $A$, $B$ works for $O$ and $C$, and both $A$ and $C$ work for $O$ and $B$.\n\nThus, the set $\\mathcal{S}$ is balanced.\n\n**Part (b)**\n\nThe answer is all odd integers $n \\ge 3$.\n\nFirst, we show that for any odd $n \\ge 3$, the set of vertices of a regular $n$-gon is balanced and center-free.\n- **Balanced:** For any two distinct vertices $A$ and $B$, their perpendicular bisector passes through the center of the $n$-gon and exactly one vertex $C$ of the $n$-gon (since $n$ is odd). Thus, $CA = CB$, so the set is balanced.\n- **Center-free:** Any three distinct vertices $A, B, C$ uniquely determine a circumcircle, which is the circumcircle of the regular $n$-gon. The only point equidistant from $A, B,$ and $C$ is the center of this circumcircle. However, the center is not a vertex of the $n$-gon, so it is not in the set. Thus, the set is center-free.\n\nNext, we use a standard double-counting argument to show that no balanced center-free set exists for even $n$. Assume for the sake of contradiction that $\\mathcal{S}$ is a balanced center-free set of $n$ points, where $n$ is even.\n\nBy the balanced property, for each of the $\\binom{n}{2}$ pairs of distinct points $\\{A, B\\}$ in $\\mathcal{S}$, there exists at least one point $C \\in \\mathcal{S}$ such that $CA = CB$. We assign one such point $C$ to each pair. By the Pigeonhole Principle, since there are $n$ points available to be assigned, some point $P \\in \\mathcal{S}$ must be assigned to at least\n$$ \\left\\lceil \\frac{1}{n}\\binom{n}{2} \\right\\rceil = \\left\\lceil \\frac{n-1}{2} \\right\\rceil $$\npairs of points. Because $n$ is even, $\\left\\lceil \\frac{n-1}{2} \\right\\rceil = \\frac{n}{2}$.\n\nThus, $P$ is on the perpendicular bisector of at least $\\frac{n}{2}$ pairs of points in $\\mathcal{S} \\setminus \\{P\\}$. This means $P$ is equidistant from the two points in each of these $\\frac{n}{2}$ pairs. \n\nHowever, because $\\mathcal{S}$ is center-free, $P$ cannot be equidistant from any three points in $\\mathcal{S}$. This implies that the points in $\\mathcal{S} \\setminus \\{P\\}$ can be partitioned into equivalence classes based on their distance to $P$, and each class can contain at most $2$ points. The pairs assigned to $P$ correspond to these classes of size exactly $2$.\n\nSince there are exactly $n-1$ points in $\\mathcal{S} \\setminus \\{P\\}$, the maximum number of disjoint pairs of points equidistant from $P$ is\n$$ \\left\\lfloor \\frac{n-1}{2} \\right\\rfloor = \\frac{n-2}{2}. $$\nThis contradicts the fact that $P$ is assigned to $\\frac{n}{2}$ pairs, because $\\frac{n}{2} > \\frac{n-2}{2}$. Therefore, no balanced center-free set exists for even $n$.", "ref_answer": "Part (a): Exists for all integers $n \\ge 3$. Part (b): All odd integers $n \\ge 3$.", "grading_guidelines": "(Partial) 1. For (a), gave a valid construction idea on a circle with a distinguished point O (e.g. O plus points on a circle) and correctly verified the balanced condition for pairs of points lying on the circle (using O as the equidistant point). 2. For (a), correctly reduced the remaining balanced requirement to ensuring that for each point X on the circle there is another chosen point Y with ∠XOY=60° (equivalently, an equilateral triangle with OX=OY=XY). 3. For (b), proved that for odd n the vertices of a regular n-gon form a balanced set (e.g. argued that for any two vertices A,B there is a vertex C on the perpendicular bisector of AB, or an equivalent symmetry argument). 4. For (b), established a key obstruction for even n, e.g. started the assignment/double-counting argument by assigning to each unordered pair {A,B} a point C with CA=CB and deduced that some P is assigned to at least n/2 pairs when n is even. (Almost) 1. Solved (a) completely and proved existence for all odd n in (b), and for even n carried out the assignment/pigeonhole step, but did not finish the final contradiction from center-free (e.g. did not justify why P cannot be assigned to more than ⌊(n-1)/2⌋ pairs). 2. Solved (b) completely (odd n works and even n impossible), but in (a) gave the circle construction without fully justifying that any n−1≥2 can be decomposed into disjoint 2- and 3-blocks (or an equivalent bookkeeping step ensuring all points are distinct). 3. Provided the full intended strategy for both parts, but left one localized gap such as: uniqueness/existence of the vertex C on a perpendicular bisector in the odd n regular n-gon, or the claim that center-free implies no distance-to-P class has size ≥3."}
{"split": "analysis", "source": "IMO-2014-P6", "category": "Existence and Construction", "id": "IMO2014_6", "query": "A set of lines in the plane is in general position if no two are parallel and no three pass through the same point. A set of lines in general position cuts the plane into regions, some of which have finite area; we call these its finite regions. Prove that for all sufficiently large $n$, in any set of $n$ lines in general position it is possible to colour at least $\\sqrt{n}$ lines blue in such a way that none of its finite regions has a completely blue boundary.", "ref_solution": "Suppose we have colored $k$ of the lines blue, and that it is not possible to color any additional lines without creating a finite region with a completely blue boundary. This means that any of the $n-k$ non-blue lines is a side of some finite region with an otherwise entirely blue perimeter.\n\nFor each such non-blue line $\\ell$, select one such finite region, and take the next counterclockwise vertex along the region's perimeter; this vertex $v$ is the intersection of two blue lines. We say that $\\ell$ is the *eyelid* of $v$.\n\nEvery intersection of two blue lines has at most two eyelids. Since there are exactly $\\binom{k}{2}$ such intersections of blue lines, we obtain the inequality\n\\[\nn-k \\le 2 \\binom{k}{2} = k^{2} - k.\n\\]\nThis simplifies to $n \\le k^{2}$, which implies $k \\ge \\sqrt{n}$. Thus, it is always possible to color at least $\\sqrt{n}$ lines blue such that none of the finite regions has a completely blue boundary.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Introduced the maximality setup: start with a blue set of size k such that no further line can be colored blue without creating a finite region whose boundary is all blue, and correctly deduced that every non-blue line lies on the boundary of some finite region whose other sides are all blue. 2. Defined a way to associate (injectively up to bounded multiplicity) each non-blue line to an intersection point of two blue lines (e.g. by choosing a witness finite region and taking a specific adjacent vertex on its boundary), and justified that the chosen point is indeed an intersection of two blue lines. 3. Proved the local bound that a fixed intersection point of two blue lines can be associated to at most two non-blue lines (e.g. by analyzing the cyclic order of lines through that vertex and the two possible incident finite regions). (Almost) 1. Obtained the inequality n-k ≤ 2·C(k,2) (or an equivalent bound n ≤ k^2+O(k)) from the association argument, but did not fully justify why each non-blue line can be assigned to a finite region with otherwise all-blue boundary. 2. Carried out the counting argument correctly to conclude k ≥ √n, but left a small gap in the “at most two eyelids per blue-blue intersection” claim (e.g. did not exclude a third candidate region or did not use general position correctly). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2013-P2", "category": "Extremal Problems", "id": "IMO2013_2", "query": "A configuration of $4027$ points in the plane is called *Colombian* if it consists of $2013$ red points and $2014$ blue points, and no three of the points of the configuration are collinear. By drawing some lines, the plane is divided into several regions. An arrangement of lines is *good* for a Colombian configuration if the following two conditions are satisfied:\n\\begin{enumerate}\n\\ii[(i)] No line passes through any point of the configuration.\n\\ii[(ii)] No region contains points of both colors.\n\\end{enumerate}\nFind the least value of $k$ such that for any Colombian configuration of $4027$ points, there is a good arrangement of $k$ lines.", "ref_solution": "The least value of $k$ is $2013$.\n\n**Lower Bound:**\nWe first show that $k \\ge 2013$ lines are necessary. Consider a configuration where $4026$ of the points form the vertices of a regular $4026$-gon, and the colors of these vertices alternate between red and blue. The $4027$th point is the remaining blue point, which can be placed anywhere such that no three points in the entire configuration are collinear. \n\nThe perimeter of the regular $4026$-gon consists of $4026$ line segments, each connecting a red point and a blue point. In any good arrangement of lines, every such segment must be intersected by at least one line, because the endpoints of the segment are of different colors and must therefore belong to different regions. Since the $4026$-gon is strictly convex, any straight line can intersect its perimeter in at most two points. Therefore, a single line can intersect at most two of the $4026$ segments. To cut all $4026$ segments, we require at least $4026 / 2 = 2013$ lines. Thus, $k \\ge 2013$.\n\n**Upper Bound:**\nWe now prove that $k = 2013$ lines are always sufficient. Consider the convex hull of the $4027$ points. Since the points are not all collinear, the convex hull is a convex polygon with at least three vertices. We distinguish two cases based on the vertices of this convex hull:\n\n*Case 1: The convex hull contains at least one red point.*\nLet $R$ be a red point on the convex hull. Since $R$ is a vertex of the convex hull, we can draw a single line that separates $R$ from the other $4026$ points. \n\nThere are $2012$ red points remaining. We group these $2012$ red points into $1006$ pairs arbitrarily. For each pair $\\{A, B\\}$, we draw two lines parallel to the segment $AB$ and sufficiently close to it such that the narrow strip between these two lines contains $A$ and $B$ but no other points of the configuration. (This is possible because no three points are collinear, so no other point lies on the line $AB$.)\n\nWe have drawn $1 + 2 \\times 1006 = 2013$ lines. These lines partition the plane into several regions. We claim this is a good arrangement. Any point in the plane not on the drawn lines falls into one of the following categories:\n- It lies in the half-plane containing $R$. Since this half-plane contains no other points of the configuration, any region here contains at most the red point $R$, and no blue points.\n- It lies within one of the $1006$ narrow strips. By construction, the entire strip contains only the red points $A$ and $B$ and no other points of the configuration. Thus, any region within this strip contains no blue points.\n- It lies outside the half-plane and outside all $1006$ strips. Since every red point is either $R$ or belongs to one of the pairs, all red points have been accounted for. Thus, any region here contains no red points (it may contain blue points or be empty).\n\nIn all cases, no region contains points of both colors. Thus, the arrangement is good.\n\n*Case 2: The convex hull contains no red points.*\nIf there are no red points on the convex hull, then all vertices of the convex hull must be blue points. Since the convex hull has at least three vertices, there must exist two consecutive blue points on the perimeter of the convex hull, say $U$ and $V$. \n\nSince the segment $UV$ is an edge of the convex hull, we can draw a single line that separates $U$ and $V$ from the other $4025$ points. \n\nThere are $2012$ blue points remaining. We group these $2012$ blue points into $1006$ pairs arbitrarily. For each pair, we draw two lines parallel to the segment connecting them, forming a narrow strip that contains exactly these two blue points and no other points of the configuration. \n\nAgain, we have drawn $1 + 2 \\times 1006 = 2013$ lines. By the exact same reasoning as in Case 1, any point not on the lines either lies in the half-plane containing $U$ and $V$ (which contains no red points), lies in one of the narrow strips (which contain only blue points), or lies outside all of these (which contains no blue points, and thus only red points or empty). Hence, no region contains points of both colors.\n\nIn all cases, a good arrangement of $2013$ lines can be found. Therefore, the least value of $k$ is $2013$.", "ref_answer": "2013", "grading_guidelines": "(Partial) 1. Established the lower bound idea by giving (or clearly describing) a configuration with alternating colors on the vertices of a convex 4026-gon and arguing that every red–blue edge must be crossed by the drawn lines, and that each line crosses the boundary of a strictly convex polygon at most twice, hence k≥2013. 2. Proved a correct geometric reduction for the upper bound: isolated one point (or two adjacent hull vertices) by a single line using a supporting line to the convex hull, ensuring that half-plane contains only those chosen point(s) of one color. 3. Gave the key construction step for the upper bound: for many same-colored points, paired them and for each pair drew two parallel lines close to the segment so that the strip contains exactly those points and no others (with a correct justification using ‘no three collinear’/small perturbation). (Almost) 1. Presented the full 2013-line construction (one separating line plus 1006 strips) but did not completely justify that the chosen strips can be made disjoint/placed so that each contains no other configuration points, leaving only a local existence/perturbation gap. 2. Handled one of the two convex-hull cases (a red hull vertex exists, or all hull vertices are blue and isolate two consecutive blue vertices) correctly and finished the region-color argument for that case, but omitted or inadequately treated the other case. 3. Proved both bounds k≥2013 and k≤2013 with correct overall structure, but made a small counting/edge-case slip (e.g. miscounting how many points remain to be paired, or not checking that no line passes through a configuration point), while the main idea is correct."}
{"split": "analysis", "source": "IMO-2013-P6", "category": "Counting", "id": "IMO2013_6", "query": "Let $n \\ge 3$ be an integer, and consider a circle with $n+1$ equally spaced points marked on it. Consider all labelings of these points with the numbers $0,1,\\dots ,n$ such that each label is used exactly once; two such labelings are considered to be the same if one can be obtained from the other by a rotation of the circle. A labeling is called *beautiful* if, for any four labels $a<b<c<d$ with $a+d=b+c$, the chord joining the points labelled $a$ and $d$ does not intersect the chord joining the points labelled $b$ and $c$. Let $M$ be the number of beautiful labelings, and let $N$ be the number of ordered pairs $(x,y)$ of positive integers such that $x+y\\le n$ and $\\gcd(x,y)=1$. Prove that $M=N+1$.", "ref_solution": "Abbreviate “beautiful labelling of points around a circle” to *ring*. Throughout the solution, we will allow degenerate chords that join a point to itself; this has no effect on the problem statement.\n\nThe idea is to proceed by induction. Let $M_n$ be the number of rings on the labels $[0,n]$. A ring on $[0,n]$ is called *linear* if the sequence of labels forms an arithmetic progression modulo $n+1$. \n\nWe can move from any ring on $[0,n]$ to a ring on $[0,n-1]$ by deleting the point $n$. We will prove that:\n- Each linear ring on $[0,n-1]$ yields exactly two rings on $[0,n]$, and\n- Each nonlinear ring on $[0,n-1]$ yields exactly one ring on $[0,n]$.\n\nSince a linear ring on $[0,n-1]$ is generated by a common difference coprime to $n$, and we consider rings up to rotation, there are exactly $\\varphi(n)$ linear rings on $[0,n-1]$. Thus, the number of linear rings is $L_{n-1} = \\varphi(n)$. The recurrence for $M_n$ will then be:\n\\[ M_n = 2 L_{n-1} + 1 \\cdot (M_{n-1} - L_{n-1}) = M_{n-1} + L_{n-1} = M_{n-1} + \\varphi(n). \\]\n\nWe say a set of chords (possibly degenerate) is *pseudo-parallel* if they do not cross, and for any three of them, one separates the other two. (Pictorially, one can perturb the endpoints along the circle to make them parallel in the Euclidean sense without changing their cyclic order). \n\n\\begin{lemma*}\n In any ring, the chords of sum $k$ (including degenerate ones) are pseudo-parallel.\n\\end{lemma*}\n\\begin{proof}\n By induction on $n$. The base cases are trivial. Suppose the statement holds for rings up to maximum label $n-1$. We prove it for a ring with maximum label $n$.\n By a shifting argument—discarding all labels exceeding $k$, which preserves the beautiful property for the remaining labels—we may assume $k=n$, so that one of the chords is $\\{0, n\\}$.\n \n Suppose for contradiction there exist three chords of sum $n$ that are not pseudo-parallel. Without loss of generality, let one be $\\{0, n\\}$, and the other two be $\\{a, n-a\\}$ and $\\{b, n-b\\}$. Since they are not pseudo-parallel, none separates the other two. Thus, $\\{a, n-a\\}$ and $\\{b, n-b\\}$ must lie on the same arc bounded by $0$ and $n$ (say, the \"upper\" arc). Furthermore, they must be \"side-by-side\", meaning neither separates the other from $\\{0, n\\}$.\n \n Let $u$ and $v$ be the points on the upper arc immediately adjacent to $0$ and $n$, respectively. Consider the sum $u+v$. There are three cases:\n \\begin{itemize}\n \\item If $u+v = n$, then $\\{u, v\\}$ is a chord of sum $n$. Delete $0$ and $n$ and decrease all remaining labels by $1$. The chords $\\{a, n-a\\}$ and $\\{b, n-b\\}$ become $\\{a-1, n-a-1\\}$ and $\\{b-1, n-b-1\\}$, which have sum $n-2$. The chord $\\{u, v\\}$ becomes $\\{u-1, v-1\\}$, also of sum $n-2$. In the new ring, $u$ and $v$ are adjacent, so $\\{u-1, v-1\\}$ is an edge of the polygon and cannot separate the other two chords. Since $\\{a-1, n-a-1\\}$ and $\\{b-1, n-b-1\\}$ are side-by-side, these three chords of sum $n-2$ are mutually non-separating, contradicting the induction hypothesis.\n \\item If $u+v < n$, consider the chord $\\{0, u+v\\}$. It has sum $u+v$, the same as $\\{u, v\\}$. Since the ring is beautiful, they do not intersect. This forces $u+v$ to lie on the lower arc. Then the chord $\\{u+v, n-(u+v)\\}$ has sum $n$, so it cannot intersect $\\{0, n\\}$, meaning $n-(u+v)$ is also on the lower arc. Now delete $0$ and $n$ and decrease everything by $1$. The chords $\\{a-1, n-a-1\\}$, $\\{b-1, n-b-1\\}$, and $\\{u+v-1, n-(u+v)-1\\}$ have sum $n-2$. The first two are on the former upper arc, and the third is on the former lower arc. In the new ring, the former lower arc connects $u$ and $v$ without crossing the former upper arc. Thus, the third chord cannot separate the first two, and neither of the first two can separate the third. This gives three mutually non-separating chords of sum $n-2$, contradicting the induction hypothesis.\n \\item If $u+v > n$, apply the map $t \\mapsto n-t$ to the entire ring. This preserves the beautiful property and chords of sum $n$. The upper and lower arcs are swapped, and the new points adjacent to $0$ and $n$ on the upper arc are $n-v$ and $n-u$. Their sum is $(n-v) + (n-u) = 2n - (u+v) < n$, which reduces to the previous case.\n \\end{itemize}\n\\end{proof}\n\nNext, we give another characterization of linear rings.\n\\begin{lemma*}\n A ring on $[0,n-1]$ is linear if and only if the point $0$ does not lie between two chords of sum $n$.\n\\end{lemma*}\n\\begin{proof}\n This is obviously true for linear rings. Conversely, assume the property holds for some ring. \n Since the chords of sum $n-1$ are pseudo-parallel and encompass every point, they are linearly nested. This implies that the involution $t \\mapsto n-1-t \\pmod n$, which swaps the endpoints of these chords, reverses the cyclic order of the points. Thus, it acts as a geometric reflection of the circle.\n Similarly, the chords of sum $n$ encompass every point except $0$. Since $0$ does not lie between two such chords, they are linearly nested with $0$ at the boundary. The involution $t \\mapsto n-t \\pmod n$ swaps the endpoints of these chords and fixes $0$. Since the chords are linearly nested, this involution also reverses the cyclic order of the points, acting as another geometric reflection of the circle.\n \n The composition of these two reflections is a geometric rotation of the circle. Applying the first reflection and then the second maps the position of $t$ to $(n-1)-(n-t) \\equiv t-1 \\pmod n$. Since this map is a rotation, the sequence of points $0, -1, -2, \\dots$ appears at equal angular intervals around the circle. Therefore, the ring is an arithmetic progression modulo $n$, which means it is linear.\n\\end{proof}\n\n\\begin{lemma*}\n Every nonlinear ring on $[0,n-1]$ induces exactly one ring on $[0,n]$.\n\\end{lemma*}\n\\begin{proof}\n Because the chords of sum $n$ are pseudo-parallel, they are linearly nested. Since the ring is nonlinear, $0$ lies between two chords of sum $n$, say $C_1$ and $C_2$. The region between $C_1$ and $C_2$ intersects the circle in two arcs, and $0$ lies on one of them. In order for the new chord $\\{0, n\\}$ to be pseudo-parallel to all chords of sum $n$, it must separate $C_1$ and $C_2$. This requires $n$ to be placed on the *other* arc bounded by $C_1$ and $C_2$. Since all points other than $0$ are endpoints of the chords of sum $n$, this other arc contains no points of the ring, and thus corresponds to exactly one interval between adjacent points. Therefore, there is at most one possibility for the location of $n$.\n\n Conversely, we claim that this unique placement works. The chords of sum less than $n$ do not involve $n$, so they do not intersect by the induction hypothesis. The chords of sum $n$ do not intersect by our choice of the location of $n$. Assume for contradiction that there exist two intersecting chords of sum $S > n$. Since $n$ is the maximum label, this can only happen if one chord is $\\{a, b\\}$ and the other is $\\{n, c\\}$, where $a, b, c \\in \\{1, \\dots, n-1\\}$ and $a+b = n+c$.\n \n Consider the chords of sum $n$. Because they form a pseudo-parallel perfect matching of the points, we can continuously deform the circle to make these chords geometrically parallel without changing the cyclic order of the points. In this configuration, the map $x \\mapsto n-x$ is a geometric reflection. Since geometric reflection preserves the intersection of chords, $\\{a, b\\}$ and $\\{n, c\\}$ intersect if and only if their reflections $\\{n-a, n-b\\}$ and $\\{0, n-c\\}$ intersect.\n However, $(n-a) + (n-b) = 2n - (a+b) = 2n - (n+c) = n-c = 0 + (n-c)$. Thus, $\\{n-a, n-b\\}$ and $\\{0, n-c\\}$ are two chords in the original ring $[0, n-1]$ with the same sum $n-c < n$. Since the original ring is beautiful, they cannot intersect, a contradiction. Thus, the original numbers on $[0,n-1]$ together with $n$ form a beautiful ring.\n\\end{proof}\n\n\\begin{lemma*}\n Every linear ring on $[0,n-1]$ induces exactly two rings on $[0,n]$.\n\\end{lemma*}\n\\begin{proof}\n Because the ring is linear, $0$ does not lie between two chords of sum $n$. Thus, all chords of sum $n$ lie on one side of $0$. The region containing $0$ is bounded by a single chord of sum $n$, and the arc of this region containing $0$ has no other points. To make $\\{0, n\\}$ pseudo-parallel to the chords of sum $n$, $n$ must be placed in this same region. Since $0$ is the only point in this region, $n$ can be placed in exactly two locations: immediately to the left of $0$, or immediately to the right of $0$. For the same reason as the reflection argument in the previous proof, both choices yield a beautiful ring.\n\\end{proof}\n\n**Conclusion:**\nWe are given $n \\ge 3$, but we can anchor our induction at $n=2$. For $n=2$, the labels are $0, 1, 2$. Up to rotation, there are $2$ labelings: $(0, 1, 2)$ and $(0, 2, 1)$. Both are trivially beautiful, so $M_2 = 2$.\nThe problem defines $N$ as the number of ordered pairs $(x, y)$ of positive integers with $x+y \\le n$ and $\\gcd(x,y)=1$. For a fixed sum $k \\in \\{2, \\dots, n\\}$, there are exactly $\\varphi(k)$ such pairs. Thus, $N_n = \\sum_{k=2}^n \\varphi(k)$.\nFor $n=2$, $N_2 = \\varphi(2) = 1$, so $M_2 = N_2 + 1$.\nAssume by induction that $M_{n-1} = N_{n-1} + 1$. By our lemmas, \n\\[ M_n = M_{n-1} + \\varphi(n) = N_{n-1} + 1 + \\varphi(n) = N_n + 1. \\]\nThis completes the proof that $M = N + 1$.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Established the recurrence idea by deleting the point labeled n (or another maximal label) to reduce a beautiful labeling on [0,n] to one on [0,n−1], and stated/argued that M_n should satisfy M_n=M_{n-1}+“number of special (linear) rings on [0,n−1]”. 2. Proved a key structural property of beautiful rings: for a fixed sum k, the chords joining pairs {a,k−a} do not cross (e.g. form a noncrossing matching / are “nested” / pseudo-parallel). 3. Correctly counted that the number of ordered coprime pairs (x,y) with x+y=k equals φ(k), hence N=∑_{k=2}^n φ(k). (Almost) 1. Gave a full inductive solution with M_n=M_{n-1}+φ(n) by classifying rings on [0,n−1] into linear and nonlinear and proving that linear rings extend to exactly two rings on [0,n] while nonlinear rings extend to exactly one, but left a localized gap in justifying the “exactly one/two placements” of the new point n. 2. Proved the extension counts (1 for nonlinear, 2 for linear) and derived the recurrence, but did not fully justify the characterization/count of linear rings as φ(n) up to rotation (e.g. missing the coprimality argument for the step size, or the rotation-equivalence check). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2012-P3", "category": "Operations and Strategies", "id": "IMO2012_3", "query": "The liar's guessing game is a game played between two players $A$ and $B$. The rules of the game depend on two fixed positive integers $k$ and $n$ which are known to both players.\n\nAt the start of the game $A$ chooses integers $x$ and $N$ with $1 \\le x \\le N$. Player $A$ keeps $x$ secret, and truthfully tells $N$ to player $B$. Player $B$ now tries to obtain information about $x$ by asking player $A$ questions as follows: each question consists of $B$ specifying an arbitrary set $S$ of positive integers (possibly one specified in some previous question), and asking $A$ whether $x$ belongs to $S$. Player $B$ may ask as many questions as he wishes. After each question, player $A$ must immediately answer it with yes or no, but is allowed to lie as many times as she wants; the only restriction is that, among any $k+1$ consecutive answers, at least one answer must be truthful.\n\nAfter $B$ has asked as many questions as he wants, he must specify a set $X$ of at most $n$ positive integers. If $x$ belongs to $X$, then $B$ wins; otherwise, he loses. Prove that:\n\n\\begin{enumerate}[(a)]\n \\item If $n \\ge 2^k$, then $B$ can guarantee a win.\n \\item For all sufficiently large $k$, there exists an integer $n \\ge (1.99)^k$ such that $B$ cannot guarantee a win.\n\\end{enumerate}", "ref_solution": "Call the players Alice and Bob.\n\nPart (a): We prove the following.\n\n**Claim.** If $N \\ge 2^{k}+1$, then in $2k+1$ questions Bob can rule out some number in $\\{1,\\dots,2^{k}+1\\}$ from being equal to $x$.\n\n**Proof.** First, Bob asks the question $S_{0}=\\{2^{k}+1\\}$ repeatedly until Alice answers \"yes\" or until Bob has asked $k+1$ questions. If Alice answers \"no\" to all of these, then Bob rules out $2^{k}+1$. So assume Alice eventually says \"yes\".\n\nNow let $T=\\{1,\\dots,2^{k}\\}$. Then he asks $k$ follow-up questions $S_{1},\\dots,S_{k}$ defined as follows:\n\n- $S_{1}=\\{1,3,5,7,\\dots,2^{k}-1\\}$ consists of all numbers in $T$ whose least significant binary digit is $1$.\n- $S_{2}=\\{2,3,6,7,\\dots,2^{k}-2,2^{k}-1\\}$ consists of all numbers in $T$ whose second least significant binary digit is $1$.\n- More generally, $S_{i}$ consists of all numbers in $T$ whose $i$-th least significant binary digit is $1$.\n\nWithout loss of generality, Alice answers all of these \"yes\" (the other cases are similar). Among the last $k+1$ answers at least one must be truthful, and the number $2^{k}$ (having zeros in all relevant digits) does not appear in any of $S_{0},\\dots,S_{k}$ and is therefore ruled out.\n\nThus, in this way Bob can repeatedly find non-possibilities for $x$ (and then relabel the remaining candidates $1,\\dots,N-1$) until he arrives at a set of at most $2^{k}$ numbers.\n\nPart (b): It suffices to consider $n=\\left\\lceil 1.99^{k}\\right\\rceil$ and $N=n+1$ for large $k$. At the $t$-th step Bob asks some question $S_{t}$; we phrase each of Alice's answers in the form \"$x\\notin B_{t}$\", where $B_{t}$ is either $S_{t}$ or its complement. (You may think of these as \"bad sets\"; the idea is to show we can avoid having any number appear in $k+1$ consecutive bad sets, preventing Bob from ruling out any numbers.)\n\nMain idea: for every number $1\\le x\\le N$, at time step $t$ we define its *weight* to be\n\\[\nw(x)=1.998^{e}\n\\]\nwhere $e$ is the largest integer such that $x\\in B_{t-1}\\cap B_{t-2}\\cap\\dots\\cap B_{t-e}$.\n\n**Claim.** Alice can ensure the total weight never exceeds $1.998^{k+1}$ for large $k$.\n\n**Proof.** Let $W_{t}$ denote the sum of weights after the $t$-th question. We have $W_{0}=N<1000N$. We will prove inductively that $W_{t}<1000N$ always.\n\nAt time $t$, Bob specifies a question $S_{t}$. Alice chooses $B_{t}$ as whichever of $S_{t}$ or $\\overline{S_{t}}$ has the smaller total weight, hence at most $W_{t}/2$. The weights of the elements in $B_{t}$ increase by a factor of $1.998$, while the weights of the elements in $\\overline{B_{t}}$ all reset to $1$. So the new total weight after time $t$ is\n\\[\nW_{t+1}\\le 1.998\\cdot\\frac{W_{t}}{2}+ \\#\\overline{B_{t}}\\le 0.999\\,W_{t}+N.\n\\]\nThus, if $W_{t}<1000N$, then $W_{t+1}<1000N$.\n\nTo finish, note that $1000N=1000\\left(n+1\\right)\\le 1000\\left(1.99^{k}+2\\right)<1.998^{k+1}$ for large $k$.\n\nIn particular, no individual number can have weight $1.998^{k+1}$. Hence for every time step $t$ we have\n\\[\nB_{t}\\cap B_{t+1}\\cap\\dots\\cap B_{t+k}=\\varnothing.\n\\]\nThen once Bob stops, if he declares a set of $n$ positive integers and $x$ is an integer Bob did not choose, Alice's question history is consistent with $x$ being Alice's number, because among any $k+1$ consecutive answers she claimed that $x\\in\\overline{B_{t}}$ for some $t$ in that range.", "ref_answer": "", "grading_guidelines": "(Partial) 1. For part (a), gave a correct strategy/argument showing how to eliminate at least one candidate number using the “among any k+1 answers one is true” condition (e.g. repeating one query k+1 times to force a truthful answer and hence rule out a value). 2. For part (a), used binary-digit queries (or an equivalent coding idea) to argue that from k+1 consecutive answers one can exclude at least one of 2^k+1 numbers, leading to a reduction toward a final candidate set of size ≤2^k. 3. For part (b), introduced a quantitative invariant (weights/potential) and the idea that Alice answers by choosing the lighter of S_t and its complement to keep the invariant bounded. (Almost) 1. Part (a) is complete, and part (b) has the full weight strategy with a correct inequality of the form W_{t+1}≤cW_t+N (c<1) implying W_t=O(N), but the write-up fails to justify the final comparison O(N)<1.998^{k+1} for large k (or uses incorrect constants while the method would work with adjusted bases). 2. Part (b) correctly derives that no element can lie in k+1 consecutive bad sets (hence Bob cannot rule out any number), but does not clearly explain why this implies that after Bob outputs any set X of size ≤n, some x∉X remains consistent with all answers (missing the final consistency/quantifier step). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2011-P2", "category": "Operations and Strategies", "id": "IMO2011_2", "query": "Let $\\mathcal{S}$ be a finite set of at least two points in the plane. Assume that no three points of $\\mathcal S$ are collinear. A *windmill* is a process that starts with a line $\\ell$ going through a single point $P \\in \\mathcal S$. The line rotates clockwise about the *pivot* $P$ until the first time that the line meets some other point belonging to $\\mathcal S$. This point, $Q$, takes over as the new pivot, and the line now rotates clockwise about $Q$, until it next meets a point of $\\mathcal S$. This process continues indefinitely.\n\nShow that we can choose a point $P$ in $\\mathcal S$ and a line $\\ell$ going through $P$ such that the resulting windmill uses each point of $\\mathcal S$ as a pivot infinitely many times.", "ref_solution": "Let $|\\mathcal S| = n+1$. Orient the line $\\ell$ in some direction, and color the plane such that its left half is red and its right half is blue. \n\nThe critical observation is that the number of points of $\\mathcal{S}$ on the red side of $\\ell$ does not change, nor does the number of points on the blue side, except at the brief moments when $\\ell$ contains two points. To see this, consider what happens when the rotating line $\\ell$ meets a new point $Q \\in \\mathcal{S}$. Because no three points of $\\mathcal{S}$ are collinear, $\\ell$ contains exactly two points at this moment: the old pivot $P$ and the new pivot $Q$. As the line continues its clockwise rotation around $Q$, the point $P$ leaves the line and enters the half-plane that $Q$ previously occupied, while $Q$ takes over as the pivot. Consequently, the net number of points on the red side and the blue side of the oriented line $\\ell$ remains strictly invariant throughout the entire process.\n\nWe can pick the initial configuration of the point $P$ and the line $\\ell$ so that there are exactly $\\lfloor n/2 \\rfloor$ points on the red side and $\\lceil n/2 \\rceil$ points on the blue side. As the windmill process continues indefinitely, the line $\\ell$ eventually completes a full $180^\\circ$ rotation. At this point, the line has reversed its orientation, meaning the red and blue sides have effectively switched positions in the plane. \n\nBecause the counts of points on the red and blue sides are invariant, and the red and blue half-planes have swapped regions in the plane, the windmill must have passed through every point of $\\mathcal{S}$ during this $180^\\circ$ rotation. If a point had not been passed through, it would have remained on the same color side of the oriented line, which corresponds to the opposite side of the unoriented line in the plane—a contradiction. \n\nTherefore, the line $\\ell$ passes through every point of $\\mathcal{S}$ during any $180^\\circ$ rotation. Since the process continues indefinitely, the line undergoes infinitely many such rotations, and thus the windmill uses each point of $\\mathcal{S}$ as a pivot infinitely many times.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Introduced an oriented line and a two-coloring of the half-planes, and proved the key invariant that the numbers of points of S on each side of the oriented line stay constant throughout the windmill (using that at each switch exactly two points lie on the line and the old pivot moves to the other side). 2. Explained how to choose the initial pivot P and direction of ℓ so that the invariant side-counts are balanced (e.g. ⌊n/2⌋ on one side and ⌈n/2⌉ on the other), by rotating a line through a fixed point and applying a continuity/step argument. 3. Proved that after a total rotation of 180° the oriented line has reversed, so the two colored half-planes have swapped, and derived at least one nontrivial consequence toward covering all points (e.g. a point cannot stay on the same colored side for the entire 180° rotation). (Almost) 1. Gave the invariant side-count argument and the 180° reversal idea, and concluded that every point must be met/pivoted during each 180° rotation, but left a small gap in justifying why a point not used as a pivot would force an impossible change in the invariant counts. 2. Proved all main steps but did not fully justify existence of the initial configuration with side counts ⌊n/2⌋ and ⌈n/2⌉ (e.g. asserted without proof that such a line through some P exists). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2010-P5", "category": "Operations and Strategies", "id": "IMO2010_5", "query": "Each of the six boxes $B_1$, $B_2$, $B_3$, $B_4$, $B_5$, $B_6$ initially contains one coin. \nThe following two types of operations are allowed:\n\\begin{enumerate}\n \\item Choose a non‑empty box $B_j$, $1\\le j\\le 5$, remove one coin from $B_j$ and add two coins to $B_{j+1}$;\n \\item Choose a non‑empty box $B_k$, $1\\le k\\le 4$, remove one coin from $B_k$ and swap the contents (possibly empty) of the boxes $B_{k+1}$ and $B_{k+2}$.\n\\end{enumerate}\nDetermine if there exists a finite sequence of operations of the allowed types, such that the five boxes $B_1$, $B_2$, $B_3$, $B_4$, $B_5$ become empty, while box $B_6$ contains exactly $2010^{2010^{2010}}$ coins.", "ref_solution": "Yes, such a finite sequence exists.\n\nFirst, we apply the allowed operations as follows:\n\\begin{align*}\n (1,1,1,1,1,1) &\\to (0,3,1,0,3,1) \\to (0,0,7,0,0,7) \\\\\n &\\to (0,0,6,2,0,7) \\to (0,0,6,1,2,7) \\to (0,0,6,1,0,11) \\\\\n &\\to (0,0,6,0,11,0) \\to (0,0,5,11,0,0).\n\\end{align*}\nHenceforth, we ignore boxes $B_1$ and $B_2$, looking at just the last four boxes; so we write the current position as $(5,11,0,0)$.\n\nWe prove a lemma:\n\\begin{lemma*}\n Let $k \\ge 0$ and $n > 0$. From $(k,n,0,0)$, we may reach $(k-1,2^n,0,0)$.\n\\end{lemma*}\n\\begin{proof}\n Working with only the last three boxes for now,\n \\begin{align*}\n (n,0,0) &\\to (n-1, 2, 0) \\to (n-1, 0, 4) \\\\\n &\\to (n-2, 4, 0) \\to (n-2, 0, 8) \\\\\n &\\to (n-3, 8, 0) \\to (n-3, 0, 16) \\\\\n &\\to \\dots \\to (1, 2^{n-1}, 0) \\to (1, 0, 2^n) \\to (0, 2^n, 0).\n \\end{align*}\n Finally, we have $(k,n,0,0) \\to (k,0,2^n,0) \\to (k-1,2^n, 0,0)$.\n\\end{proof}\n\nNow from $(5,11,0,0)$ we go as follows:\n\\begin{align*}\n (5,11,0,0) &\\to (4, 2^{11}, 0, 0)\n \\to \\left(3, 2^{2^{11}}, 0, 0\\right)\n \\to \\left(2, 2^{2^{2^{11}}}, 0, 0\\right) \\\\\n &\\to \\left( 1, 2^{2^{2^{2^{11}}}}, 0, 0\\right)\n \\to \\left(0, 2^{2^{2^{2^{2^{11}}}}}, 0, 0\\right).\n\\end{align*}\nLet $A = 2^{2^{2^{2^{2^{11}}}}} > 2010^{2010^{2010}} = B$. Then by using the second type of operation repeatedly on the fourth box (i.e., throwing away several coins by swapping the empty $B_5$ and $B_6$), we go from $(0,A,0,0)$ to $(0,B/4,0,0)$. From there we reach $(0,0,0,B)$.", "ref_answer": "Yes, such a finite sequence exists", "grading_guidelines": "(Partial) 1. Found and correctly justified a nontrivial reachable configuration that simplifies the state, e.g. exhibited a valid sequence of moves from (1,1,1,1,1,1) to a state with B1=B2=0 (such as (0,0,5,11,0,0)), and explained why one may then focus on the last four boxes. 2. Proved a key “exponentiation step” of the form: from a state (k,n,0,0) (in the last four boxes) one can reach (k−1,2^n,0,0), by explicitly giving/justifying the repeated use of move type 1 to create powers of 2 and move type 2 to swap empties. 3. Established a correct reduction that once a state (0,m,0,0) is reached, one can transfer all coins into B6 and empty the other boxes (e.g. (0,m,0,0) -> (0,0,0,4m) or an equivalent final-transfer mechanism), even if the exact target value is not yet matched. (Almost) 1. Gave the full construction idea: reach a state (0,A,0,0) with A a power tower 2^(2^(…)) larger than 2010^(2010^2010), then ‘discard’ a controlled amount via swaps with an empty box, and finally transfer to (0,0,0,2010^(2010^2010)); but left a localized gap in justifying the discard step (e.g. why repeated type-2 moves can reduce A to the desired value or to B/4). 2. Successfully implemented the iterative lemma (k,n,0,0)->(k−1,2^n,0,0) enough times to produce a tower exceeding the target, and described the final adjustment and transfer to B6, but made a minor arithmetic/divisibility slip (e.g. a missing factor 4 in the last transfer) while the rest of the argument is correct. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2009-P6", "category": "Existence and Construction", "id": "IMO2009_6", "query": "Let $a_1$, $a_2$, \\dots, $a_n$ be distinct positive integers and let $M$ be a set of $n-1$ positive integers not containing $s = a_1 + \\dots + a_n$. A grasshopper is to jump along the real axis, starting at the point $0$ and making $n$ jumps to the right with lengths $a_1$, $a_2$, \\dots, $a_n$ in some order. Prove that the order can be chosen in such a way that the grasshopper never lands on any point in $M$.", "ref_solution": "We prove the statement by induction on $n$. We may assume that the set of mines $M$ has exactly $n-1$ elements (if it has fewer, we can arbitrarily add positive integers to $M$, avoiding $s$, until $|M| = n-1$). \n\n**Base cases:** For $n=1$, there are 0 mines, so the single jump $a_1$ trivially avoids all mines. For $n=2$, the jumps are $a_1 < a_2$, and there is 1 mine. The intermediate points for the two possible jump orders are $a_1$ and $a_2$. Since $a_1 \\neq a_2$, they cannot both be the mine, so at least one order is valid.\n\n**Inductive step:** Assume the statement holds for any $k < n$ jumps and any set of at most $k-1$ mines. Let the $n$ jumps be $a_1 < a_2 < \\dots < a_n$. Let $M$ be the set of $n-1$ mines, and $s = a_1 + \\dots + a_n \\notin M$. Let $x = s - a_n$. We consider four cases, based on whether $x \\in M$ and whether there is a mine in $M$ strictly to the right of $x$.\n\n**Case 1:** $x \\notin M$, and there is a mine past $x$.\nSince there is at least one mine strictly greater than $x$, the interval $[0, x]$ contains at most $n-2$ mines. The sum of the $n-1$ jumps $a_1, \\dots, a_{n-1}$ is $x$. By the induction hypothesis for these $n-1$ jumps, there is a valid sequence of jumps that reaches $x$ without landing on any mine in $[0, x]$. From $x$, the final jump is $a_n$, reaching $s$. Since $x \\notin M$ and $s \\notin M$, this sequence avoids all mines.\n\n**Case 2:** $x \\notin M$, and there are no mines to the right of $x$.\nLet $m$ be the maximal mine in $M$. Since there are no mines to the right of $x$, we have $m < x$. By the induction hypothesis applied to the $n-1$ jumps $a_1, \\dots, a_{n-1}$ and the $n-2$ mines in $M \\setminus \\{m\\}$, there is a sequence of these jumps ending at $x$ that avoids all mines in $M \\setminus \\{m\\}$. \nIf this sequence also avoids $m$, we can just append $a_n$ and we are done. Otherwise, let the sequence of these $n-1$ jumps be $b_1, \\dots, b_{n-1}$, with positions $p_j = \\sum_{r=1}^j b_r$. Suppose the path hits $m$ at step $k$, so $p_k = m$. We then swap the hop $b_k$ with the final jump $a_n$. \nThe new sequence of jumps is $b_1, \\dots, b_{k-1}, a_n, b_{k+1}, \\dots, b_{n-1}, b_k$. Let $p'_j$ be the new positions. For $j < k$, $p'_j = p_j$, which avoids $M$. For $j = k$, $p'_k = p_{k-1} + a_n = p_k - b_k + a_n = m - b_k + a_n$. Since $a_n$ is the strictly largest jump, $a_n > b_k$, so $p'_k > m$. For $j > k$, $p'_j = p_j - b_k + a_n > p_j \\ge m$. Since $m$ is the maximal mine, all new positions $p'_j$ for $j \\ge k$ are strictly greater than $m$ and thus avoid $M$. The final position is $s \\notin M$. This modified sequence avoids all mines.\n\n**Case 3:** $x \\in M$, and there are no mines to the right of $x$.\nIn this case, $x$ is the maximal mine, so we can repeat the previous case with $m = x$. By the induction hypothesis on $M \\setminus \\{x\\}$, there is a sequence of jumps $b_1, \\dots, b_{n-1}$ that reaches $x$ avoiding $M \\setminus \\{x\\}$. Since the sequence ends at $x \\in M$, it hits $x$ at the very last step $k = n-1$. We swap $b_{n-1}$ with $a_n$. The new positions are $p'_j = p_j$ for $j \\le n-2$, which avoid $M$. The position $p'_{n-1} = p_{n-2} + a_n = x - b_{n-1} + a_n > x$. Since $x$ is the maximal mine, $p'_{n-1} \\notin M$, and the final position is $s \\notin M$.\n\n**Case 4:** $x \\in M$, and there is a mine past $x$.\nWe claim there exists an integer $1 \\le i \\le n-1$ such that neither $s-a_i$ nor $y = s-a_i-a_n$ is a mine. For each $1 \\le i \\le n-1$, consider the pair of points $P_i = \\{s-a_i, s-a_i-a_n\\}$. Since $a_i < a_n$, we have $s-a_i > s-a_n = x$ and $s-a_i-a_n < s-a_n = x$. Thus, any single mine can belong to at most one pair $P_i$. Since $x \\in M$ belongs to no pair $P_i$, the remaining $n-2$ mines in $M$ can intersect at most $n-2$ of the pairs $P_i$. Since there are $n-1$ pairs, there must exist at least one index $i \\in \\{1, \\dots, n-1\\}$ such that $P_i \\cap M = \\emptyset$. \nChoose such an $i$, and let $y = s - a_i - a_n$. We will use the $n-2$ jumps $\\{a_1, \\dots, a_n\\} \\setminus \\{a_i, a_n\\}$ to reach $y$. Since $x \\in M$ and the mine past $x$ are both strictly greater than $y$ (as $y < x$), there are at least two mines to the right of $y$. Thus, the number of mines in $(0, y]$ is at most $(n-1) - 2 = n-3$. By the induction hypothesis applied to these $n-2$ jumps and the mines in $(0, y]$, there is a valid sequence to reach $y$ avoiding all mines. From $y$, the grasshopper jumps $a_n$ to reach $y + a_n = s - a_i$. Since $P_i \\cap M = \\emptyset$, $s-a_i \\notin M$. Finally, from $s-a_i$, the grasshopper jumps $a_i$ to reach $s \\notin M$. This sequence avoids all mines, completing the induction.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Set up induction on n, including the reduction to |M|=n−1 by adding extra mines different from s, and verified the base cases n=1,2. 2. Gave the key reduction using the largest jump a_n and x=s−a_n, and correctly solved at least one of the easy subcases (e.g. x∉M and there is a mine >x, so apply induction to a_1,…,a_{n−1} up to x and then jump a_n). 3. In the “no mines to the right of x” situation, used the swap idea (replace the jump landing on the maximal mine m with a_n) and correctly argued that all subsequent partial sums increase past m and hence avoid all mines. (Almost) 1. Presented a full induction with the x=s−a_n split into cases, but the swap argument in Case 2/3 is not fully justified (e.g. did not clearly show all modified partial sums stay >m, or overlooked checking that the swapped-in position cannot equal another mine). 2. Handled Cases 1–3 correctly, and in Case 4 proposed the correct pigeonhole pairing idea with P_i={s−a_i, s−a_i−a_n}, but left a gap in proving a suitable i exists (e.g. did not justify that a mine cannot belong to two different pairs, or miscounted which mines are excluded). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "IMO-2008-P5", "category": "Counting", "id": "IMO2008_5", "query": "Let $n$ and $k$ be positive integers with $k \\ge n$ and $k-n$ an even number. There are $2n$ lamps labelled $1,2,\\dots,2n$ each of which can be either on or off. Initially all the lamps are off. We consider sequences of steps: at each step one of the lamps is switched (from on to off or from off to on). Let $N$ be the number of such sequences consisting of $k$ steps and resulting in the state where lamps $1$ through $n$ are all on, and lamps $n+1$ through $2n$ are all off. Let $M$ be the number of such sequences consisting of $k$ steps, resulting in the state where lamps $1$ through $n$ are all on, and lamps $n+1$ through $2n$ are all off, but where none of the lamps $n+1$ through $2n$ is ever switched on. Determine $\\frac{N}{M}$.", "ref_solution": "The answer is $2^{k-n}$.\n\nConsider the following map $\\Psi$ from the set of $N$-sequences to the set of $M$-sequences: for each $i \\in \\{1, 2, \\dots, n\\}$, change every instance of a switch of lamp $n+i$ to a switch of lamp $i$. (For example, suppose $k=9$ and $n=3$; then the sequence $1, 4, 4, 2, 2, 5, 2, 5, 3$ maps to $1, 1, 1, 2, 2, 2, 2, 2, 3$.)\n\nTo see that this map is well-defined, note that for any $N$-sequence, the total number of times lamps $i$ and $n+i$ are switched is $a_i + b_i$, where $a_i$ is odd (since lamp $i$ ends up on) and $b_i$ is even (since lamp $n+i$ ends up off). Thus, the number of times lamp $i$ is switched in the image sequence is $c_i = a_i + b_i$, which is the sum of an odd and an even integer, and hence is odd. This means that in the image sequence, lamp $i$ ends up on. Furthermore, lamps $n+1$ through $2n$ are never switched in the image sequence, meaning they remain off. Therefore, the image is indeed an $M$-sequence. The map is clearly surjective, as any $M$-sequence is its own image.\n\n**Claim:** Every $M$-sequence has exactly $2^{k-n}$ pre-images under $\\Psi$.\n\n*Proof.* Let an $M$-sequence be given. Suppose that for each $i \\in \\{1, 2, \\dots, n\\}$, there are $c_i$ instances of lamp $i$ being switched in this sequence. As established, $c_i$ must be an odd positive integer because lamp $i$ ends up on. To reconstruct a pre-image under $\\Psi$, we must choose which of the $c_i$ switches of lamp $i$ were originally switches of lamp $n+i$. Since lamp $n+i$ must end up off in the $N$-sequence, it must have been switched an even number of times. Thus, we need to pick an even subset of the $c_i$ switches to change to $n+i$. \n\nSince $c_i \\ge 1$, the number of ways to choose an even subset from a set of size $c_i$ is exactly $2^{c_i-1}$. This choice can be made independently for each $i \\in \\{1, 2, \\dots, n\\}$. Hence, the total number of pre-images for the given $M$-sequence is the product of the number of choices for each $i$:\n\\[\n\\prod_{i=1}^n 2^{c_i-1} = 2^{\\sum_{i=1}^n (c_i - 1)} = 2^{k-n},\n\\]\nwhere we used the fact that the total number of steps is $\\sum_{i=1}^n c_i = k$.\n\nSince every $M$-sequence has exactly $2^{k-n}$ pre-images under $\\Psi$, it follows that $N = 2^{k-n} M$. Therefore, the ratio $\\frac{N}{M}$ is $2^{k-n}$.", "ref_answer": "$2^{k-n}$", "grading_guidelines": "(Partial) 1. Used the parity condition to note that in any valid sequence the number of switches of lamp i (1<=i<=n) is odd, and the number of switches of lamp n+i is even. 2. Defined (or effectively used) the map that replaces every switch of lamp n+i by a switch of lamp i, and checked that the image sequence never switches lamps n+1,...,2n and ends with lamps 1,...,n on. 3. Observed that for a fixed M-sequence with c_i occurrences of lamp i, the number of ways to choose which of these occurrences came from lamp n+i is the number of even-size subsets of {1,...,c_i}. (Almost) 1. Obtained the correct preimage count 2^(c_i-1) for each i and multiplied to get 2^(k-n), but did not clearly justify either independence over i or the identity sum c_i=k. 2. Set up the surjection Psi and the even-subset reconstruction, and concluded N/M=2^(k-n), but left a minor gap in proving that every preimage indeed ends with lamps n+1,...,2n off (i.e., that the chosen subsets must be even and this is sufficient). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USAMO-2025-P6", "category": "Existence and Construction", "id": "USAMO2025_6", "query": "Let $m$ and $n$ be positive integers with $m\\ge n$. There are $m$ cupcakes of different flavors arranged around a circle and $n$ people who like cupcakes. Each person assigns a non‑negative real number score to each cupcake, depending on how much they like the cupcake. Suppose that for each person $P$, it is possible to partition the circle of $m$ cupcakes into $n$ groups of consecutive cupcakes so that the sum of $P$'s scores of the cupcakes in each group is at least $1$. Prove that it is possible to distribute the $m$ cupcakes to the $n$ people so that each person $P$ receives cupcakes of total score at least $1$ with respect to $P$.", "ref_solution": "Arbitrarily pick any one person—call her Pip—and her $n$ arcs (the groups of consecutive cupcakes). The initial idea is to try to apply Hall's Marriage Lemma to match the $n$ people with Pip's arcs (such that each such person is happy with their matched arc, meaning they value it at $\\ge 1$). To that end, construct the obvious bipartite graph $\\mathfrak{G}$ between the $n$ people and the $n$ arcs for Pip, where an edge exists if a person values an arc at $\\ge 1$.\n\nWe now consider the following algorithm, which takes several steps:\n\n- If a perfect matching of $\\mathfrak{G}$ exists, we are done! We simply distribute the cupcakes according to the matching.\n\n- We are probably not that lucky. Per Hall's condition, the lack of a perfect matching means there is a bad set $\\mathcal{B}_1$ of people, who are compatible with fewer than $|\\mathcal{B}_1|$ of the arcs. Then delete $\\mathcal{B}_1$ and the neighbors of $\\mathcal{B}_1$ in the graph, and then try to find a matching on the remaining graph.\n\n- If a matching exists now, terminate the algorithm. Otherwise, that means there is another bad set $\\mathcal{B}_2$ for the remaining graph. We again delete $\\mathcal{B}_2$ and its neighbors (which number fewer than $|\\mathcal{B}_2|$).\n\n- Repeat this process until some perfect matching $\\mathcal{M}$ is possible in the remaining graph, i.e., there are no more bad sets (and then terminate once that occurs).\n\nSince Pip is a universal vertex in $\\mathfrak{G}$ (she values all of her own arcs at $\\ge 1$), it is impossible to delete Pip as part of a bad set. Thus, the algorithm does indeed terminate with a nonempty matching $\\mathcal{M}$.\n\nWe commit to assigning each person in $\\mathcal{M}$ their matched arc (in particular, if there are no bad sets at all, the problem is already solved). Now we finish the problem by induction on $n$ (for the remaining people) by simply deleting the arcs used up by $\\mathcal{M}$.\n\nTo see why this deletion-induction works, consider any particular person Quinn not in $\\mathcal{M}$. By definition, Quinn is not happy with any of the arcs in $\\mathcal{M}$. So when an arc $\\mathcal{A}$ of $\\mathcal{M}$ is deleted, it had value strictly less than $1$ for Quinn, so in particular it could not contain entirely any of Quinn's arcs. Hence at most one endpoint among Quinn's arcs was in the deleted arc $\\mathcal{A}$. When this happens, this causes two arcs of Quinn to merge, and the merged value is\n\\[\n(\\ge 1) + (\\ge 1) - (< 1) > 1\n\\]\nmeaning the induction is OK.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Set up the bipartite graph between the n people and a fixed person’s n consecutive arcs (each arc has value ≥1 for that fixed person), with edges defined by “person values arc ≥1”, and correctly invoked Hall’s theorem as the intended tool. 2. Showed that if a perfect matching from people to these arcs exists then the required distribution follows immediately (give each person their matched arc). 3. Proved the key “deletion preserves feasibility” observation: for a remaining person Q, deleting an arc A with Q(A)<1 cannot completely cover one of Q’s own ≥1 arcs, so at most one endpoint of Q’s arcs lies in A, hence at most two of Q’s arcs merge, and the merged arc has value >1 for Q via (≥1)+(≥1)−(<1)>1. (Almost) 1. Carried out the Hall-based iterative deletion (find a deficient set B, delete B and its neighborhood, repeat) and obtained a nonempty matching, but did not fully justify why the process must terminate with a nonempty matching (e.g. the “fixed person is never deleted” argument is missing or flawed). 2. Completed the matching-plus-induction scheme, but left a local gap in the induction step when removing matched arcs (typically: did not rigorously argue that a deleted arc cannot contain an entire original Q-arc, or did not verify the merged-arc value remains ≥1 for every remaining person). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USAMO-2023-P3", "category": "Existence and Construction", "id": "USAMO2023_3", "query": "Consider an $n$-by-$n$ board of unit squares for some odd positive integer $n$. We say that a collection $C$ of identical dominoes is a maximal grid-aligned configuration on the board if $C$ consists of $\\frac{n^{2}-1}{2}$ dominoes where each domino covers exactly two neighboring squares and the dominoes don't overlap: $C$ then covers all but one square on the board. We are allowed to slide (but not rotate) a domino on the board to cover the uncovered square, resulting in a new maximal grid-aligned configuration with another square uncovered. Let $k(C)$ be the number of distinct maximal grid-aligned configurations obtainable from $C$ by repeatedly sliding dominoes.\n\nFind all possible values of $k(C)$ as a function of $n$.", "ref_solution": "The answer is that \n\\[\nk(C) \\in \\left\\{ 1, 2, \\dots, \\left( \\frac{n-1}{2} \\right)^2 \\right\\} \\cup \\left\\{ \\left( \\frac{n+1}{2} \\right)^2 \\right\\}.\n\\]\n\nIndex the squares by coordinates $(x,y) \\in \\{1,2,\\dots,n\\}^2$. We say a square is special if it is empty or it has the same parity in both coordinates as the empty square.\n\nWe now proceed in two cases. First, consider the case where the special squares have both odd coordinates. \n\nWe construct a directed graph $G = G(C)$ whose vertices are special squares as follows: for each domino on a special square $s$, we draw a directed edge from $s$ to the special square that the domino points to. Thus all special squares have an outgoing edge except the empty cell.\n\nAny undirected connected component of $G$ is acyclic unless the cycle contains the empty square inside it. \n*Proof:* Consider a cycle of $G$; we are going to prove that the number of chessboard cells enclosed is always odd. This can be proven directly by induction, but for theatrical effect, we use Pick's theorem. Mark the center of every chessboard cell on or inside the cycle to get a lattice. The dominoes of the cycle then enclose a polyomino which actually consists of $2 \\times 2$ squares, meaning its area is a multiple of $4$. Hence $B/2+I-1$ is a multiple of $4$, in the notation of Pick's theorem. As $B$ is twice the number of dominoes, and a parity argument on the special squares shows that number is even, it follows that $B$ is also a multiple of $4$. This means $I$ is odd. However, if the empty cell is not inside the cycle, all cells enclosed by the cycle must be covered by dominoes, implying the number of enclosed cells is even. This contradiction shows that any cycle must contain the empty square inside it.\n\nLet $T$ be the connected component containing the empty cell. By the claim, $T$ is acyclic, so it is a tree. Now, notice that all the arrows point along $T$ towards the empty cell, and moving a domino corresponds to flipping an arrow. Therefore, $k(C)$ is exactly the number of vertices of $T$. \n*Proof:* Starting with the underlying tree, the set of possible graphs is described by picking one vertex to be the sink (the empty cell) and then directing all arrows towards it.\n\nThis implies that $k(C) \\le \\left( \\frac{n+1}{2} \\right)^2$ in this case. Equality is achieved if $T$ is a spanning tree of $G$. One example of a way to achieve this is using a snake-like configuration.", "ref_answer": "$k(C) \\in \\{1,2,\\dots,((n-1)/2)^2\\} \\cup \\{((n+1)/2)^2\\}$", "grading_guidelines": "(Partial) 1. Introduced the parity/special-square invariant (e.g. special squares are the empty square plus all squares whose coordinates have the same parity pattern as the empty one), and correctly deduced that only these squares can ever be empty during legal slides. 2. Modeled a configuration by a directed graph on the special squares (each occupied special square has one outgoing edge along its domino toward the next special square), and correctly related a domino slide to reversing one directed edge / changing the sink. 3. Proved a nontrivial structural restriction on the directed graph, e.g. that in any connected component not containing the empty square there can be no directed cycle, or that any directed cycle must enclose the empty square (with a correct parity/area argument). (Almost) 1. Established the main correspondence that the reachable configurations from C are in bijection with choices of the sink within the connected component T of the empty square (so k(C)=|V(T)|), but left a small gap in proving reachability/uniqueness of the sink-forcing process. 2. Proved the correct upper bound k(C)≤((n+1)/2)^2 (via the special-square graph/tree component argument), and essentially derived the set of possible values, but did not fully justify why all sizes 1,2,…,((n−1)/2)^2 are attainable and why the remaining attainable value is exactly ((n+1)/2)^2. 3. Gave correct constructions producing many values of k(C) (including one achieving k(C)=((n+1)/2)^2), but missed or mishandled one boundary case (typically distinguishing whether the empty square’s parity class is the “larger” or “smaller” special set)."}
{"split": "analysis", "source": "USAMO-2023-P4", "category": "Operations and Strategies", "id": "USAMO2023_4", "query": "Positive integers $a$ and $N$ are fixed, and $N$ positive integers are written on a blackboard. Alice and Bob play the following game. On Alice's turn, she must replace some integer $n$ on the board with $n+a$, and on Bob's turn he must replace some even integer $n$ on the board with $n/2$. Alice goes first and they alternate turns. If on his turn Bob has no valid moves, the game ends.\n\nAfter analyzing the $N$ integers on the board, Bob realizes that, regardless of what moves Alice makes, he will be able to force the game to end eventually. Show that, in fact, for this value of $a$ and these $N$ integers on the board, the game is guaranteed to end regardless of Alice's or Bob's moves.", "ref_solution": "For $N=1$, neither player has a choice of which number to operate on: Alice must add $a$ to the single number on the board, and Bob must halve it if it is even. Thus, the sequence of moves is uniquely determined, and any outcome that occurs \"regardless of what moves Alice makes\" trivially occurs \"regardless of Alice's or Bob's moves.\" There is nothing further to prove in this case, so we address $N \\ge 2$ henceforth. \n\nLet $S$ denote the multiset of numbers on the board. We consider two cases based on the 2-adic valuations $\\nu_2(x)$ of the numbers $x \\in S$.\n\n**Case 1:** $\\nu_2(x) < \\nu_2(a)$ for all $x \\in S$.\nIn this case, the game must terminate no matter what either player does. \n*Proof:* On Alice's turn, she replaces some $x$ with $x+a$. Since $\\nu_2(x) < \\nu_2(a)$, the valuation of the new number is $\\nu_2(x+a) = \\min(\\nu_2(x), \\nu_2(a)) = \\nu_2(x)$. Thus, the 2-adic valuation of every number on the board is unchanged by Alice's moves. On Bob's turn, he replaces some even $y$ with $y/2$, which decreases its 2-adic valuation by exactly one. The game ends when no even numbers remain (i.e., every $\\nu_2$ is zero). Since the sum $\\sum_{x \\in S} \\nu_2(x)$ decreases by one on each of Bob's turns and is invariant on Alice's turns, the game will always terminate in exactly $\\sum_{x \\in S} \\nu_2(x)$ of Bob's moves, regardless of the choices made by either player.\n\n**Case 2:** There exists at least one number $x \\in S$ such that $\\nu_2(x) \\ge \\nu_2(a)$.\nIn this case, Alice can cause the game to go on forever, which contradicts the premise that Bob can force the game to end.\n*Proof:* Designate $x$ as the first entry on the board (its value will change over time, but we track this specific position). Alice's strategy is as follows:\n- If $\\nu_2(x) = \\nu_2(a)$, she operates on the first entry, replacing it with $x+a$. Because $x$ and $a$ have the same 2-adic valuation, the new entry satisfies $\\nu_2(x+a) > \\nu_2(a)$.\n- If $\\nu_2(x) > \\nu_2(a)$, she operates on any entry besides the first one. This is always possible since $N \\ge 2$. The value of $x$ remains unchanged, so $\\nu_2(x) > \\nu_2(a)$ still holds.\n\nA double induction shows that this strategy maintains the following invariants: just before each of Bob's turns, $\\nu_2(x) > \\nu_2(a)$ holds; and after each of Bob's turns, $\\nu_2(x) \\ge \\nu_2(a)$ holds. \n- *Before Bob's turn:* At the start of Alice's turn, we assume $\\nu_2(x) \\ge \\nu_2(a)$ (which is true initially). Following her strategy, whether she adds $a$ to $x$ or to another number, the resulting value of $x$ will satisfy $\\nu_2(x) > \\nu_2(a)$. Thus, the condition holds just before Bob's turn.\n- *After Bob's turn:* Bob must halve some even number. If he chooses to halve $x$, its new valuation becomes $\\nu_2(x) - 1$. Since it was strictly greater than $\\nu_2(a)$ before his turn, it is now at least $\\nu_2(a)$. If he halves any other number, $x$ is unchanged, so $\\nu_2(x) > \\nu_2(a) \\ge \\nu_2(a)$. In either scenario, $\\nu_2(x) \\ge \\nu_2(a)$ holds after his turn.\n\nBecause $\\nu_2(x) > \\nu_2(a) \\ge 0$ just before each of Bob's turns, $x$ is always strictly even when it is Bob's turn. In particular, Bob will never run out of legal moves, since halving $x$ is always legal. Thus, the game continues indefinitely.\n\nSince Case 2 allows Alice to force an infinite game, it contradicts the given condition that Bob can force the game to end. Therefore, Case 1 must hold, and the game is guaranteed to end regardless of either player's moves.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Introduced the 2-adic valuation \\(\\nu_2\\) and proved the key fact: if \\(\\nu_2(x)<\\nu_2(a)\\), then \\(\\nu_2(x+a)=\\nu_2(x)\\). 2. In the regime \\(\\nu_2(x)<\\nu_2(a)\\) for all board entries, defined a monovariant such as \\(\\sum_{x\\in S}\\nu_2(x)\\) and showed it decreases by exactly 1 on each of Bob’s moves and is unchanged on Alice’s moves, implying termination. 3. In the regime where some entry satisfies \\(\\nu_2(x)\\ge \\nu_2(a)\\), gave a correct construction/strategy idea for Alice to keep at least one always-even number available for Bob (e.g. track one fixed position and try to keep its \\(\\nu_2\\) large), even if not fully justified. (Almost) 1. Correctly split into the two valuation cases and proved Case 1 (all \\(\\nu_2(x)<\\nu_2(a)\\)) implies the game ends regardless of play, but did not clearly explain why this is the only possible case under the hypothesis. 2. Correctly described Alice’s infinite-play strategy in Case 2 and argued Bob always has a move, but left a localized gap in the induction/invariants (e.g. why \\(\\nu_2(x+a)>\\nu_2(a)\\) when \\(\\nu_2(x)=\\nu_2(a)\\), or why Alice can always play off the tracked entry when needed). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USAMO-2023-P5", "category": "Existence and Construction", "id": "USAMO2023_5", "query": "Let $n\\ge 3$ be an integer. We say that an arrangement of the numbers $1,2,\\dots,n^{2}$ in an $n\\times n$ table is *row‑valid* if the numbers in each row can be permuted to form an arithmetic progression, and *column‑valid* if the numbers in each column can be permuted to form an arithmetic progression.\n\nFor what values of $n$ is it possible to transform any row‑valid arrangement into a column‑valid arrangement by permuting the numbers in each row?", "ref_solution": "**Answer:** $n$ is prime only.\n\n**Proof for $n$ prime:** \nSuppose $n = p$. In an arithmetic progression with $p$ terms, either every term has a different residue modulo $p$ (if the common difference is not a multiple of $p$), or all of the residues coincide (when the common difference is a multiple of $p$).\n\nConsider the multiples of $p$ in a row-valid table; there is either exactly $1$ or $p$ such multiples per row. As there are $p$ such numbers in total, there are two cases. \nIf all the multiples of $p$ are in the same row, then the common difference in each row is a multiple of $p$. In fact, the common difference must be exactly $p$ for size reasons. In other words, up to permutation, the rows consist of numbers that are congruent to a single value $k \\pmod p$ in some order. This arrangement is obviously column-valid because we can permute the elements such that the $k$-th column contains exactly $\\{(k-1)p+1, (k-1)p+2, \\dots, kp\\}$. \nAlternatively, if all the multiples of $p$ are in different rows, then it follows that each row contains every residue modulo $p$ exactly once. Thus, we can permute the rows to a column-valid arrangement by ensuring the $k$-th column contains all the numbers congruent to $k \\pmod p$.\n\n**Counterexample for $n$ composite:** \nLet $p$ be any prime divisor of $n$. Construct the table as follows. Row $1$ contains the numbers $1$ through $n$. Rows $2$ through $p+1$ contain the numbers from $p+1$ to $np+n$, partitioned into arithmetic progressions with a common difference of $p$. The rest of the rows contain the remaining numbers in reading order.\n\nAssume for the sake of contradiction that the rows may be permuted to obtain a column-valid arrangement. Then the $n$ columns must be arithmetic progressions whose smallest element is in the interval $[1,n]$ and whose largest element is in the interval $[n^2-n+1, n^2]$. These two elements must be congruent modulo $n-1$. In particular, the column containing $2$ must end with $n^2-n+2$. Hence, in that column, the common difference must be exactly $n$. However, $n+2$ and $2n+2$ are in the same row, which is a contradiction.", "ref_answer": "$n$ is prime only", "grading_guidelines": "(Partial) 1. For prime n=p, proved the key modular fact about p-term arithmetic progressions: if the common difference is not divisible by p then the p terms give all residues mod p exactly once, and if it is divisible by p then all terms are congruent mod p. 2. For prime n=p, deduced the dichotomy for a row-valid p×p table: each row contains either exactly 1 multiple of p or exactly p multiples of p; hence either all multiples of p lie in one row, or they lie in p different rows. 3. For composite n, constructed (or clearly outlined) a specific row-valid arrangement using a prime divisor p of n that is intended to obstruct any row-permutations into a column-valid table (e.g., by forcing certain pairs like n+2 and 2n+2 to lie in the same row while a column argument would require common difference n). (Almost) 1. Correctly solved the prime case: in each of the two cases for the distribution of multiples of p, gave an explicit row-permutation rule producing columns that are arithmetic progressions (e.g., columns grouped by residue classes mod p), but left a minor verification gap (such as checking the common difference or endpoints for all columns). 2. Correctly set up the composite counterexample and derived the crucial consequence that the column containing 2 must also contain n^2−n+2 and hence have common difference n, but did not fully justify one localized step (e.g., why the min/max of each column must lie in the first/last n numbers, or why those endpoints must be congruent mod (n−1)). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USAMO-2021-P2", "category": "Graph Theory", "id": "USAMO2021_2", "query": "The Planar National Park is an undirected 3‑regular planar graph (i.e., all vertices have degree $3$). A visitor walks through the park as follows: she begins at a vertex and starts walking along an edge. When she reaches the other endpoint, she turns left. On the next vertex she turns right, and so on, alternating left and right turns at each vertex. She does this until she gets back to the vertex where she started. What is the largest possible number of times she could have entered any vertex during her walk, over all possible layouts of the park?", "ref_solution": "The answer is $3$. \n\nWe consider the trajectory of the visitor as an ordered sequence of turns. A turn is defined by specifying a vertex, the incoming edge, and the outgoing edge. Hence there are six possible turns for each vertex. Given one turn in the sequence, one can reconstruct the entire sequence of turns. This implies already that the trajectory of the visitor, when extended to an infinite sequence, is totally periodic (not just eventually periodic), because there are finitely many possible turns, so some turn must be repeated. So, any turn appears at most once in the period of the sequence, giving a naive bound of $6$ visits to any vertex for the original problem. \n\nHowever, it is impossible for both of the turns $a \\to b \\to c$ and $c \\to b \\to a$ to occur in the same trajectory. If so, then extending the path, we get a forward path $a \\to b \\to c \\to d \\to e \\to \\dotsb$ and a backward path $\\dotsb \\to e \\to d \\to c \\to b \\to a$. Because the walk's rules are deterministic and the alternating left-right turns are symmetric with respect to reversing direction, the two paths traverse the exact same sequence of vertices and edges in opposite directions. We assumed for contradiction that these two paths were part of the same trajectory, yet a single directed trajectory cannot traverse the same cycle in opposite directions; thus, they clearly never meet. This halves the maximum number of possible visits to any vertex, yielding an upper bound of $3$.\n\nIt remains to give a construction showing $3$ can be achieved. There are many valid constructions. One such construction yields the path $C \\to A \\to H \\to I \\to F \\to G \\to D \\to B \\to A \\to H \\to E \\to F \\to G \\to J \\to B \\to A \\to C$, which visits vertex $A$ exactly three times.", "ref_answer": "3", "grading_guidelines": "(Partial) 1. Formalized the walk as a deterministic process on “turn states” (vertex + incoming edge + outgoing edge, 6 per vertex), and deduced the walk is periodic (hence any fixed turn state cannot occur twice before returning). 2. Derived the naive bound that any vertex can be entered at most 6 times, by counting the 6 possible turn states at that vertex. 3. Proved the key restriction that a trajectory cannot contain both turns a→b→c and c→b→a at the same middle vertex b (i.e., the walk cannot use both orientations of the same local passage), and used it to improve the bound (even if not all the way to 3). (Almost) 1. Proved the sharp upper bound 3 by combining (i) periodicity/determinism on turn states with (ii) the impossibility of having both a→b→c and c→b→a in one trajectory, but left a small logical gap in justifying why the “forward” and “backward” extensions cannot intersect/merge into one closed walk. 2. Gave a construction of a 3-regular planar graph and a valid alternating left-right walk that revisits some vertex three times, but did not fully verify one local condition (3-regularity, planarity, or the left/right choices at one vertex). 3. Completed the proof of the upper bound 3, but omitted the existence example (or gave an example that achieves only 2 visits) while the rest of the argument is correct."}
{"split": "analysis", "source": "TSTST-2023-P3", "category": "Existence and Construction", "id": "TSTST2023_3", "query": "Find all positive integers $n$ for which it is possible to color some cells of an infinite grid of unit squares red, such that each rectangle consisting of exactly $n$ cells (and whose edges lie along the lines of the grid) contains an odd number of red cells.", "ref_solution": "We claim that this is possible for all positive integers $n$. Call a positive integer for which such a coloring is possible *good*. To show that all positive integers $n$ are good, we prove the following two statements: \n(i) If $n$ is good and $p$ is an odd prime, then $pn$ is good.\n(ii) For every integer $k \\ge 0$, the number $n=2^k$ is good. \n\nTogether, (i) and (ii) imply that all positive integers are good by prime factorization.\n\n**Proof of (i):**\nWe simply observe that if every rectangle consisting of $n$ cells contains an odd number of red cells, then so must every rectangle consisting of $pn$ cells. Indeed, because $p$ is prime, a rectangle consisting of $pn$ cells must have a dimension (length or width) divisible by $p$ and can thus be subdivided into $p$ disjoint rectangles consisting of $n$ cells. Since the sum of $p$ odd numbers is odd (as $p$ is an odd prime), every coloring that works for $n$ automatically also works for $pn$.\n\n**Proof of (ii):**\nObserve that rectangles with $n=2^k$ cells have $k+1$ possible shapes: $2^m \\times 2^{k-m}$ for $0\\le m \\le k$. For each of these $k+1$ shapes, there exists a coloring with two properties: \n\n1. Every rectangle with $n$ cells and shape $2^m \\times 2^{k-m}$ contains an odd number of red cells. \n2. Every rectangle with $n$ cells and a different shape contains an even number of red cells. \n\nThis can be achieved as follows: assuming the cells are labeled with coordinates $(x, y) \\in \\mathbb{Z}^2$, color a cell red if $x \\equiv 0 \\pmod{2^m}$ and $y \\equiv 0 \\pmod{2^{k-m}}$. \n\nFinally, given these $k+1$ colorings, we can add them up modulo $2$; that is, a cell will be colored red in the final combined coloring if and only if it is red in an odd number of these $k+1$ individual colorings. For any rectangle of $n=2^k$ cells, its shape matches exactly one of the $k+1$ shapes. By the two properties, it contains an odd number of red cells in the corresponding coloring and an even number of red cells in the other $k$ colorings. Because the parity of the number of red cells in a given region under the modulo $2$ sum of colorings is simply the sum of the parities under each individual coloring, every rectangle of $n=2^k$ cells will contain an odd number of red cells overall. Thus, $n=2^k$ is good.", "ref_answer": "all positive integers $n$", "grading_guidelines": "(Partial) 1. Established the odd-prime step: showed that if a coloring works for n then it also works for pn for an odd prime p, by subdividing any pn-cell rectangle into p disjoint n-cell rectangles (using that one side length must be divisible by p). 2. Gave a correct explicit periodic coloring for some power of 2 (e.g. n=2 or n=4), and proved that every rectangle of area n has odd red parity in that case. 3. For n=2^k, described the grid-lattice coloring for a fixed shape 2^m×2^{k-m} (cells with x≡0 mod 2^m and y≡0 mod 2^{k-m}) and correctly computed that rectangles of that shape have odd parity (even if the treatment of other shapes / the final combination is missing). (Almost) 1. Proved that all n are good by combining (i) the closure under multiplication by odd primes and (ii) a construction for n=2^k, but left a small gap in the subdivision argument for pn (e.g. did not justify why one side must be divisible by p). 2. For n=2^k, correctly set up the k+1 shape-specific colorings and the XOR/mod-2 sum, but did not fully justify the parity claim that the “non-matching” shapes contribute an even number of red cells. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "TSTST-2023-P4", "category": "Graph Theory", "id": "TSTST2023_4", "query": "Let $n \\ge 3$ be an integer and let $K_n$ be the complete graph on $n$ vertices. Each edge of $K_n$ is colored either red, green, or blue. Let $A$ denote the number of triangles in $K_n$ with all edges of the same color, and let $B$ denote the number of triangles in $K_n$ with all edges of different colors. Prove that \n\\[\nB \\le 2A + \\frac{n(n-1)}3.\n\\]", "ref_solution": "Consider all unordered pairs of different edges which share exactly one vertex (call these *vees* for convenience). Assign each vee a *charge* of $+2$ if its two edges have the same color, and a charge of $-1$ if its two edges have different colors.\n\nWe compute the total charge of all vees in the graph $K_n$ in two ways.\n\n**Total charge by summing over triangles.** \nNote that each monochromatic triangle contains three vees with edges of the same color, so it has a charge of $3 \\times (+2) = +6$. Each bichromatic triangle contains one vee with edges of the same color and two vees with edges of different colors, so it has a charge of $1 \\times (+2) + 2 \\times (-1) = 0$. Each trichromatic triangle contains three vees with edges of different colors, so it has a charge of $3 \\times (-1) = -3$. Since each vee is contained in exactly one triangle, we obtain that the total charge over all vees is $6A - 3B$.\n\n**Total charge by summing over vertices.** \nWe can also calculate the total charge by examining the centers of the vees. If a vertex has $a$ red edges, $b$ green edges, and $c$ blue edges incident to it, the vees centered at that vertex contribute a total charge of \n\\[\n\\begin{aligned}\n& \\phantom{=}\\;\\; 2\\left[ \\binom a2 + \\binom b2 + \\binom c2\\right] - (ab + ac + bc)\\\\\n& = (a^2 - a + b^2 - b + c^2 - c) - (ab + ac + bc)\\\\\n& = (a^2 + b^2 + c^2 - ab - ac - bc) - (a + b + c).\n\\end{aligned}\n\\] \nSince the total number of edges incident to any vertex in $K_n$ is $a + b + c = n - 1$, this expression simplifies to\n\\[\n(a^2 + b^2 + c^2 - ab - ac - bc) - (n-1).\n\\]\nBecause $a^2 + b^2 + c^2 - ab - ac - bc = \\frac{1}{2}\\left((a-b)^2 + (b-c)^2 + (c-a)^2\\right) \\ge 0$, the total charge contributed by the vees centered at this vertex is at least $-(n-1)$.\n\nSumming this minimum contribution over all $n$ vertices of $K_n$, we find that the total charge is at least $-n(n-1)$.\n\n**Conclusion.** \nComparing the two methods of computing the total charge, we obtain \n\\[\n6A - 3B \\ge -n(n-1).\n\\] \nRearranging this inequality yields\n\\[\n3B \\le 6A + n(n-1) \\iff B \\le 2A + \\frac{n(n-1)}3,\n\\] \nwhich is the desired result.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Introduced the double-counting on unordered pairs of adjacent edges (“vees”), assigning weights (e.g. +2 for same color and −1 for different colors), and correctly computed the contribution of a monochromatic triangle as +6 and a trichromatic triangle as −3 (bichromatic triangles contributing 0). 2. Correctly computed the total charge at a vertex with incident color-degrees (a,b,c) as 2[ C(a,2)+C(b,2)+C(c,2) ] − (ab+ac+bc), and simplified it to (a^2+b^2+c^2−ab−ac−bc) − (n−1). 3. Proved the key inequality a^2+b^2+c^2−ab−ac−bc = 1/2((a−b)^2+(b−c)^2+(c−a)^2) ≥ 0, hence each vertex contributes at least −(n−1) to the charge sum. (Almost) 1. Carried out the vee-charge double count to obtain 6A−3B as the total charge, and derived the lower bound ≥ −n(n−1), but made a minor arithmetic slip when rearranging to the final form B ≤ 2A + n(n−1)/3. 2. Proved the triangle contributions correctly and bounded the vertex-sum correctly, but left a small gap in justifying the correspondence between vees and their counting in triangles (e.g. did not clearly argue that each vee is counted exactly once via its third vertex). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "TSTST-2022-P5", "category": "Operations and Strategies", "id": "TSTST2022_5", "query": "Let $A_1$, \\dots, $A_{2022}$ be the vertices of a regular $2022$-gon in the plane.\nAlice and Bob play a game.\nAlice secretly chooses a line and colors all points in the plane\non one side of the line blue, and all points on the other side of the line red.\nPoints on the line are colored blue,\nso every point in the plane is either red or blue.\n(Bob cannot see the colors of the points.)\n\nIn each round, Bob chooses a point in the\nplane (not necessarily among $A_1$, \\dots, $A_{2022}$)\nand Alice responds truthfully with the color of that point.\nWhat is the smallest number $Q$ for which Bob has a strategy to\nalways determine the colors of points $A_1$, \\dots, $A_{2022}$ in $Q$ rounds?", "ref_solution": "The answer is $22$.\n\nTo prove the lower bound, note that there are $2022\\cdot 2021 + 2 > 2^{21}$ possible colorings. If Bob makes fewer than $22$ queries, then he can only output at most $2^{21}$ possible colorings, which means he is wrong on some coloring.\n\nNow we show Bob can always win in $22$ queries. A key observation is that the set of red points is convex, as is the set of blue points, so if a set of points is all the same color, then their convex hull is all the same color.\n\n**Lemma 1.** Let $B_0, \\dots, B_{k+1}$ be equally spaced points on a circular arc such that the colors of $B_0$ and $B_{k+1}$ differ and are known. Then it is possible to determine the colors of $B_1, \\dots, B_k$ in $\\lceil \\log_2 k \\rceil$ queries.\n\n*Proof.* There exists some $0\\le i\\le k$ such that $B_0, \\dots, B_i$ are the same color and $B_{i+1}, \\dots, B_{k+1}$ are the same color. (If $i<j$ and $B_0$ and $B_j$ were red and $B_i$ and $B_{k+1}$ were blue, then the segment $B_0B_j$ is red and the segment $B_iB_{k+1}$ is blue, but they intersect). Therefore, we can binary search.\n\n**Lemma 2.** Let $B_0, \\dots, B_{k+1}$ be equally spaced points on a circular arc such that the colors of $B_0$, $B_{\\lceil k/2 \\rceil}$, and $B_{k+1}$ are all red and are known. Then at least one of the following holds: all of $B_1, \\dots, B_{\\lceil k/2 \\rceil}$ are red or all of $B_{\\lceil k/2 \\rceil}, \\dots, B_k$ are red. Furthermore, in one query we can determine which one of the cases holds.\n\n*Proof.* The existence part holds for a similar reason to the previous lemma. To figure out which case holds, choose a point $P$ such that all of $B_0, \\dots, B_{k+1}$ lie between the rays $PB_0$ and $PB_{\\lceil k/2 \\rceil}$, and such that $B_1, \\dots, B_{\\lceil k/2 \\rceil-1}$ lie inside the triangle $PB_0B_{\\lceil k/2 \\rceil}$ and $B_{\\lceil k/2 \\rceil+1}, \\dots, B_{k+1}$ lie outside (this point should always exist by looking around the intersection of the lines $B_0B_1$ and $B_{\\lceil k/2 \\rceil-1}B_{\\lceil k/2 \\rceil}$). Then if $P$ is red, all the inside points are red because they lie in the convex hull of the red points $P$, $B_0$, and $B_{\\lceil k/2 \\rceil}$. If $P$ is blue, then all the outside points are red: if $B_i$ were blue for $i > \\lceil k/2 \\rceil$, then the segment $PB_i$ is blue and intersects the segment $B_0B_{\\lceil k/2 \\rceil}$, which is red, a contradiction.\n\nNow the strategy is as follows: Bob picks $A_1$. Without loss of generality, it is red. Now suppose Bob does not know the colors of $\\le 2^k-1$ points $A_i, \\dots, A_j$ with $j-i+1\\le 2^k-1$ and knows the rest are red. I claim Bob can win in $2k-1$ queries. \n\nFirst, if $k=1$, there is one point and he wins by querying the point, so the base case holds. Assume $k>1$. Bob queries $A_{i+\\lceil (j-i+1)/2 \\rceil}$. \n- If it is blue, he finishes in $2 \\lceil \\log_2{\\lceil (j-i+1)/2 \\rceil} \\rceil \\le 2(k-1)$ queries by the first lemma, for a total of $2k-1$ queries. \n- If it is red, he can query one more point and learn some half of $A_i, \\dots, A_j$ that are red by the second lemma, and then he has reduced the problem to the case with $\\le 2^{k-1}-1$ points in two queries, at which point we induct.\n\nInitially, Bob does not know the colors of $2021$ points. Since $2021 \\le 2^{11}-1$, the condition holds for $k=11$. Bob uses $1$ query for $A_1$ and at most $2(11)-1 = 21$ queries for the remaining points, achieving a total of $22$ queries.", "ref_answer": "22", "grading_guidelines": "(Partial) 1. Established the information-theoretic lower bound: there are at least 2022·2021+2 distinct colorings induced by a line, hence Q≥22 since 2022·2021+2>2^21. 2. Proved the convexity/monotonicity property along the polygon: if two vertices on an arc are different colors then along that arc there is a unique “switch index” (equivalently, colors on that arc form one contiguous block of one color followed by the other), justifying a binary-search type approach. 3. Gave a correct subroutine (Lemma 1 type): with endpoints on an arc known to have different colors, determined all intermediate vertex colors in ⌈log2 k⌉ queries via binary search. (Almost) 1. Presented a full 22-query strategy based on the convex-hull argument and the two lemmas (binary search when a midpoint is blue; otherwise one extra query to certify a red half and induct), but left a localized gap in Lemma 2 (existence/construction of the auxiliary point P, or the segment-intersection contradiction). 2. Completed the recursive query count (2k−1 for ≤2^k−1 unknown consecutive vertices, then k=11 for 2021) but made a small off-by-one error in the induction setup or in the final accounting that does not affect the main method. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "TSTST-2021-P7", "category": "Counting", "id": "TSTST2021_7", "query": "Let $M$ be a finite set of lattice points and $n$ be a positive integer. A *mine-avoiding path* is a path of lattice points with length $n$, beginning at $(0,0)$ and ending at a point on the line $x+y=n$, that does not contain any point in $M$. Prove that if there exists a mine-avoiding path, then there exist at least $2^{\\,n-|M|}$ mine-avoiding paths.", "ref_solution": "We prove the statement by induction on $n$. We use $n=0$ as a base case, where there is exactly $1$ path of length $0$, and the statement follows since $1\\ge 2^{-|M|}$. \n\nFor the inductive step, let $n>0$. Since a path of length $n$ beginning at $(0,0)$ and ending on the line $x+y=n$ must consist entirely of steps of the form $(1,0)$ and $(0,1)$, any mine-avoiding path must first pass through either $(1,0)$ or $(0,1)$. By assumption, there exists at least one mine-avoiding path. We consider two cases:\n\n**Case 1:** There exist mine-avoiding paths passing through $(1,0)$ and mine-avoiding paths passing through $(0,1)$.\nBy the inductive hypothesis, there are at least $2^{n-1-|M|}$ mine-avoiding paths of length $n-1$ starting from $(1,0)$, and at least $2^{n-1-|M|}$ mine-avoiding paths of length $n-1$ starting from $(0,1)$. Then the total number of mine-avoiding paths from $(0,0)$ is at least\n$$ 2^{n-1-|M|} + 2^{n-1-|M|} = 2^{n-|M|}. $$\n\n**Case 2:** Only one of $(1,0)$ and $(0,1)$ is on a mine-avoiding path.\nWithout loss of generality, suppose no mine-avoiding path passes through $(0,1)$. Then some element of $M$ must be of the form $(0,k)$ for $1\\le k\\le n$ in order to block the path that moves entirely along the $y$-axis. This element can be ignored for any mine-avoiding path passing through $(1,0)$, since such a path can never return to the $y$-axis. Thus, for paths starting from $(1,0)$, the number of relevant mines is at most $|M|-1$. By the inductive hypothesis, there are at least\n$$ 2^{n-1-(|M|-1)} = 2^{n-|M|} $$\nmine-avoiding paths starting from $(1,0)$. \n\nThis completes the induction step, which solves the problem.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Observed that any length-$n$ path from $(0,0)$ to the line $x+y=n$ uses only steps $(1,0)$ and $(0,1)$, hence every mine-avoiding path must pass through exactly one of $(1,0)$ or $(0,1)$ as its first step. 2. Set up a correct induction on $n$ (including a valid base case) and reduced the counting of mine-avoiding paths of length $n$ to counting mine-avoiding paths of length $n-1$ starting from $(1,0)$ and/or from $(0,1)$. 3. Handled correctly the ‘both first steps possible’ case: showed that if mine-avoiding paths exist through both $(1,0)$ and $(0,1)$ then the counts add and give at least $2^{n-|M|}$. (Almost) 1. Presented the full induction with the correct case split, but in Case 2 did not fully justify the claim that if no mine-avoiding path goes through $(0,1)$ then $M$ must contain some point $(0,k)$ (or the symmetric statement), or did not justify why this mine can be discarded for paths starting with $(1,0)$. 2. Carried out the argument with the correct mine-removal idea in Case 2 (reducing the number of relevant mines by $1$), but made a localized exponent/index mistake (e.g. $2^{n-1-|M|}$ vs $2^{n-(|M|-1)}$) while the structure is otherwise complete. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "TSTST-2020-P1", "category": "Extremal Problems", "id": "TSTST2020_1", "query": "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.", "ref_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.)\n\nIf 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$.\n\nObviously, 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$$ 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). $$\nThus, at most $\\max(ab, bc, ca)$ moves may occur.\n\nTo 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.", "ref_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."}
{"split": "analysis", "source": "TSTST-2020-P9", "category": "Graph Theory", "id": "TSTST2020_9", "query": "Ten million fireflies are glowing in $\\RR^3$ at midnight. Some of the fireflies are friends, and friendship is always mutual. Every second, one firefly moves to a new position so that its distance from each one of its friends is the same as it was before moving. This is the only way that the fireflies ever change their positions. No two fireflies may ever occupy the same point. Initially, no two fireflies, friends or not, are more than a meter away. Following some finite number of seconds, all fireflies find themselves at least ten million meters away from their original positions. Given this information, find the greatest possible number of friendships between the fireflies.", "ref_solution": "In general, we show that when $n \\ge 70$, the maximum number of friendships is $f(n) = \\left\\lfloor \\frac{n^{2}}{3}\\right\\rfloor$. \n\n**Construction:** \nChoose three pairwise parallel lines $\\ell_{A}$, $\\ell_{B}$, $\\ell_{C}$ forming an infinite equilateral triangular prism (with side length larger than $1$). Split the $n$ fireflies among the lines as equally as possible, and say that two fireflies are friends if and only if they lie on different lines. To see that this configuration works, we can move the fireflies as follows: \n- Reflect $\\ell_{A}$ and all fireflies on $\\ell_{A}$ across the plane containing $\\ell_{B}$ and $\\ell_{C}$. \n- Reflect $\\ell_{B}$ and all fireflies on $\\ell_{B}$ across the plane containing $\\ell_{C}$ and $\\ell_{A}$. \n- Reflect $\\ell_{C}$ and all fireflies on $\\ell_{C}$ across the plane containing $\\ell_{A}$ and $\\ell_{B}$.\nBy repeating these reflections, all fireflies can move arbitrarily far without changing the distances to their friends.\n\n**Proof:** \nConsider a valid configuration of fireflies. If there is no $4$-clique of friends, then by Turán's theorem, there are at most $f(n)$ pairs of friends. \n\nLet $g(n)$ be the maximum number of friendships given that there exist four pairwise friends (say $a$, $b$, $c$, $d$). Note that for a firefly to move, all its friends must be coplanar. We cannot have four coplanar fireflies which are pairwise friends; if we did, none of them could move (unless three are collinear, in which case they also cannot move). We claim there are at most $12$ fireflies $e$ which are friends with at least three of $a$, $b$, $c$, $d$.\n\nFirst, denote by $A$, $B$, $C$, $D$ the locations of fireflies $a$, $b$, $c$, $d$. These four positions change over time as fireflies move, but the tetrahedron $ABCD$ always has a fixed shape, and we will take this tetrahedron as our reference frame for the remainder of the proof. Without loss of generality, assume that $e$ is friends with $a$, $b$, $c$. Then $e$ will always be located at one of two points $E_{1}$ and $E_{2}$ relative to $ABC$, such that $E_{1}ABC$ and $E_{2}ABC$ are two congruent tetrahedrons with fixed shape. We note that points $D$, $E_{1}$, and $E_{2}$ are all different: clearly $D \\neq E_{1}$ and $E_{1} \\neq E_{2}$.\n\nConsider the moment when firefly $a$ moves. Its friends must be coplanar at that time, so one of $E_{1}, E_{2}$ must lie in the plane $BCD$. Similar reasoning holds for the planes $ACD$ and $ABD$ when $b$ and $c$ move. So, without loss of generality, $E_{1}$ lies on both planes $BCD$ and $ACD$. Then $E_{1}$ lies on the line $CD$, and $E_{2}$ lies in the plane $ABD$. This uniquely determines the pair $(E_{1},E_{2})$ relative to $ABCD$: $E_{1}$ is the intersection of the line $CD$ with the reflection of the plane $ABD$ across the plane $ABC$, and $E_{2}$ is the intersection of the plane $ABD$ with the reflection of the line $CD$ across the plane $ABC$.\n\nAccounting for the symmetric choices, there are at most $12$ possibilities for the set $\\{E_{1},E_{2}\\}$, and thus at most $12$ possibilities for $E$. Therefore, the number of friendships with exactly one endpoint in $\\{a, b, c, d\\}$ is at most $(n-16)\\cdot 2 + 12\\cdot 3 = 2n + 4$. Removing these four fireflies gives the recurrence\n\\[\ng(n) \\le 6 + (2n+4) + \\max\\{f(n-4),\\, g(n-4)\\}.\n\\]\n\nWhen $n \\ge 24$, we have $(2n+10) + f(n-4) \\le f(n)$, so\n\\[\ng(n) \\le \\max\\{f(n),\\, (2n+10) + g(n-4)\\}\n\\]\nfor all $n \\ge 24$. By iterating the above inequality, we obtain\n\\[\ng(n) \\le \\max\\Big\\{f(n),\\; (2n+10) + (2(n-4)+10) + \\dots + (2(n-4r)+10) + g(n-4r-4)\\Big\\},\n\\]\nwhere $r$ satisfies $n-4r-4 < 24 \\le n-4r$. Evaluating the sum yields\n\\begin{align*}\n(2n+10) + (2(n-4)+10) + \\dots + (2(n-4r)+10) + g(n-4r-4)\n&= (r+1)(2n-4r+10) + g(n-4r-4) \\\\\n&\\le \\Big(\\frac{n}{4} - 5\\Big)(n+37) + \\binom{24}{2}.\n\\end{align*}\n\nThis quadratic bound is strictly less than $f(n) = \\left\\lfloor \\frac{n^{2}}{3}\\right\\rfloor$ for $n \\ge 70$. Since the initial number of fireflies is $n = 10^7 \\ge 70$, the maximum possible number of friendships is exactly $f(10^7) = \\left\\lfloor \\frac{10^{14}}{3}\\right\\rfloor$, which concludes the solution.", "ref_answer": "\\(f(n) = \\lfloor \\frac{n^2}{3} \\rfloor\\)", "grading_guidelines": "(Partial) 1. Gave the extremal-graph bound for the no-$K_4$ case, i.e. correctly applied Turán’s theorem to deduce that if the friendship graph contains no $4$-clique then the number of friendships is at most \\(\\lfloor n^2/3\\rfloor\\). 2. Provided a correct construction achieving \\(\\lfloor n^2/3\\rfloor\\) friendships (e.g. partition into three parts and make all cross-edges), together with a geometrically valid motion rule showing the configuration can move arbitrarily far while keeping all friend-distances fixed. 3. Established the key geometric constraint: when a firefly moves while preserving distances to all its friends, all of its friends must lie in a plane (equivalently, the moving point lies on the intersection of spheres, hence is confined to at most a circle/finite set unless the centers are coplanar). (Almost) 1. Proved the upper bound \\(\\le \\lfloor n^2/3\\rfloor\\) by splitting into the no-$K_4$ case (Turán) and the $K_4$ case via the “few neighbors of a $K_4$”/recurrence argument, but left a localized gap in the $K_4$ case (e.g. did not fully justify the bound on the number of vertices adjacent to 3 of the 4 clique vertices, or the inequality iteration for large $n$). 2. Gave a correct construction with \\(\\lfloor n^2/3\\rfloor\\) friendships and a near-complete verification of the motion to distance \\(\\ge n\\), but omitted checking one necessary condition (e.g. why no collisions occur during the repeated reflections, or why all pairwise initial distances can be kept \\(\\le 1\\) after placing points on the three lines). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "TSTST-2019-P3", "category": "Existence and Construction", "id": "TSTST2019_3", "query": "On an infinite square grid we place finitely many cars, which each occupy a single cell and face in one of the four cardinal directions. Cars may never occupy the same cell. It is given that the cell immediately in front of each car is empty, and moreover no two cars face towards each other (no right‑facing car is to the left of a left‑facing car within a row, etc.). In a move, one chooses a car and shifts it one cell forward to a vacant cell. Prove that there exists an infinite sequence of valid moves using each car infinitely many times.", "ref_solution": "Let $S$ be any rectangle containing all the cars. Partition $S$ into horizontal strips of height $1$, and color them red and green in an alternating fashion. It is enough to prove all the cars may exit $S$.\n\nTo do so, we outline a five-stage plan for the cars:\n\n1. All vertical cars in a green cell may advance one cell into a red cell (or exit $S$ altogether), by the given condition. (This is the only place where the hypothesis about the cell immediately in front of each car being empty is used!)\n2. All horizontal cars on green cells may exit $S$, as no vertical cars occupy green cells.\n3. All vertical cars in a red cell may advance one cell into a green cell (or exit $S$ altogether), as all green cells are empty.\n4. All horizontal cars within red cells may exit $S$, as no vertical cars occupy red cells.\n5. The remaining cars exit $S$, as they are all vertical. \n\nThe solution is complete.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Introduced a bounding rectangle S containing all cars, and reduced the problem to showing that all cars can eventually be moved out of S (then continue moving cars forward forever). 2. Used a striping/coloring of S into alternating horizontal strips (or an equivalent invariant/partition) and stated a staged plan separating vertical moves from horizontal moves based on the colors. 3. Correctly justified one key stage of the plan, e.g. that all vertical cars on one color can advance one step (using the “front cell is empty” condition), or that horizontal cars on a given color can exit because no opposing-direction blockage can occur within a row. (Almost) 1. Presented the full five-stage schedule (move vertical cars from one color to the other, then let horizontal cars on that color exit; repeat with the other color; finish with remaining vertical cars) and proved that after these stages every car exits S, but omitted a localized case check for cars on the boundary of S when “exiting S”. 2. Carried out the coloring/strip argument and proved that each stage is legal and decreases the number of cars inside S, but left a minor gap in explaining why stage 2 (or stage 4) is always possible for all horizontal cars (e.g. why a horizontal car is never blocked by another car during its march to the boundary). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "TSTST-2019-P8", "category": "Counting", "id": "TSTST2019_8", "query": "Let $\\mathcal{S}$ be a set of $16$ points in the plane, no three collinear. Let $\\chi(\\mathcal{S})$ denote the number of ways to draw $8$ line segments with endpoints in $\\mathcal{S}$, such that no two drawn segments intersect, even at endpoints. Find the smallest possible value of $\\chi(\\mathcal{S})$ across all such $\\mathcal{S}$.", "ref_solution": "The answer is $1430$. \n\nIn general, we prove that for a set $\\mathcal{S}$ of $2n$ points, the minimum possible value of $\\chi(\\mathcal{S})$ is the $n$-th Catalan number $C_n = \\frac{1}{n+1}\\binom{2n}{n}$. For $16$ points, this gives $C_8 = \\frac{1}{9}\\binom{16}{8} = 1430$.\n\nFirst, it is a well-known result that if the points of $\\mathcal{S}$ are in convex position (forming the vertices of a convex $2n$-gon), then $\\chi(\\mathcal{S}) = C_n$.\n\nIt remains to prove the lower bound $\\chi(\\mathcal{S}) \\ge C_n$ for any configuration. We proceed by strong induction on $n$, with the base cases $n = 0$ and $n = 1$ being clear. Suppose the statement is proven for $0, 1, \\dots, n$, and consider a set $\\mathcal{S}$ with $2(n+1)$ points.\n\nLet $P$ be a point on the convex hull of $\\mathcal{S}$, and label the other $2n+1$ points $A_1, \\dots, A_{2n+1}$ in order of angle from $P$.\n\nConsider drawing a segment $\\overline{PA_{2k+1}}$ for some $k \\in \\{0, 1, \\dots, n\\}$. This splits the $2n$ remaining points into two sets $\\mathcal{U} = \\{A_1, \\dots, A_{2k}\\}$ and $\\mathcal{V} = \\{A_{2k+2}, \\dots, A_{2n+1}\\}$, with $2k$ and $2(n-k)$ points respectively.\n\nNote that by the choice of $P$ on the convex hull, the ray from $P$ through $A_{2k+1}$ separates $\\mathcal{U}$ and $\\mathcal{V}$. Thus, no segment with endpoints in $\\mathcal{U}$ can intersect a segment with endpoints in $\\mathcal{V}$. By the inductive hypothesis, $\\chi(\\mathcal{U}) \\ge C_k$ and $\\chi(\\mathcal{V}) \\ge C_{n-k}$. Thus, if we draw $\\overline{PA_{2k+1}}$, we have at least $C_k C_{n-k}$ ways to complete the drawing by matching the points within $\\mathcal{U}$ and matching the points within $\\mathcal{V}$. \n\nSince matchings resulting from different choices of $k$ are disjoint (as the point $P$ is matched to a different point $A_{2k+1}$ in each case), we can sum over all choices of $k$ to obtain\n\\[ \\chi(\\mathcal{S}) \\ge \\sum_{k=0}^n C_k C_{n-k} = C_0 C_n + C_1 C_{n-1} + \\dots + C_n C_0 = C_{n+1} \\]\nas desired. This completes the induction.", "ref_answer": "1430", "grading_guidelines": "(Partial) 1. Correctly identified the extremal configuration as 16 points in convex position and stated that the number of noncrossing perfect matchings then equals the Catalan number C8=1430 (with a correct counting argument or citation). 2. Proved a valid decomposition/recurrence for noncrossing matchings by choosing a hull point P and pairing it with an “odd-indexed” point in the angular order, obtaining a sum of products of smaller subproblems (a Catalan-type recurrence), even if not fully justified for all configurations. 3. Established a correct inductive lower-bound step in some nontrivial special case (e.g., when all points are in convex position, or when the chosen separating segment PR guarantees the remaining points split into two noninteracting sets), but did not finish the full general proof. (Almost) 1. Gave the full induction lower bound χ(S)≥Cn for 2n points using a convex-hull point P, but left a localized gap in justifying the separation claim (that points on the two sides of ray/segment PA_{2k+1} cannot produce crossing segments across the split). 2. Completed the Catalan recurrence and summation ∑_{k=0}^n CkC_{n-k}=C_{n+1} and concluded the minimum is C8, but did not clearly argue that the matchings counted for different k are disjoint (i.e., that P is matched to different points). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "TSTST-2018-P2", "category": "Graph Theory", "id": "TSTST2018_2", "query": "In the nation of Onewaynia, certain pairs of cities are connected by one-way roads. Every road connects exactly two cities (roads are allowed to cross each other, e.g., via bridges), and each pair of cities has at most one road between them. Moreover, every city has exactly two roads leaving it and exactly two roads entering it. We wish to close half the roads of Onewaynia in such a way that every city has exactly one road leaving it and exactly one road entering it. Show that the number of ways to do so is a power of $2$ greater than $1$ (i.e. of the form $2^n$ for some integer $n \\ge 1$).", "ref_solution": "In the language of graph theory, we are given a simple directed graph $G$ such that every vertex has in-degree $2$ and out-degree $2$. We seek the number of spanning sub-digraphs of $G$ in which every vertex has in-degree $1$ and out-degree $1$ (i.e., $1$-regular sub-digraphs).\n\n**First Solution (Combinatorial)**\n\nWe construct a simple undirected bipartite graph $\\Gamma$ as follows: the vertex set consists of two copies of $V(G)$, say $V_{\\text{out}}$ and $V_{\\text{in}}$. For $v \\in V_{\\text{out}}$ and $w \\in V_{\\text{in}}$, we add an undirected edge $vw \\in E(\\Gamma)$ if and only if the directed edge $v \\to w$ is in $E(G)$. \n\nSince every vertex in $G$ has out-degree $2$ and in-degree $2$, every vertex in $V_{\\text{out}}$ has degree $2$ in $\\Gamma$, and every vertex in $V_{\\text{in}}$ has degree $2$ in $\\Gamma$. Therefore, $\\Gamma$ is a $2$-regular bipartite graph. \n\nA desired $1$-regular sub-digraph of $G$ corresponds to choosing exactly one outgoing edge and one incoming edge for each vertex in $G$. In $\\Gamma$, this corresponds exactly to choosing a set of edges such that every vertex in $V_{\\text{out}}$ and $V_{\\text{in}}$ has degree $1$ in the chosen set. This is precisely the definition of a perfect matching of $\\Gamma$. \n\nBecause $\\Gamma$ is a $2$-regular graph, it decomposes into a disjoint union of simple cycles. Moreover, since $\\Gamma$ is bipartite, all of these cycles must be of even length. Let $n$ be the number of such cycles. Because $G$ is a simple digraph where every vertex has out-degree $2$, $G$ must contain at least $3$ vertices. Thus, $\\Gamma$ is non-empty, meaning $n \\ge 1$. \n\nFor each even cycle, there are exactly $2$ perfect matchings (formed by taking alternating edges in the cycle). Since the cycles are disjoint, the choices of perfect matchings for each cycle are independent. Thus, the total number of perfect matchings in $\\Gamma$ is $2^n$. Because $n \\ge 1$, this is a power of $2$ greater than $1$, as desired.\n\n**Second Solution (Linear Algebra over $\\mathbb{F}_2$)**\n\nFor each directed edge $e \\in E(G)$, we create an indicator variable $x_e \\in \\mathbb{F}_2$, where $x_e = 1$ if $e$ is kept and $x_e = 0$ if $e$ is closed. \n\nFor each vertex $v \\in V(G)$, we require the following:\n- If $e_1$ and $e_2$ are the two edges leaving $v$, we must keep exactly one, so $x_{e_1} + x_{e_2} \\equiv 1 \\pmod 2$.\n- If $e_3$ and $e_4$ are the two edges entering $v$, we must keep exactly one, so $x_{e_3} + x_{e_4} \\equiv 1 \\pmod 2$.\n\nThis yields a system of linear equations over $\\mathbb{F}_2$. The solutions to this system form an affine subspace of $\\mathbb{F}_2^{|E(G)|}$. Note that the all-ones vector $\\vec{1}$ is a solution to the corresponding homogeneous system, because setting $x_e = 1$ for all $e$ gives $1 + 1 \\equiv 0 \\pmod 2$ for every equation. Thus, if $\\vec{x}$ is a solution to the inhomogeneous system, then $\\vec{x} + \\vec{1}$ is also a solution. \n\nBecause the solution set is an affine subspace, the number of solutions is either zero or a power of two. Furthermore, since the solutions come in natural pairs $\\vec{x}$ and $\\vec{x} + \\vec{1}$ (and $\\vec{x} \\neq \\vec{x} + \\vec{1}$ in $\\mathbb{F}_2$), the dimension of the solution space, if non-empty, is at least $1$. This means the number of solutions is a power of two greater than $1$. To complete the proof, one must show that there is at least one solution (i.e., the solution set is non-empty), which is guaranteed by the combinatorial argument in the first solution.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Constructed the bipartite graph with two copies of the city set (out-copy and in-copy), and observed that choosing one outgoing and one incoming road at each city is equivalent to a perfect matching in this bipartite graph. 2. Proved that the bipartite graph is 2-regular, hence decomposes into a disjoint union of even cycles, and concluded that each cycle contributes exactly 2 alternating perfect matchings. 3. Set up the linear-algebra model over F2 with variables xe for roads and equations xe1+xe2=1 for each pair of outgoing roads and xe3+xe4=1 for each pair of incoming roads at a city, and deduced that the solution set (if nonempty) has size a power of 2. (Almost) 1. Correctly reduced the counting to counting perfect matchings in the associated 2-regular bipartite graph and obtained 2^n from the cycle decomposition, but did not justify that there is at least one cycle (or did not exclude the degenerate empty-graph case). 2. Completed the F2 affine-subspace argument and showed solutions come in pairs x and x+1, but did not prove existence of at least one feasible selection of roads (non-emptiness of the solution set). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "TSTST-2018-P7", "category": "Extremal Problems", "id": "TSTST2018_7", "query": "Let $n$ be a positive integer. A frog starts on the number line at $0$. Suppose it makes a finite sequence of hops, subject to two conditions: (i) The frog visits only points in $\\{1, 2, \\dots, 2^n-1\\}$, each at most once. (ii) The length of each hop is in $\\{2^0, 2^1, 2^2, \\dots\\}$. (The hops may be either direction, left or right.) Let $S$ be the sum of the (positive) lengths of all hops in the sequence. What is the maximum possible value of $S$?", "ref_solution": "We claim the answer is $\\frac{4^n - 1}{3}$. We first prove the upper bound. Notice that the hop sizes must be in $\\{2^0, 2^1, \\dots, 2^{n - 1}\\}$, since the frog must stay within the bounds of $\\{0, 1, \\dots, 2^n-1\\}$ the whole time and the maximum distance between any two points in this set is $2^n-1 < 2^n$. Let $a_i$ be the number of hops of size $2^i$ the frog makes, for $0\\le i\\le n - 1$.\n\n**Claim:** For any $k = 1, \\dots, n$, we have $a_{n-1} + \\dots + a_{n-k} \\le 2^n - 2^{n-k}$.\n\n**Proof:** Let $m = n-k$ and consider the positions modulo $2^m$. Call a jump *small* if its length is at most $2^{m-1}$, and *large* if it is at least $2^m$. A small jump changes the residue class of the frog modulo $2^m$, while a large jump does not. Within each fixed residue class modulo $2^m$, there are exactly $\\frac{2^n}{2^m}$ points in $\\{0, 1, \\dots, 2^n-1\\}$. Since each point is visited at most once, the frog can make at most $\\frac{2^n}{2^m} - 1$ large jumps between points of this same residue class. Summing over all $2^m$ residue classes modulo $2^m$, the total number of large jumps is at most $2^m \\left( \\frac{2^n}{2^m} - 1 \\right) = 2^n - 2^m$. This exactly states that $a_{n-1} + \\dots + a_m \\le 2^n - 2^m$, proving the claim.\n\nNow, the total distance the frog travels is $S = a_0 + 2a_1 + 4a_2 + \\dots + 2^{n-1} a_{n-1}$. We rewrite this using summation by parts. Let $A_k = a_{n-1} + \\dots + a_{n-k}$ for $k = 1, \\dots, n$, with $A_0 = 0$. Then $a_{n-k} = A_k - A_{k-1}$, and we can express $S$ as:\n$$ S = A_n + A_{n-1} \\cdot 2^0 + A_{n-2} \\cdot 2^1 + \\dots + A_1 \\cdot 2^{n-2}. $$\nUsing the bounds $A_k \\le 2^n - 2^{n-k}$, we get:\n$$ S \\le (2^n-2^0) + (2^n-2^1) + 2(2^n-2^2) + \\dots + 2^{n-2}(2^n-2^{n-1}). $$\nEvaluating this sum yields:\n$$ S \\le 2^n - 1 + \\sum_{k=1}^{n-1} 2^{n-k-1}(2^n - 2^{n-k}) $$\n$$ = 2^n - 1 + 2^{2n-1} \\sum_{k=1}^{n-1} 2^{-k} - 2^{2n-1} \\sum_{k=1}^{n-1} 4^{-k} $$\n$$ = 2^n - 1 + 2^{2n-1} \\left(1 - 2^{-(n-1)}\\right) - 2^{2n-1} \\frac{1/4 - 4^{-n}}{3/4} $$\n$$ = 2^n - 1 + 2^{2n-1} - 2^n - \\frac{2^{2n-1} - 2}{3} $$\n$$ = \\frac{3 \\cdot 2^{2n-1} - 2^{2n-1} + 2 - 3}{3} = \\frac{4^n - 1}{3}. $$\n\nIt remains to show that equality can hold. One can construct two families of paths such that there are $2^k$ hops of size $2^k$ for every $0\\le k\\le n - 1$, and the frog visits each point in $\\{0, \\dots, 2^n - 1\\}$ exactly once, starting on $0$ and ending on $x$, for the two values $x\\in\\{1, 2^n - 1\\}$. This achieves the theoretical maximum, completing the proof.", "ref_answer": "$\\frac{4^n - 1}{3}$", "grading_guidelines": "(Partial) 1. Observed that every hop length must be at most $2^{n-1}$ (since all visited points stay in $\\{0,1,\\dots,2^n-1\\}$ and any hop of length $\\ge 2^n$ is impossible). 2. Introduced counts $a_i$ of hops of length $2^i$ and derived a nontrivial global restriction on the numbers of “large” jumps using residues mod $2^m$ (e.g. proved for some $m$ that the number of hops with length $\\ge 2^m$ is at most $2^n-2^m$). 3. Gave a construction idea that visits each point at most once and achieves total hop-sum $S=\\sum_{k=0}^{n-1} 2^{2k}=\\frac{4^n-1}{3}$ (or at least correctly constructed a family with $2^k$ hops of size $2^k$ for all $k$), even if the upper bound is not proved. (Almost) 1. Proved the key bound $a_{n-1}+\\cdots+a_m\\le 2^n-2^m$ for each $m$ (equivalently $A_k\\le 2^n-2^{n-k}$), and set up the summation-by-parts expression for $S$ in terms of the $A_k$, but made a localized algebra/summation error when evaluating the final bound. 2. Proved the full upper bound $S\\le \\frac{4^n-1}{3}$ correctly, but the construction for equality is incomplete (e.g. only described informally, or verified the “visits each point exactly once” property for one endpoint but not the other). 3. Gave both the upper bound method and a matching construction, but left a minor gap in the residue-class argument (such as not justifying why large jumps preserve the residue mod $2^m$, or mishandling the count “$\\frac{2^n}{2^m}-1$ per class”), while the rest of the solution is correct."}
{"split": "analysis", "source": "TSTST-2017-P2", "category": "Operations and Strategies", "id": "TSTST2017_2", "query": "Ana and Banana are playing a game. First Ana picks a word, which is defined to be a nonempty sequence of capital English letters. Then Banana picks a nonnegative integer $k$ and challenges Ana to supply a word with exactly $k$ subsequences which are equal to Ana's word. Ana wins if she is able to supply such a word, otherwise she loses. For example, if Ana picks the word “TST”, and Banana chooses $k = 4$, then Ana can supply the word “TSTST” which has $4$ subsequences which are equal to Ana's word. Which words can Ana pick so that she can win no matter what value of $k$ Banana chooses?", "ref_solution": "First we introduce some notation. Define a *block* of letters to be a maximal contiguous subsequence of consecutive identical letters. For example, the word $AABBBCAAA$ has four blocks, namely $AA$, $BBB$, $C$, and $AAA$. Throughout the solution, we fix the word $A$ that Ana picks, and introduce the following notation for its $m$ blocks: \n$$A = A_1 A_2 \\dots A_m = \\underbrace{a_1 \\dots a_1}_{x_1} \\underbrace{a_2 \\dots a_2}_{x_2} \\dots \\underbrace{a_m \\dots a_m}_{x_m}.$$ \nA *rainbow* will be defined as a subsequence equal to Ana's initial word $A$ (meaning Ana seeks words with exactly $k$ rainbows). For brevity, let $A_i = \\underbrace{a_i \\dots a_i}_{x_i}$, so $A = A_1 \\dots A_m$.\n\nWe prove two claims that resolve the problem.\n\n**Claim 1:** If $x_i = 1$ for some $i$, then for any $k \\ge 1$, the word \n$$W = A_1 \\dots A_{i-1} \\underbrace{a_i \\dots a_i}_{k} A_{i+1} \\dots A_m$$ \nobtained by repeating the $i$th letter $k$ times has exactly $k$ rainbows.\n\n*Proof:* Obviously there are at least $\\binom{k}{k-1}=k$ rainbows, obtained by deleting $k-1$ choices of the letter $a_i$ in the repeated block. We show they are the only ones. Given a rainbow, consider the location of this singleton block in $W$. It cannot occur within the first $|A_1| + \\dots + |A_{i-1}|$ letters, nor can it occur within the final $|A_{i+1}| + \\dots + |A_m|$ letters. So it must appear in the $i$th block of $W$. That implies that all the other $a_i$'s in the $i$th block of $W$ must be deleted, as desired.\n\n**Claim 2:** If $x_i \\ge 2$ for all $i$, then no word $W$ has exactly two rainbows.\n\n*Proof:* We prove that if there are two rainbows of $W$, then we can construct at least three rainbows. Let $W = w_1 \\dots w_n$ and consider two rainbows of $W$. Since they are not the same, there must be a block $A_p$ of the rainbow, of length $\\ell \\ge 2$, which does not occupy the same locations in $W$. Assume the first rainbow uses $w_{i_1}, \\dots, w_{i_\\ell}$ for this block and the second rainbow uses $w_{j_1}, \\dots, w_{j_\\ell}$ for this block. Then among the letters $w_q$ for $\\min(i_1, j_1) \\le q \\le \\max(i_\\ell, j_\\ell)$, there must be at least $\\ell+1$ copies of the letter $a_p$. Moreover, given a choice of $\\ell$ copies of the letter $a_p$ in this range, one can complete the subsequence to a rainbow. So the number of rainbows is at least $\\binom{\\ell+1}{\\ell} \\ge \\ell+1$. Since $\\ell \\ge 2$, this proves $W$ has at least three rainbows.\n\nIn summary, Ana wins if and only if $x_i = 1$ for some $i$, since she can duplicate the isolated letter $k$ times; but if $x_i \\ge 2$ for all $i$ then Banana only needs to supply $k = 2$.", "ref_answer": "Ana wins if and only if at least one letter appears exactly once in her word.", "grading_guidelines": "(Partial) 1. Proved the sufficiency direction: if Ana’s word contains a letter that occurs exactly once (equivalently, some block has length 1), then for any k one can repeat that letter k times in the supplied word and obtain exactly k subsequences equal to Ana’s word. 2. Proved a usable obstruction when every letter occurs at least twice (e.g. every block has length ≥2): showed that Banana can choose a specific small k (typically k=2) that cannot be realized, by arguing that having at least two target subsequences forces the existence of a third. 3. Introduced a correct block/runs decomposition of Ana’s word and used it to relate different embeddings of the word as a subsequence to a lower bound on the number of subsequences. (Almost) 1. Correctly identified the winning criterion (“Ana wins iff at least one letter appears exactly once”), and proved the construction for all k, but did not fully justify uniqueness of the counted k subsequences (e.g. did not rule out extra subsequences using the repeated block in a different way). 2. Proved the necessity direction for the case “all blocks have length ≥2” by showing ‘2 subsequences ⇒ at least 3’, but left a localized gap in the combinatorial argument (e.g. why a shifted block forces at least ℓ+1 choices, or why any such choice extends to a full subsequence). 3. Solution establishes both directions with the right main ideas, but contains a minor counting or boundary-case slip (such as k=0 or k=1 not explicitly handled) that does not undermine the overall structure."}
{"split": "analysis", "source": "TSTST-2016-P5", "category": "Existence and Construction", "id": "TSTST2016_5", "query": "In the coordinate plane are finitely many *walls*, which are disjoint line segments, none of which are parallel to either axis. A bulldozer starts at an arbitrary point and moves in the $+x$ direction. Every time it hits a wall, it turns at a right angle to its path, away from the wall, and continues moving. (Thus the bulldozer always moves parallel to the axes.) Prove that it is impossible for the bulldozer to hit both sides of every wall.", "ref_solution": "We say a wall $v$ is *above* another wall $w$ if some point on $v$ is directly above a point on $w$. (This relation is antisymmetric, as walls do not intersect.) The critical claim is as follows:\n\n\\begin{claim*}\nThere exists a lowest wall, i.e., a wall not above any other walls.\n\\end{claim*}\n\n\\begin{proof}\nAssume not. Then we get a directed cycle of some length $n \\ge 3$: it is possible to construct a series of points $P_i$ and $Q_i$ for $i = 1, \\dots, n$ (indices modulo $n$), such that the point $Q_i$ is directly above $P_{i+1}$ for each $i$, the segment $\\overline{Q_i P_{i+1}}$ does not intersect any wall in its interior, and finally each segment $\\overline{P_i Q_i}$ is contained inside a wall. This gives us a broken line on $2n$ vertices which is not self-intersecting. Now consider the leftmost vertical segment $\\overline{Q_i P_{i+1}}$ and the rightmost vertical segment $\\overline{Q_j P_{j+1}}$. The broken line gives a path from $P_{i+1}$ to $Q_j$, as well as a path from $P_{j+1}$ to $Q_i$. These clearly must intersect, which is a contradiction.\n\\end{proof}\n\nThus, if the bulldozer eventually moves upwards indefinitely, it will never hit the bottom side of the lowest wall. Similarly, if the bulldozer eventually moves downwards indefinitely, it will never hit the upper side of the highest wall.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Introduced a correct invariant/partial order on walls (e.g. “v is above w if some point of v is vertically above some point of w”), and justified that this relation is antisymmetric because walls are disjoint. 2. Proved (or correctly reduced to proving) that among finitely many walls there exists a “lowest” wall (one not above any other), or dually a “highest” wall, and explained why such an extremal wall would obstruct hitting both of its sides. 3. Established a one-sided trapping statement: if the bulldozer ever starts moving vertically upward (resp. downward) without bound, then it can never hit the bottom side of a lowest wall (resp. the top side of a highest wall). (Almost) 1. Gave the full extremal-wall strategy and concluded the impossibility, but left a localized gap in proving existence of a lowest/highest wall (e.g. the “no directed cycle” argument is sketched but not rigorously justified). 2. Proved existence of a lowest (or highest) wall via the intended cycle/planarity contradiction, and correctly argued that one side of that wall is unhit, but did not fully justify the step that the bulldozer’s motion must eventually go upward indefinitely or downward indefinitely (missing a short case split). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USATST-2024-P4", "category": "Existence and Construction", "id": "USATST2024_4", "query": "Find all integers $n \\ge 2$ for which there exists a sequence of $2n$ pairwise distinct points $(P_1, \\dots, P_n, Q_1, \\dots, Q_n)$ in the plane satisfying the following four conditions: \n\\begin{enumerate}[label={(\\roman*)}]\n\\item no three of the $2n$ points are collinear;\n\\item $P_iP_{i+1} \\ge 1$ for all $i=1,2,\\dots,n$, where $P_{n+1}=P_1$;\n\\item $Q_iQ_{i+1} \\ge 1$ for all $i=1,2,\\dots,n$, where $Q_{n+1}=Q_1$;\n\\item $P_i Q_j \\le 1$ for all $i=1,2,\\dots,n$ and $j=1,2,\\dots,n$.\n\\end{enumerate}", "ref_solution": "The answer is even integers only.\n\n\\paragraph{Proof that even $n$ work.}\nIf we ignore the conditions that the points are pairwise distinct and form no collinear triples, we may take \n\\[ \nP_{2i-1}=(0.51, 0), \\quad P_{2i}=(-0.51, 0), \\quad Q_{2i-1}=(0, 0.51), \\quad Q_{2i}=(0,-0.51) \n\\] \nfor $i = 1, 2, \\dots, n/2$. The distances $P_iP_{i+1}$ and $Q_iQ_{i+1}$ (including $P_nP_1$ and $Q_nQ_1$) are $1.02 > 1$, while all distances $P_iQ_j$ are $0.51\\sqrt{2} \\approx 0.72 < 1$. Because these inequalities are strict, we may perturb each point by a sufficiently small amount to ensure that the strict distance inequalities still hold, while making the points pairwise distinct and ensuring no three points are collinear.\n\n\\paragraph{Proof that odd $n$ do not work.}\nThe main claim is the following. \n\\begin{claim*} \nFor $1\\leq i\\leq n$, points $Q_i$ and $Q_{i+1}$ must lie on opposite sides of line $P_1P_2$. \n\\end{claim*} \nTo isolate the geometry component of the problem, we rewrite the claim in the following contrapositive form, without referencing the points $Q_i$ and $Q_{i+1}$: \n\\begin{lemma*} \nSuppose $P_1, P_2$ are points with $P_1P_2 \\ge 1$, and $A, B$ are two points such that $\\max(P_1A, P_1B, P_2A, P_2B) \\le 1$. Moreover, assume $A$ and $B$ lie on the same side of line $P_1 P_2$, and no three of $\\{P_1, P_2, A, B\\}$ are collinear. Then $AB < 1$. \n\\end{lemma*} \n\\begin{proof}[Proof of Lemma] \nSince $A$ and $B$ lie on the same side of $P_1P_2$, the convex hull of these four points is either a quadrilateral or a triangle. \n\\begin{itemize} \n \\item If the convex hull is a quadrilateral, assume without loss of generality that the vertices are $P_1, P_2, A, B$ in order. Let $X$ denote the intersection of the diagonals $P_1A$ and $P_2B$. Since $P_1P_2 \\ge 1$, we have\n \\[ \n 1 + AB \\leq P_1P_2 + AB < (P_1X + XP_2) + (AX + XB) = P_1A + P_2B \\leq 2. \n \\] \n Thus, $AB < 1$.\n \\item Otherwise, the convex hull is a triangle. Since $A$ and $B$ are on the same side of $P_1P_2$, the segment $P_1P_2$ must be an edge of this convex hull. Assume without loss of generality that $B$ is in the interior of triangle $P_1P_2A$. Since $\\angle P_1BA + \\angle P_2BA = 360^\\circ-\\angle P_1BP_2 > 180^\\circ$, at least one of $\\angle P_1BA$ and $\\angle P_2BA$ is obtuse. Assume without loss of generality the former angle is obtuse; then in $\\triangle P_1BA$, the side opposite the obtuse angle is strictly the longest, so $AB < P_1A \\leq 1$.\n\\end{itemize} \n\\end{proof} \nApplying the lemma to $A = Q_i$ and $B = Q_{i+1}$, we are given $P_1P_2 \\ge 1$ and $P_1Q_i, P_1Q_{i+1}, P_2Q_i, P_2Q_{i+1} \\leq 1$. Since $Q_iQ_{i+1} \\geq 1$, the points $Q_i$ and $Q_{i+1}$ cannot lie on the same side of $P_1P_2$. This proves the claim. \n\nIt follows from the claim that $Q_i$ is on the same side of line $P_1P_2$ as $Q_1$ if $i$ is odd, and on the opposite side if $i$ is even. Since $Q_1 = Q_{n+1}$, this alternation means the construction is not possible when $n$ is odd.", "ref_answer": "Even integers only", "grading_guidelines": "(Partial) 1. Gave a correct construction for infinitely many even n (e.g. using two alternating locations for the Pi and two alternating locations for the Qj with strict inequalities), with a brief explanation that small perturbations can enforce “pairwise distinct” and “no three collinear” while preserving all distance inequalities. 2. Proved the key geometric lemma/claim: if P1P2≥1 and A,B satisfy P1A,P1B,P2A,P2B≤1 and A,B lie on the same side of line P1P2 (with no three collinear), then AB<1; and correctly applied it to deduce that Qi and Qi+1 must lie on opposite sides of P1P2. 3. From the “opposite sides” claim, correctly derived the parity alternation of the Qi relative to line P1P2 and concluded that odd n is impossible (even if the even-n construction is missing). (Almost) 1. Correctly proved that odd n do not work via the opposite-sides lemma/claim and the resulting alternation argument, but the even-n existence part is missing or only sketched without a perturbation/distinctness justification. 2. Gave the even-n construction and the parity obstruction for odd n, but left a localized gap in the lemma proof (e.g. the convex-hull case split/diagonal inequality or the obtuse-angle argument is not fully justified). 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USATST-2023-P1", "category": "Extremal Problems", "id": "USATST2023_1", "query": "There are $2022$ equally spaced points on a circular track $\\gamma$ of circumference $2022$. The points are labeled $A_1$, $A_2$, \\dots, $A_{2022}$ in some order, each label used once. Initially, Bunbun the Bunny begins at $A_1$. She hops along $\\gamma$ from $A_1$ to $A_2$, then from $A_2$ to $A_3$, until she reaches $A_{2022}$, after which she hops back to $A_1$. When hopping from $P$ to $Q$, she always hops along the shorter of the two arcs $\\arc{PQ}$ of $\\gamma$; if $\\overline{PQ}$ is a diameter of $\\gamma$, she moves along either semicircle. Determine the maximal possible sum of the lengths of the $2022$ arcs which Bunbun traveled, over all possible labellings of the $2022$ points.", "ref_solution": "Replacing $2022$ with $2n$, the answer is $2n^2 - 2n + 2$. (When $n=1011$, the number is $2042222$.) \n\n\\paragraph{Construction.} Let the $2n$ points along the track be labeled $0, 1, \\dots, 2n-1$ in order. The maximum distance is achieved by the sequence of points $A_{2i-1} = i-1$ and $A_{2i} = n+i-1$ for $i=1, 2, \\dots, n$. (For example, when $n=5$, the sequence of points is $0, 5, 1, 6, 2, 7, 3, 8, 4, 9$.) This corresponds to alternating between points in the two halves of the circle.\n\n\\paragraph{First proof of bound.} Let $d_i$ be the shorter distance from $A_{2i-1}$ to $A_{2i+1}$. \n\n\\begin{claim*}\nThe distance of the leg of the journey $A_{2i-1} \\to A_{2i} \\to A_{2i+1}$ is at most $2n - d_i$.\n\\end{claim*}\n\n\\begin{proof}\nThe point $A_{2i}$ lies on one of the two arcs from $A_{2i-1}$ to $A_{2i+1}$, which have lengths $d_i$ and $2n-d_i$. The sum of the shorter arc distances $A_{2i-1} \\to A_{2i}$ and $A_{2i} \\to A_{2i+1}$ is at most the length of the arc containing $A_{2i}$. Thus, we get a bound of $\\max(d_i, 2n-d_i) = 2n - d_i$.\n\\end{proof}\n\nThat means the total distance is at most \n\\[\n\\sum_{i=1}^n \\left( 2n - d_i \\right) = 2n^2 - (d_1 + d_2 + \\dots + d_n).\n\\]\n\n\\begin{claim*}\nWe have \n\\[\nd_1 + d_2 + \\dots + d_n \\ge 2n-2.\n\\]\n\\end{claim*}\n\n\\begin{proof}\nThe left-hand side is the total length of the closed walk $A_1 \\to A_3 \\to \\dots \\to A_{2n-1} \\to A_1$. Among the $n$ distinct points visited, two of them must be at a distance of at least $n-1$ apart. The closed walk is divided into two paths connecting these two points. If one path consists of a single step, its length is at least $n-1$, and the other path consists of $n-1$ steps which contribute at least $1$ each, giving a sum of at least $(n-1) + (n-1) \\cdot 1 = 2n-2$. More generally, by the triangle inequality, each of the two paths connecting the two points has length at least $n-1$, so the total length of the walk is always at least $2(n-1) = 2n-2$.\n\\end{proof}\n\n\\paragraph{Second proof of bound.} Draw the $n$ diameters through the midpoints of the $2n$ arcs between adjacent points on the track.\n\n\\begin{claim*}[Interpretation of distances]\nThe distance between any two points equals the number of diameters crossed to travel between the points.\n\\end{claim*}\n\n\\begin{proof}\nClear, as each step of length $1$ along the shorter arc between two points crosses exactly one such diameter.\n\\end{proof}\n\nWith this in mind, call a diameter \\emph{critical} if it is crossed by all $2n$ arcs. \n\n\\begin{claim*}\nAt most one diameter is critical.\n\\end{claim*}\n\n\\begin{proof}\nSuppose there were two critical diameters; these divide the circle into four sectors, each containing at least one of the $2n$ points. Then all $2n$ arcs cross both diameters, and so every hop must travel between opposite sectors. But this means that the sequence of hops alternates between two opposite sectors, so the points in the other two sectors are never accessed --- contradiction.\n\\end{proof}\n\n\\begin{claim*}\nEvery diameter is crossed an even number of times.\n\\end{claim*}\n\n\\begin{proof}\nClear: crossing a diameter moves Bunbun from one semicircle to the opposite one, so the diameter needs to be crossed an even number of times for the closed loop to return to its origin.\n\\end{proof}\n\nThis immediately implies that the maximum possible total distance is achieved when one diameter is crossed all $2n$ times, and every other diameter is crossed $2n-2$ times, for a total distance of at most \n\\[\nn \\cdot (2n-2) + 2 = 2n^2 - 2n + 2.\n\\]", "ref_answer": "2042222", "grading_guidelines": "(Partial) 1. Gave (and correctly evaluated) a concrete labeling achieving total distance $2n^2-2n+2$ (e.g. alternating between opposite halves: $0,n,1,n+1,\\dots,n-1,2n-1$). 2. Proved the key local bound for a 2-step leg: for $d_i$ the shorter distance from $A_{2i-1}$ to $A_{2i+1}$, showed \\(\\operatorname{dist}(A_{2i-1},A_{2i})+\\operatorname{dist}(A_{2i},A_{2i+1})\\le 2n-d_i\\). 3. Introduced the diameter-crossing interpretation (distance equals number of crossed mid-diameters) and proved at least one of: “every diameter is crossed an even number of times” or “at most one diameter can be crossed by all $2n$ hops (critical diameter)”. (Almost) 1. Obtained the global upper bound $\\sum (2n-d_i)=2n^2-\\sum d_i$ and argued $\\sum d_i\\ge 2n-2$, but left a gap in justifying $\\sum d_i\\ge 2n-2$ (e.g. the choice of two odd-index points at distance $\\ge n-1$ or the triangle-inequality argument for the two connecting paths). 2. Used the diameter-crossing method to derive the bound $2n^2-2n+2$, but did not fully justify one of the structural claims (e.g. why at most one diameter is critical, or why each diameter is crossed an even number of times in the closed tour). 3. Solution gives the correct maximum value and a matching construction, but has a minor indexing/boundary omission (e.g. handling the final hop $A_{2n}\\to A_1$ or the diameter case) while the main method is correct."}
{"split": "analysis", "source": "USATST-2020-P3", "category": "Operations and Strategies", "id": "USATST2020_3", "query": "Let $\\alpha \\ge 1$ be a real number. \nHephaestus and Poseidon play a turn‑based game on an infinite grid of unit squares. \nBefore the game starts, Poseidon chooses a finite number of cells to be flooded. \nHephaestus is building a levee, which is a subset of unit edges of the grid, called walls, forming a connected, non‑self‑intersecting path or loop. \n\nThe game then begins with Hephaestus moving first. \nOn each of Hephaestus's turns, he adds one or more walls to the levee, as long as the total length of the levee is at most $\\alpha n$ after his $n$th turn. \nOn each of Poseidon's turns, every cell which is adjacent to an already flooded cell and with no wall between them becomes flooded as well. \n\nHephaestus wins if the levee forms a closed loop such that all flooded cells are contained in the interior of the loop — hence stopping the flood and saving the world. \nFor which $\\alpha$ can Hephaestus guarantee victory in a finite number of turns no matter how Poseidon chooses the initial cells to flood?", "ref_solution": "We show that if $\\alpha > 2$ then Hephaestus wins, but when $\\alpha \\le 2$ Hephaestus cannot contain even a single-cell flood initially.\n\n\\bigskip\n\n**Strategy for $\\alpha > 2$**:\nImpose $\\mathbb{Z}^2$ coordinates on the cells. Adding more flooded cells does not make our task easier, so let us assume that initially the cells $(x,y)$ with $|x|+|y| \\le d$ are flooded for some $d \\ge 2$; thus on Hephaestus's $k$-th turn, the water is contained in $|x|+|y| \\le d+k-1$. Our goal is to contain the flood with a large rectangular levee.\n\nWe pick large integers $N_1$ and $N_2$ such that\n\\[\n \\alpha N_1 > 2N_1 + (2d + 3),\\qquad\n \\alpha (N_1+N_2) > 2N_2 + (6N_1 + 8d + 4).\n\\]\nWe construct the levee by defining a sequence of points and segments. The lengths of the segments to be added are as follows:\n\\begin{itemize}\n \\item $X_1 Y_1$ is a horizontal wall of length $1$ placed to the north of the flood.\n \\item $X_1 X_2$ and $Y_1 Y_2$ are horizontal extensions of length $N_1$ to the west and east, respectively.\n \\item $X_4 X_3 X_2$ and $Y_4 Y_3 Y_2$ are broken lines of length $d+1$ each that turn southwards.\n \\item $X_4 X_5$ and $Y_4 Y_5$ are vertical extensions of length $N_2$ to the south.\n \\item $X_5 X_6 Y_6 Y_5$ is a broken line of length $4N_1 + 6d + 1$ that closes the loop at the south.\n\\end{itemize}\n\nWe follow the following plan:\n\\begin{itemize}\n \\item \\textbf{Turn $1$}: place wall $X_1 Y_1$. This cuts off the flood to the north.\n \\item \\textbf{Turns $2$ through $N_1+1$}: extend the levee to segment $X_2 Y_2$. This prevents further flooding to the north.\n \\item \\textbf{Turn $N_1+2$}: add in broken lines $X_4 X_3 X_2$ and $Y_4 Y_3 Y_2$ all at once. This cuts off the flood west and east.\n \\item \\textbf{Turns $N_1+3$ to $N_1+N_2+2$}: extend the levee along vertical segments $X_4 X_5$ and $Y_4 Y_5$. This prevents further flooding west and east.\n \\item \\textbf{Turn $N_1 + N_2 + 3$}: add in the broken line $X_5 X_6 Y_6 Y_5$ all at once and win.\n\\end{itemize}\n\n\\bigskip\n\n**Proof for $\\alpha \\le 2$**:\nSuppose Hephaestus contains the flood on his $(n+1)$-st turn. We prove that $\\alpha > 2$ by showing that in fact at least $2n+4$ walls have been constructed.\n\nLet $c_0, c_1, \\dots, c_n$ be a path of cells such that $c_0$ is the initial cell flooded, and in general $c_i$ is flooded on Poseidon's $i$-th turn from $c_{i-1}$. The levee now forms a closed loop enclosing all $c_i$.\n\n\\begin{claim*}\n If $c_i$ and $c_j$ are adjacent then $|i-j|=1$.\n\\end{claim*}\n\\begin{proof}\n Assume $c_i$ and $c_j$ are adjacent but $|i-j|>1$. Then the two cells must be separated by a wall. But the levee forms a simple closed loop, so any wall of the levee separates its interior from its exterior. This would mean $c_i$ and $c_j$ are on opposite sides of the levee, contradicting that both are flooded and thus contained in the interior.\n\\end{proof}\n\nThus the cells $c_i$ actually form a simple path. We color \\textit{green} any edge of the unit grid (wall or not) which is an edge of exactly one $c_i$ (i.e., the boundary of the polyomino). It is easy to see there are exactly $2n+4$ green edges.\n\nNow, from the center of each cell $c_i$, shine a laser towards each green edge of $c_i$ (hence a total of $2n+4$ lasers are emitted).\n\n\\begin{claim*}\n No wall is hit by more than one laser.\n\\end{claim*}\n\\begin{proof}\n Assume for contradiction that a wall $w$ is hit by lasers from $c_i$ and $c_j$. Without loss of generality, assume that the laser is vertical, so $c_i$ and $c_j$ are in the same column.\n\n We consider two cases on the position of $w$:\n \\begin{itemize}\n \\item If $w$ is between $c_i$ and $c_j$, then the line segment connecting the centers of $c_i$ and $c_j$ intersects the levee exactly once (at $w$). However, both $c_i$ and $c_j$ lie in the interior of the levee. Any segment connecting two interior points of a simple closed loop must intersect the loop an even number of times, a contradiction.\n\n \\item Suppose $w$ lies above both $c_i$ and $c_j$, and assume WLOG $i < j$. Since the laser from $c_i$ hits $w$ without hitting any walls in between, there is no levee at all between $c_i$ and $c_j$. Let $\\rho \\ge 1$ be the distance between the centers of $c_i$ and $c_j$. Since there are no walls between them, $c_j$ can be flooded in a straight line from $c_i$ within $\\rho$ turns, and this straight line is the unique shortest possible path. Thus, this situation can only occur if $j = i+\\rho$ and the cells $c_i, c_{i+1}, \\dots, c_j$ form a contiguous column. But if they form a column, the top edge of $c_i$ is shared with $c_{i+1}$, meaning it is not a green edge, so no upward vertical laser can be emitted from $c_i$, a contradiction.\n \\end{itemize}\n Since neither case is possible, the claim is proven.\n\\end{proof}\n\nThis implies the levee has at least $2n+4$ walls (the number of lasers) on Hephaestus's $(n+1)$-st turn. So $\\alpha \\ge \\frac{2n+4}{n+1} > 2$.", "ref_answer": "$\\alpha > 2$", "grading_guidelines": "(Partial) 1. For the winning direction, reduced to the case where the initially flooded region is a diamond/ball in Manhattan distance (e.g. all cells with |x|+|y|<=d), and correctly tracked that after k Poseidon moves the flood is contained in |x|+|y|<=d+k. 2. Gave a coherent construction idea for α>2: start with a short wall to block one side and then build a large rectangular (or similar) loop with long horizontal/vertical extensions, using the fact that Hephaestus may add many walls in one turn provided the total length constraint is met. 3. For the impossibility direction (α<=2), exhibited the flooded cells c0,c1,...,cn along a flooding chain and proved the key structural claim that if ci and cj are adjacent then |i−j|=1, hence the flooded cells form a simple path. (Almost) 1. Presented a complete strategy for α>2 based on building a large enclosing rectangle in stages (blocking north, extending left/right, turning down, extending down, then closing), with the correct inequalities on chosen parameters, but left a minor gap in checking that the flood cannot “leak around” an unfinished corner during the intermediate turns. 2. Proved α>2 is necessary by counting at least 2n+4 required walls from a length-n+1 containment time, including the green-edge/laser injectivity idea (no wall hit by two lasers), but had a localized flaw (e.g. parity/intersection argument, or handling of the ‘wall above both cells’ case) while the rest of the argument is correct. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USATST-2019-P3", "category": "Existence and Construction", "id": "USATST2019_3", "query": "A \\emph{snake of length $k$} is an animal which occupies an ordered $k$-tuple $(s_1, \\dots, s_k)$ of cells in an $n \\times n$ grid of square unit cells. These cells must be pairwise distinct, and $s_i$ and $s_{i+1}$ must share a side for $i=1,\\dots,k-1$. If the snake is currently occupying $(s_1, \\dots, s_k)$ and $s$ is an unoccupied cell sharing a side with $s_1$, the snake can \\emph{move} to occupy $(s, s_1, \\dots, s_{k-1})$ instead. The snake has \\emph{turned around} if it occupied $(s_1, s_2, \\dots, s_k)$ at the beginning, but after a finite number of moves occupies $(s_k, s_{k-1}, \\dots, s_1)$ instead.\n\nDetermine whether there exists an integer $n > 1$ such that one can place some snake of length at least $0.9n^2$ in an $n \\times n$ grid which can turn around.", "ref_solution": "The answer is yes. We can show that for any $c < 1$, there exists an $n$ such that a snake of length at least $c n^2$ can turn around in an $n \\times n$ grid. In particular, this holds for $c = 0.9$.\n\nLet $G$ be any undirected graph. Consider a snake of length $k$ lying within $G$, with each segment of the snake occupying one vertex, consecutive segments occupying adjacent vertices, and no two segments occupying the same vertex. One move of the snake consists of the snake's head advancing to an adjacent empty vertex and segment $i$ advancing to the vertex of segment $i - 1$ for $i = 2, 3, \\dots, k$.\n\nThe proof proceeds in two stages. First, we construct a planar graph $G$ such that it is possible for a snake that occupies nearly all of $G$ to turn around inside $G$. Then, we construct a subgraph $H$ of the $n \\times n$ grid graph such that $H$ is isomorphic to $G$ and $H$ occupies nearly all of the grid.\n\n**Stage 1: Construction of the graph $G$**\nLet $r$ and $\\ell$ be positive integers. Start with $r$ disjoint *main* paths $p_1, p_2, \\dots, p_r$, each of length at least $\\ell$, with $p_i$ leading from $A_i$ to $B_i$ for $i = 1, 2, \\dots, r$. Add to those $r$ *linking* paths, one leading from $B_i$ to $A_{i + 1}$ for each $i = 1, 2, \\dots, r - 1$, and one leading from $B_r$ to $A_1$. Finally, add two families of *transit* paths: the first family contains one transit path joining $A_1$ to each of $A_2, A_3, \\dots, A_r$, and the second family contains one path joining $B_r$ to each of $B_1, B_2, \\dots, B_{r - 1}$. We require that all paths specified in the construction have no interior vertices in common, with the exception that transit paths in the same family may share vertices.\n\nWe claim that a snake of length $(r - 1)\\ell$ can turn around inside $G$.\n\nLet the concatenation $A_1 \\to B_1 \\to A_2 \\to B_2 \\to \\dots \\to A_r \\to B_r \\to A_1$ of all main and linking paths be the *great cycle*. We refer to this direction as the counterclockwise orientation of the great cycle, and the reverse direction as its clockwise orientation.\n\nPlace the snake so that its tail is at $A_1$ and its body extends counterclockwise along the great cycle. Then let the snake maneuver as follows. (We track only the snake's head, as its movement uniquely determines the movement of the complete body of the snake.)\n\n- **Phase 1:** Advance counterclockwise along the great cycle to $B_{r - 1}$, take a detour along a transit path to $B_r$, and advance clockwise along the great cycle to $A_r$.\n- **Phase $i$ (for $i = 2, 3, \\dots, r - 1$):** Take a detour along a transit path to $A_1$, advance counterclockwise along the great cycle to $B_{r - i}$, take a detour along a transit path to $B_r$, and advance clockwise along the great cycle to $A_{r - i + 1}$.\n- **Phase $r$:** Simply advance clockwise along the great cycle to $A_1$.\n\nThroughout these phases, because the snake has length $(r - 1)\\ell$ and each main path has length at least $\\ell$, the required transit paths and segments of the great cycle are guaranteed to be unoccupied when the head enters them. By the end of phase $r$, the snake's tail is at $A_1$ and its body extends clockwise along the great cycle, meaning it has successfully reversed its orientation and turned around.\n\n**Stage 2: Embedding $G$ into the grid**\nLet $n$ be a sufficiently large positive integer. Consider an $n \\times n$ grid $S$. Number the columns of $S$ from $1$ to $n$ from left to right, and its rows from $1$ to $n$ from bottom to top.\n\nLet $a_1, a_2, \\dots, a_{r + 1}$ be cells of $S$ such that all of them lie in column $2$, with $a_1$ in row $2$, $a_{r + 1}$ in row $n - 1$, and the cells approximately equally spaced. Let $b_1, b_2, \\dots, b_r$ be cells of $S$ such that all of them lie in column $n - 2$, and $b_i$ lies in the same row as $a_{i + 1}$ for $i = 1, 2, \\dots, r$.\n\nConstruct the subgraph $H \\subset S$ as follows:\n- For $i = 1, 2, \\dots, r$, let the main path from $a_i$ to $b_i$ be a serpentine path that fills up the rectangle bounded by the rows and columns of $a_i$ and $b_i$ nearly completely. By doing so, every main path has a length of approximately $\\frac{1}{r}n^2$.\n- For $i = 1, 2, \\dots, r - 1$, let the linking path that leads from $b_i$ to $a_{i + 1}$ lie inside the row shared by $b_i$ and $a_{i + 1}$.\n- Let the linking path that leads from $b_r$ to $a_1$ lie inside row $n$, column $n$, and row $1$.\n- Lastly, let the union of the first family of transit paths be column $1$, and let the union of the second family of transit paths be column $n - 1$, excluding their bottommost and topmost squares.\n\nThis grid subgraph $H$ is isomorphic to $G$. As shown in the first stage, a snake of length $k$ approximately equal to $\\frac{r - 1}{r}n^2$ can turn around inside $H$, and therefore inside the $n \\times n$ grid $S$. \n\nWhen $r$ is fixed and $n$ tends to infinity, the ratio $\\frac{k}{n^2}$ tends to $\\frac{r - 1}{r}$. Furthermore, as $r$ tends to infinity, $\\frac{r - 1}{r}$ tends to $1$. By choosing $r \\ge 10$ and $n$ sufficiently large, we can achieve a snake of length at least $0.9n^2$ that can turn around, which completes the proof.", "ref_answer": "Yes", "grading_guidelines": "(Partial) 1. Reformulated the problem on an arbitrary graph, observing that it suffices to build a subgraph of the grid in which a long snake can reverse orientation. 2. Described a concrete “turnaround gadget”/scheme (e.g. a large cycle with detours/transit paths) and explained why the head can use a detour to start moving along the cycle in the opposite direction. 3. Gave a credible embedding idea into an n×n grid (e.g. using long serpentine paths to realize long disjoint paths and using one or two columns as shared transit corridors), with a correct density estimate in the limit (such as achieving length about (r−1)/r·n^2 for fixed r and large n). (Almost) 1. Constructed the graph G with main/linking/transit paths and gave the phase-based maneuver that reverses the snake, but left a small gap in the “unoccupied when needed” verification (e.g. an inequality involving ℓ, r, and how far the tail has moved). 2. Correctly embedded (or outlined embedding of) G into an n×n grid with serpentine main paths and transit columns, and obtained length ≥0.9n^2 for some choice of parameters, but omitted a localized check that the specified paths are internally vertex-disjoint / fit without unintended intersections at corners or endpoints. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USATST-2018-P4", "category": "Extremal Problems", "id": "USATST2018_4", "query": "Let $n$ be a positive integer and let $S \\subseteq \\{0,1\\}^n$ be a set of binary strings of length $n$. Given an odd number $x_1, \\dots, x_{2k+1} \\in S$ of binary strings (not necessarily distinct), their *majority* is defined as the binary string $y \\in \\{0,1\\}^n$ for which the $i$\\textsuperscript{th} bit of $y$ is the most common bit among the $i$\\textsuperscript{th} bits of $x_1$, \\dots, $x_{2k+1}$. (For example, if $n=4$ the majority of $0000$, $0000$, $1101$, $1100$, $0101$ is $0100$.) Suppose that for some positive integer $k$, $S$ has the property $P_k$ that the majority of any $2k+1$ binary strings in $S$ (possibly with repetition) is also in $S$. Prove that $S$ has the same property $P_k$ for all positive integers $k$.", "ref_solution": "Let $M$ denote the majority function (of any length).\n\n**First solution (induction).** We prove all $P_k$ are equivalent by induction on $n \\ge 2$, with the base case $n = 2$ being easy to check by hand. (The case $n=1$ is also vacuous; however, the inductive step is not able to go from $n=1$ to $n=2$.)\n\nFor the inductive step, we proceed by contradiction; assume $S$ satisfies $P_{\\ell}$, but not $P_{k}$, so there exist $x_1, \\dots, x_{2k+1} \\in S$ whose majority $y = M(x_1, \\dots, x_{2k+1})$ is not in $S$. We contend that:\n\n**Claim:** Let $y_i$ be the string which differs from $y$ only in the $i$\\textsuperscript{th} bit. Then $y_i \\in S$.\n\n*Proof.* For a string $s \\in S$ we let $\\hat s$ denote the string $s$ with the $i$\\textsuperscript{th} bit deleted (hence with $n-1$ bits). Now let\n\\[\nT = \\left\\{ \\hat s \\mid s \\in S \\right\\}.\n\\]\nSince $S$ satisfies $P_\\ell$, so does $T$; thus by the induction hypothesis on $n$, $T$ satisfies $P_{k}$. Consequently, $T \\ni M(\\hat{x}_1, \\dots, \\hat{x}_{2k+1}) = \\hat y$. Thus there exists $s \\in S$ such that $\\hat s = \\hat y$. This implies $s = y$ or $s = y_i$. But since we assumed $y \\notin S$ it follows $y_i \\in S$ instead.\n\nNow take any $2\\ell+1$ copies of the $y_i$, about equally often (i.e., the number of times any two $y_i$ are taken differs by at most $1$). We see the majority of these is $y$ itself, contradiction.\n\n**Second solution (circuit construction).** Note that $P_k \\implies P_1$ for any $k$, since\n\\[\nM( \\underbrace{a,\\dots,a}_k, \\underbrace{b,\\dots,b}_k, c ) = M(a,b,c)\n\\]\nfor any $a$, $b$, $c$. We will now prove $P_1 + P_k \\implies P_{k+1}$ for any $k$, which will prove the result. Actually, we will show that the majority of any $2k+3$ strings $x_1$, \\dots, $x_{2k+3}$ can be expressed by $3$-majorities and $(2k+1)$-majorities. WLOG assume that $M(x_1, \\dots, x_{2k+3}) = 0\\dots0$, and let $\\odot$ denote binary AND.\n\n**Claim:** We have $M(x_1, x_2, M(x_3, \\dots, x_{2k+3})) = x_1 \\odot x_2$.\n\n[Proof continues with circuit construction arguments]", "ref_answer": "", "grading_guidelines": "(Partial) 1. Showed that for any k, property P_k implies P_1 (e.g. by padding M(a,b,c) as M(a,…,a,b,…,b,c) with k copies). 2. Set up the “delete one coordinate” reduction: defined \\(\\hat s\\) by deleting the i-th bit, defined \\(T=\\{\\hat s:s\\in S\\}\\), and correctly observed that if S has P_k then T has P_k (majority commutes with coordinate deletion). 3. In a contradiction setup (S has P_\\ell but fails P_k with majority y\\notin S), proved the key claim that for each i the neighbor \\(y_i\\) obtained by flipping the i-th bit lies in S (using the reduction to T and induction on n, or any other valid argument producing all \\(y_i\\in S\\)). (Almost) 1. Presented a complete contradiction argument via coordinate deletion and induction on n, and derived \\(y_i\\in S\\) for all i, but did not fully justify the final multiset choice of \\(2\\ell+1\\) copies of the \\(y_i\\) whose majority is exactly y (e.g. the “almost equally often” counting step is not checked). 2. Used the circuit/closure approach: proved P_k\\(\\Rightarrow\\)P_1 and established (or nearly established) the recursive step P_1 + P_k \\(\\Rightarrow\\) P_{k+1} by expressing a (2k+3)-majority using 3-majorities and (2k+1)-majorities, but left one of the circuit identities/boolean-case checks (or the final induction on k) with a small gap. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USATST-2017-P1", "category": "Extremal Problems", "id": "USATST2017_1", "query": "In a sports league, each team uses a set of at most $t$ signature colors. A set $S$ of teams is *color-identifiable* if one can assign each team in $S$ one of their signature colors, such that no team in $S$ is assigned *any* signature color of a different team in $S$. For all positive integers $n$ and $t$, determine the maximum integer $g(n,t)$ such that: In any sports league with exactly $n$ distinct colors present over all teams, one can always find a color-identifiable set of size at least $g(n,t)$.", "ref_solution": "The answer is $\\lceil n/t \\rceil$.\n\nTo see that $\\lceil n/t \\rceil$ is an upper bound, note that one can easily construct a sports league with exactly $\\lceil n/t \\rceil$ teams in total. (Since the total number of teams in the league is $\\lceil n/t \\rceil$, no subset of teams can be strictly larger than this.)\n\nA quick warning: It is common to misread the definition of color-identifiable by ignoring the word \"any\". Here is an illustration. Suppose we have two teams, MIT and Harvard; the colors of MIT are red, gray, and black, and the colors of Harvard are red and white. (Thus $n=4$ and $t=3$.) The assignment of MIT to gray and Harvard to red is *not* acceptable because red is a signature color of MIT, even though it is not the one assigned to MIT.\n\nWe present two proofs of the lower bound.\n\n**Approach by deleting teams (Gopal Goel):**\nInitially, place all teams in a set $S$. Then we repeat the following algorithm: If there is a team all of whose signature colors are shared by some other team in $S$ already, then we delete that team. (If there is more than one such team, we pick one arbitrarily.) At the end of the process, all $n$ colors are still present at least once, so at least $\\lceil n/t \\rceil$ teams remain. Moreover, since the algorithm is no longer possible, the remaining set $S$ is already color-identifiable.\n\nIt might seem counter-intuitive that we are *deleting* teams from the full set when the original problem is trying to get a large set $S$. This is less strange when one thinks of it instead as \"safely deleting useless teams\". Basically, if one deletes such a team, the problem statement implies that the task must still be possible, since $g(n,t)$ does not depend on the number of teams: $n$ is the number of colors present, and deleting a useless team does not change this. It turns out that this optimization is already enough to solve the problem.\n\n**Approach by adding colors:**\nFor a constructive algorithmic approach, the idea is to greedily pick by color (rather than by team), taking at each step the least used color. Select the color $C_1$ with the *fewest* teams using it, and a team $T_1$ using it. Then delete all colors $T_1$ uses, and all teams which use $C_1$. Note that by the problem condition, this deletes at most $t$ colors total. Any remaining color $C$ still has at least one user. Indeed, if not, then $C$ had the same set of teams as $C_1$ did (by the minimality of $C$), but then it should have been deleted as a color of $T_1$. Now repeat this algorithm with $C_2$ and $T_2$, and so on. This operation uses at most $t$ colors each time, so we select at least $\\lceil n/t \\rceil$ colors, corresponding to at least $\\lceil n/t \\rceil$ teams.\n\nA greedy approach by team *does not work*. For example, suppose we try to \"grab teams until no more can be added\". As before, assume our league has teams MIT and Harvard; the colors of MIT are red, gray, and black, and the colors of Harvard are red and white. (Thus $n=4$ and $t=3$.) If we start by selecting MIT and red, then it is impossible to select any more teams; but $g(n,t) = 2$.", "ref_answer": "the ceiling of $n/t$", "grading_guidelines": "(Partial) 1. Gave a correct extremal construction showing g(n,t) \\le \\lceil n/t\\rceil (e.g. a league with exactly \\lceil n/t\\rceil teams using all n colors, each team using at most t colors). 2. Made the key observation that in any color-identifiable set S, each chosen team must have an assigned color that appears in no other team of S (equivalently, the assigned colors are pairwise disjoint from all other teams’ color-sets). 3. Presented a valid deletion or greedy framework (e.g. iteratively delete a team all of whose colors are shared with other remaining teams, or greedily select a least-used color and remove related colors/teams), even if the proof that it produces at least \\lceil n/t\\rceil teams is incomplete. (Almost) 1. Proved the lower bound \\ge \\lceil n/t\\rceil using the deletion algorithm, but did not fully justify one local step (e.g. why the process stops with a color-identifiable set, or why all n colors remain present so the remaining number of teams is at least \\lceil n/t\\rceil). 2. Proved the lower bound via the color-greedy algorithm and correctly argued ‘at most t colors are removed per step’, but left a gap in the minimality argument that every remaining color still has a user, or did not clearly deduce that the selected teams can be assigned distinct identifying colors. 3. Established both bounds and stated g(n,t)=\\lceil n/t\\rceil, but made a minor definitional slip (typically mis-handling the word “any” in ‘no team is assigned any signature color of a different team’) in an example or sub-argument while the main proof structure is otherwise correct."}
{"split": "analysis", "source": "USATST-2017-P4", "category": "Operations and Strategies", "id": "USATST2017_4", "query": "You are cheating at a trivia contest. For each question, you can peek at each of the $n > 1$ other contestant's guesses before writing your own. For each question, after all guesses are submitted, the emcee announces the correct answer. A correct guess is worth $0$ points. An incorrect guess is worth $-2$ points for other contestants, but only $-1$ point for you, because you hacked the scoring system. After announcing the correct answer, the emcee proceeds to read out the next question. Show that if you are leading by $2^{n-1}$ points at any time, then you can surely win first place.", "ref_solution": "We will prove the result with $2^{n-1}$ replaced by the stronger bound $2^{n-2}+1$. We first make the following reductions. First, change the weights to be $+1$, $-1$, $0$ respectively for a correct answer, an incorrect answer by another contestant, and an incorrect answer by you (rather than $0$, $-2$, $-1$); this has no effect on the relative score differences. Without loss of generality, assume that all contestants except you initially have a score of zero, and that your score exceeds $2^{n-2}$. We may ignore rounds in which all answers are the same. Finally, we can ignore rounds in which you get the correct answer, since that leaves you at least as well off relative to the other contestants as before. In other words, we will assume your score is always fixed, but you can pick any group of people with the same answer and ensure they lose $1$ point, while the group of people with the correct answer gains $1$ point.\n\nThe key observation is the following. Consider two rounds $R_1$ and $R_2$ such that: in round $R_1$, some set $S$ of contestants gains a point; in round $R_2$, the set $S$ of contestants all have the same answer. Then, if we copy the answers of contestants in $S$ during $R_2$ (which is an incorrect answer, as we ignore rounds where we answer correctly), they lose a point in $R_2$, which cancels out the point they gained in $R_1$. For any contestant not in $S$, they lost a point in $R_1$ and gain at most one point in $R_2$, so their net score change across the two rounds is at most $0$. In other words, the combined effect of $R_1$ and $R_2$ does not increase any contestant's score, so we can ignore $R_1$ and $R_2$ forever.\n\nWe thus consider the following strategy. We keep a list $\\mathcal{L}$ of subsets of $\\{1, \\dots, n\\}$, initially empty. On each round, we apply the following rules:\nSuppose there exists a set $S$ of people with the same answer such that $S \\in \\mathcal{L}$. (If multiple such sets exist, choose one arbitrarily.) Then, copy the answer of $S$, causing them to lose a point. Delete $S$ from $\\mathcal{L}$. (Importantly, we do not add any new sets to $\\mathcal{L}$ in this case.)\n\nOtherwise, copy the answer of any set $T$ of contestants, selecting $T$ such that $|T| \\ge n/2$ if possible. Let $S$ be the set of contestants who answer correctly (if any), and add $S$ to the list $\\mathcal{L}$. Note that $|S| \\le n/2$; if a set of size at least $n/2$ exists, we chose $|T| \\ge n/2$, and since $S$ is disjoint from $T$ (as we assume we did not copy the correct answer), $|S| \\le n - |T| \\le n/2$. If no set of size at least $n/2$ exists, then $|S| < n/2$ holds automatically.\n\nBy construction, $\\mathcal{L}$ has no duplicate sets. So the score of any contestant $c$ is bounded above by the number of times that $c$ appears among sets in $\\mathcal{L}$. The number of sets in $\\mathcal{L}$ containing $c$ is at most the number of subsets of $\\{1, \\dots, n\\}$ containing $c$ of size at most $n/2$. This is equivalent to the number of subsets of an $(n-1)$-element set of size at most $(n-2)/2$, which is at most $\\frac{1}{2} \\cdot 2^{n-1} = 2^{n-2}$. So, if you lead by $2^{n-2}+1$, then you ensure victory. This completes the proof.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Makes the standard reduction to an equivalent \"+1/-1/0\" scoring (or otherwise argues that only score differences matter) and assumes WLOG that only other contestants’ scores need to be controlled while your score stays fixed. 2. States and correctly justifies the key two-round cancellation idea: if a set S gained in some earlier round and later all contestants in S give the same answer, then by copying that answer in the later round one can ensure the earlier gain of S is neutralized while no other contestant’s total increases across the two rounds. 3. Introduces the bookkeeping strategy of maintaining a list/multiset of previously correct sets S and: (i) when a current equal-answer group matches an S on the list, copy them and delete S; (ii) otherwise copy some large equal-answer group and add the current correct set S to the list, with an explanation why the added sets have size at most n/2. (Almost) 1. Presents the full list-of-sets strategy and proves an upper bound on every opponent’s score via counting appearances in the list, but has a small gap in the combinatorial estimate (e.g., bounding the number of subsets containing a fixed contestant of size ≤ n/2) or mishandles the parity/boundary case when n is odd. 2. Completes the argument that no opponent can ever exceed your initial lead (hence you win) but does not fully justify one reduction step (e.g., “ignore rounds where all answers are the same” or “ignore rounds where you answer correctly”) or does not clearly argue that duplicates cannot appear in the maintained list. 3. Solution is almost complete, but made minor mistakes which are not negligible."}
{"split": "analysis", "source": "USATST-2015-P3", "category": "Operations and Strategies", "id": "USATST2015_3", "query": "A physicist encounters $2015$ atoms called usamons. Each usamon either has one electron or zero electrons, and the physicist can't tell the difference. The physicist's only tool is a diode. The physicist may connect the diode from any usamon $A$ to any other usamon $B$. (This connection is directed.) When she does so, if usamon $A$ has an electron and usamon $B$ does not, then the electron jumps from $A$ to $B$. In any other case, nothing happens. In addition, the physicist cannot tell whether an electron jumps during any given step. The physicist's goal is to isolate two usamons that she is 100 % sure are currently in the same state. Is there any series of diode usage that makes this possible?", "ref_solution": "The answer is no.\n\nLet $m = 2015$ and label the usamons $U_1, \\dots, U_m$. Consider a family of $m+1$ initial configurations, which we will call models $M_0, M_1, \\dots, M_m$. In model $M_k$ (for $0 \\le k \\le m$), the usamons $U_1, \\dots, U_k$ are charged (each has one electron) and the remaining usamons $U_{k+1}, \\dots, U_m$ are uncharged. Note that in this set of models, for any pair of distinct usamons, there is a model where they are in different states by construction. Specifically, if $a < b$, then in model $M_a$, $U_a$ is charged and $U_b$ is uncharged.\n\nWe can consider the physicist as acting on these $m+1$ models simultaneously. To be 100% sure that two usamons are in the same state, the physicist must be able to reach a state where some pair of usamons has the same charge across all possible models. Thus, reaching a state where a pair is identical across our $m+1$ models is a necessary condition for a winning strategy to exist.\n\nWe claim that any diode operation $U_i \\to U_j$ results in the $m+1$ models being an isomorphic copy of the previous set. Suppose the current set of models is defined by some ordering $V_1, \\dots, V_m$ of the usamons, where in model $M_k$, the first $k$ usamons $V_1, \\dots, V_k$ are charged and the rest are uncharged. Consider a diode operation directed from $V_i$ to $V_j$:\n- If $i < j$: \n - In models $M_0, \\dots, M_{i-1}$, neither $V_i$ nor $V_j$ is charged, so nothing happens.\n - In models $M_i, \\dots, M_{j-1}$, $V_i$ is charged and $V_j$ is uncharged. The electron jumps from $V_i$ to $V_j$, meaning $V_i$ becomes uncharged and $V_j$ becomes charged.\n - In models $M_j, \\dots, M_m$, both $V_i$ and $V_j$ are charged, so nothing happens.\n The net effect across all models is exactly the same as swapping the positions of $V_i$ and $V_j$ in the ordering. The new set of models is simply defined by the permuted ordering, which preserves the overall structure of the set of models.\n- If $i > j$:\n - In models $M_0, \\dots, M_{j-1}$, neither is charged, so nothing happens.\n - In models $M_j, \\dots, M_{i-1}$, $V_j$ is charged and $V_i$ is uncharged. The diode allows an electron to jump from $V_i$ to $V_j$, but since $V_i$ is empty, nothing happens.\n - In models $M_i, \\dots, M_m$, both are charged, so nothing happens.\n Thus, if $i > j$, the operation never does anything in any of the $m+1$ models.\n\nBy induction, after any sequence of diode operations, the set of $m+1$ possible states of the system is isomorphic to the initial set of prefix models, simply corresponding to a permuted ordering of the usamons. Because this structure is preserved, it remains true that for any pair of usamons, there is always some model where one is charged and the other is uncharged. Therefore, no pair of usamons can ever be guaranteed to be in the same state, and the physicist cannot achieve her goal.", "ref_answer": "", "grading_guidelines": "(Partial) 1. Introduced (explicitly) a finite family of candidate initial configurations/models, e.g. the “prefix” models with 0,1,2,…,2015 electrons in a fixed order, and observed that for any fixed pair of usamons there is a model in which they are in different states. 2. Showed that to be 100% sure two given usamons are equal, they must be equal in every configuration still consistent with the physicist’s observations (equivalently, across all tracked models, since no feedback is received from diode uses). 3. Proved a correct invariant/transition rule for these models under one diode operation, e.g. that applying a diode between positions i<j swaps the two positions in the prefix-order family (or otherwise preserves the “all prefixes of an ordering” structure), and/or that for i>j the operation does nothing on this family. (Almost) 1. Gave the prefix-model counterexample and correctly argued that every diode operation preserves the family up to relabeling (permuting the underlying ordering), but did not fully justify one of the two direction cases (i<j vs i>j) or did not clearly state why the family remains of the same form after the operation. 2. Proved the preservation up to permutation and concluded that no pair can ever be forced equal, but left a small logical gap connecting “no pair is equal in all models” to “physicist can never be 100% sure”, or did not explicitly argue that the absence of feedback means all tracked models remain possible. 3. Solution is almost complete, but made minor mistakes which are not negligible."}