# USA IMO TST 2018 Solutions
United States of America - IMO Team Selection Tests
Evan Chen《陳誼廷》 $59^{\text {th }}$ IMO 2018 Romania ## Contents 0 Problems ..... 2 1 Solutions to Day 1 ..... 3 1.1 USA TST 2018/1, proposed by Ashwin Sah ..... 3 1.2 USA TST 2018/2, proposed by Michael Kural, Yang Liu ..... 5 1.3 USA TST 2018/3, proposed by Evan Chen ..... 7 2 Solutions to Day 2 ..... 12 2.1 USA TST 2018/4, proposed by Josh Brakensiek ..... 12 2.2 USA TST 2018/5, proposed by Evan Chen ..... 14 2.3 USA TST 2018/6, proposed by Mark Sellke ..... 16 ## §0 Problems 1. Let $n \geq 2$ be a positive integer, and let $\sigma(n)$ denote the sum of the positive divisors of $n$. Prove that the $n^{\text {th }}$ smallest positive integer relatively prime to $n$ is at least $\sigma(n)$, and determine for which $n$ equality holds. 2. Find all functions $f: \mathbb{Z}^{2} \rightarrow[0,1]$ such that for any integers $x$ and $y$, $$ f(x, y)=\frac{f(x-1, y)+f(x, y-1)}{2} $$ 3. At a university dinner, there are 2017 mathematicians who each order two distinct entrées, with no two mathematicians ordering the same pair of entrées. The cost of each entrée is equal to the number of mathematicians who ordered it, and the university pays for each mathematician's less expensive entrée (ties broken arbitrarily). Over all possible sets of orders, what is the maximum total amount the university could have paid? 4. 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}, \ldots, x_{2 k+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^{\text {th }}$ bit of $y$ is the most common bit among the $i^{\text {th }}$ bits of $x_{1}, \ldots, x_{2 k+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 $2 k+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$. 5. Let $A B C D$ be a convex cyclic quadrilateral which is not a kite, but whose diagonals are perpendicular and meet at $H$. Denote by $M$ and $N$ the midpoints of $\overline{B C}$ and $\overline{C D}$. Rays $M H$ and $N H$ meet $\overline{A D}$ and $\overline{A B}$ at $S$ and $T$, respectively. Prove there exists a point $E$, lying outside quadrilateral $A B C D$, such that - ray $E H$ bisects both angles $\angle B E S, \angle T E D$, and - $\angle B E N=\angle M E D$. 6. Alice and Bob play a game. First, Alice secretly picks a finite set $S$ of lattice points in the Cartesian plane. Then, for every line $\ell$ in the plane which is horizontal, vertical, or has slope +1 or -1 , she tells Bob the number of points of $S$ that lie on $\ell$. Bob wins if he can then determine the set $S$. Prove that if Alice picks $S$ to be of the form $$ S=\left\{(x, y) \in \mathbb{Z}^{2} \mid m \leq x^{2}+y^{2} \leq n\right\} $$ for some positive integers $m$ and $n$, then Bob can win. (Bob does not know in advance that $S$ is of this form.) ## §1 Solutions to Day 1 ## §1.1 USA TST 2018/1, proposed by Ashwin Sah Available online at https://aops.com/community/p9513094. ## Problem statement Let $n \geq 2$ be a positive integer, and let $\sigma(n)$ denote the sum of the positive divisors of $n$. Prove that the $n^{\text {th }}$ smallest positive integer relatively prime to $n$ is at least $\sigma(n)$, and determine for which $n$ equality holds. The equality case is $n=p^{e}$ for $p$ prime and a positive integer $e$. It is easy to check that this works. 【 First solution. In what follows, by $[a, b]$ we mean $\{a, a+1, \ldots, b\}$. First, we make the following easy observation. Claim - If $a$ and $d$ are positive integers, then precisely $\varphi(d)$ elements of $[a, a+d-1]$ are relatively prime to $d$. Let $d_{1}, d_{2}, \ldots, d_{k}$ denote denote the divisors of $n$ in some order. Consider the intervals $$ \begin{aligned} I_{1} & =\left[1, d_{1}\right] \\ I_{2} & =\left[d_{1}+1, d_{1}+d_{2}\right] \\ & \vdots \\ I_{k} & =\left[d_{1}+\cdots+d_{k-1}+1, d_{1}+\cdots+d_{k}\right] . \end{aligned} $$ of length $d_{1}, \ldots, d_{k}$ respectively. The $j$ th interval will have exactly $\varphi\left(d_{j}\right)$ elements which are relatively prime $d_{j}$, hence at most $\varphi\left(d_{j}\right)$ which are relatively prime to $n$. Consequently, in $I=\bigcup_{j=1}^{k} I_{k}$ there are at most $$ \sum_{j=1}^{k} \varphi\left(d_{j}\right)=\sum_{d \mid n} \varphi(d)=n $$ integers relatively prime to $n$. On the other hand $I=[1, \sigma(n)]$ so this implies the inequality. We see that the equality holds for $n=p^{e}$. Assume now $p2$, then one can again show by induction $p_{3} \ldots p_{k} \geq 2^{k}-1$ (since $p_{3} \geq 7$ ), which also implies the result. ## §1.2 USA TST 2018/2, proposed by Michael Kural, Yang Liu Available online at https://aops.com/community/p9513099. ## Problem statement Find all functions $f: \mathbb{Z}^{2} \rightarrow[0,1]$ such that for any integers $x$ and $y$, $$ f(x, y)=\frac{f(x-1, y)+f(x, y-1)}{2} $$ We claim that the only functions $f$ are constant functions. (It is easy to see that they work.) TI First solution (hands-on). First, iterating the functional equation relation to the $n$th level shows that $$ f(x, y)=\frac{1}{2^{n}} \sum_{i=0}^{n}\binom{n}{i} f(x-i, y-(n-i)) $$ In particular, $$ \begin{aligned} |f(x, y)-f(x-1, y+1)| & =\frac{1}{2^{n}}\left|\sum_{i=0}^{n+1} f(x-i, y-(n-i)) \cdot\left(\binom{n}{i}-\binom{n}{i-1}\right)\right| \\ & \leq \frac{1}{2^{n}} \sum_{i=0}^{n+1}\left|\binom{n}{i}-\binom{n}{i-1}\right| \\ & =\frac{1}{2^{n}} \cdot 2\binom{n}{\lfloor n / 2\rfloor} \end{aligned} $$ where we define $\binom{n}{n+1}=\binom{n}{-1}=0$ for convenience. Since $$ \binom{n}{\lfloor n / 2\rfloor}=o\left(2^{n}\right) $$ it follows that $f$ must be constant. Remark. A very similar proof extends to $d$ dimensions. I Second solution (random walks, Mark Sellke). We show that if $x+y=x^{\prime}+y^{\prime}$ then $f(x, y)=f\left(x^{\prime}, y^{\prime}\right)$. Let $Z_{n}, Z_{n}^{\prime}$ be random walks starting at $(x, y)$ and $\left(x^{\prime}, y^{\prime}\right)$ and moving down/left. Then $f\left(Z_{n}\right)$ is a martingale so we have $$ \mathbb{E}\left[f\left(Z_{n}\right)\right]=f(x, y), \quad \mathbb{E}\left[f\left(Z_{n}^{\prime}\right)\right]=f\left(x^{\prime}, y^{\prime}\right) $$ We'll take $Z_{n}, Z_{n}^{\prime}$ to be independent until they hit each other, after which they will stay together. Then $$ \left|\mathbb{E}\left[f\left(Z_{n}\right)-f\left(Z_{n}^{\prime}\right)\right]\right| \leq \mathbb{E}\left[\left|f\left(Z_{n}\right)-f\left(Z_{n}^{\prime}\right)\right|\right] \leq p_{n} $$ where $p_{n}$ is the probability that $Z_{n}, Z_{n}^{\prime}$ never collide. But the distance between $Z_{n}, Z_{n}^{\prime}$ is essentially a 1 -dimensional random walk, so they will collide with probability 1 , meaning $\lim _{n \rightarrow \infty} p_{n}=0$. Hence $$ \left|f(x, y)-f\left(x^{\prime}, y^{\prime}\right)\right|=\left|\mathbb{E}\left[f\left(Z_{n}\right)-f\left(Z_{n}^{\prime}\right)\right]\right|=o(1) $$ as desired. Remark. If the problem were in $\mathbb{Z}^{d}$ for large $d$, this solution wouldn't work as written because the independent random walks wouldn't hit each other. However, this isn't a serious problem because $Z_{n}, Z_{n}^{\prime}$ don't have to be independent before hitting each other. Indeed, if every time $Z_{n}, Z_{n}^{\prime}$ agree on a new coordinate we force them to agree on that coordinate forever, we can make the two walks individually have the distribution of a coordinate-decreasing random walk but make them intersect eventually with probability 1. The difference in each coordinate will be a 1-dimensional random walk which gets stuck at 0 . I Third solution (martingales). Imagine starting at $(x, y)$ and taking a random walk down and to the left. This is a martingale. As $f$ is bounded, this martingale converges with probability 1 . Let $X_{1}, X_{2}, \ldots$ each be random variables that represent either down moves or left moves with equal probability. Note that by the Hewitt-Savage 0-1 law, we have that for any real numbers $ax_{i+1} \geq x_{j-1}>x_{j}$. Then replacing $\left(x_{i}, x_{j}\right)$ by $\left(x_{i}-1, x_{j}+1\right)$ strictly increases $A$ preserving all conditions. Thus we may assume all numbers in $\left\{x_{1}, \ldots, x_{64}\right\}$ differ by at most 1 . - Suppose $x_{65} \geq 4$. Then we can replace $\left(x_{1}, x_{2}, x_{3}, x_{4}, x_{65}\right)$ by $\left(x_{1}+1, x_{2}+1, x_{3}+\right.$ $\left.1, x_{4}+1, x_{65}-4\right)$ and strictly increase $A$. Hence we may assume $x_{65} \leq 3$. We will also tacitly assume $\sum x_{i}=4034$, since otherwise we can increase $x_{1}$. These two properties leave only four sequences to examine: - $x_{1}=x_{2}=x_{3}=\cdots=x_{63}=63, x_{64}=62$, and $x_{65}=3$, which gives $A=126948$. - $x_{1}=x_{2}=x_{3}=\cdots=x_{63}=x_{64}=63$ and $x_{65}=2$, which gives $A=127010$. - $x_{1}=64, x_{2}=x_{3}=\cdots=x_{63}=x_{64}=63$ and $x_{65}=1$, which gives $A=127009$. - $x_{1}=x_{2}=64, x_{3}=\cdots=x_{63}=x_{64}=63$ and $x_{65}=0$, which gives $A=127009$. This proves that $A \leq 127010$. To see that equality occurs only in the second case above, note that all the smoothing operations other than incrementing $x_{1}$ were strict, and that $x_{1}$ could not have been incremented in this way as $x_{1}=x_{2}=63$. This shows that $S(G) \leq 127010$ for all graphs $G$, so it remains to show equality never occurs. Retain the notation $d_{i}$ and $a_{i}$ of the combinatorial bound now; we would need to have $d_{1}=\cdots=d_{64}=63$ and $d_{65}=2$ (in particular, deleting isolated vertices from $G$, we may assume $n=65$ ). In that case, we have $a_{i} \leq i-1$ but also $a_{65}=2$ by definition (the last vertex gets all edges associated to it). Finally, $$ \begin{aligned} S(G) & =\sum_{i=1}^{n} a_{i} d_{i}=63\left(a_{1}+\cdots+a_{64}\right)+a_{65} \\ & =63\left(2017-a_{65}\right)+a_{65} \leq 63 \cdot 2015+2=126947 \end{aligned} $$ completing the proof. Remark. Another way to finish once $S(G) \leq 127010$ is note there is a unique graph (up to isomorphism and deletion of universal vertices) with degree sequence $\left(d_{1}, \ldots, d_{65}\right)=$ $(63, \ldots, 63,2)$. Indeed, the complement of the graph has degree sequence $(1, \ldots, 1,63)$, and so it must be a 63 -star plus a single edge. One can then compute $S(G)$ explicitly for this graph. ## 【 Some further remarks. Remark. Interestingly, the graph $C_{4}$ has $\binom{3}{2}+1=4$ edges and $S\left(C_{4}\right)=8$, while $S\left(L_{3}\right)=7$. This boundary case is visible in the combinatorial solution in the base case of the first claim. It also explains why we end up with the bound $S(G) \leq 127010$ in the second algebraic solution, and why it is necessary to analyze the equality cases so carefully; observe in $k=3$ the situation $d_{1}=d_{2}=d_{3}=d_{4}=2$. Remark. Some comments about further context for this problem: - The obvious generalization of 2017 to any constant was resolved in September 2018 by Mehtaab Sawhney and Ashwin Sah. The relevant paper is On the discrepancy between two Zagreb indices, published in Discrete Mathematics, Volume 341, Issue 9, pages 2575-2589. The arXiv link is https://arxiv.org/pdf/1801.02532.pdf. - The quantity $$ S(G)=\sum_{e=v w} \min (\operatorname{deg} v, \operatorname{deg} w) $$ in the problem has an interpretation: it can be used to provide a bound on the number of triangles in a graph $G$. To be precise, $\# E(G) \leq \frac{1}{3} S(G)$, since an edge $e=v w$ is part of at most $\min (\operatorname{deg} v, \operatorname{deg} w)$ triangles. - For planar graphs it is known $S(G) \leq 18 n-36$ and it is conjectured that for $n$ large enough, $S(G) \leq 18 n-72$. See https://mathoverflow.net/a/273694/70654. I Authorship comments. I came up with the quantity $S(G)$ in a failed attempt to provide a bound on the number of triangles in a graph, since this is natural to consider when you do a standard double-counting via the edges of the triangle. I think the problem was actually APMO 1989, and I ended up not solving the problem (the solution is much simpler), but the quantity $S(G)$ stuck in my head for a while after that. Later on that month I was keeping Danielle company while she was working on art project (flower necklace), and with not much to do except doodle on tables I began thinking about $S(G)$ again. I did have the sense that $S(G)$ should be maximized at a graph close to a complete graph. But to my frustration I could not prove it for a long time. Finally after many hours of trying various approaches I was able to at least show that $S(G)$ was maximized for complete graphs if the number of edges was a triangular number. I had come up with this in March 2016, which would have been perfect since 2016 is a triangular number, but it was too late to submit it to any contest (the USAMO and IMO deadlines were long past). So on December 31, 2016 I finally sat down and solved it for the case 2017, which took another few hours of thought, then submitted it to that year's IMO. To my dismay it was rejected, but I passed it along to the USA TST after that, thus making it just in time for the close of the calendar year. ## §2 Solutions to Day 2 ## §2.1 USA TST 2018/4, proposed by Josh Brakensiek Available online at https://aops.com/community/p9735607. ## Problem statement 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}, \ldots, x_{2 k+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^{\text {th }}$ bit of $y$ is the most common bit among the $i^{\text {th }}$ bits of $x_{1}, \ldots, x_{2 k+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 $2 k+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$. Let $M$ denote the majority function (of any length). 【 First solution (induction). We prove all $P_{k}$ are equivalent by induction on $n \geq 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$.) For the inductive step, we proceed by contradiction; assume $S$ satisfies $P_{\ell}$, but not $P_{k}$, so there exist $x_{1}, \ldots, x_{2 k+1} \in S$ whose majority $y=M\left(x_{1}, \ldots, x_{k}\right)$ is not in $S$. We contend that: Claim - Let $y_{i}$ be the string which differs from $y$ only in the $i^{\text {th }}$ bit. Then $y_{i} \in S$. Proof. For a string $s \in S$ we let $\hat{s}$ denote the string $s$ with the $i^{\text {th }}$ bit deleted (hence with $n-1$ bits). Now let $$ T=\{\hat{s} \mid s \in S\} $$ Since $S$ satisfies $P_{\ell}$, so does $T$; thus by the induction hypothesis on $n, T$ satisfies $P_{k}$. Consequently, $T \ni M\left(\hat{x}_{1}, \ldots, \hat{x}_{2 k+1}\right)=\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. Now 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. 【 Second solution (circuit construction). Note that $P_{k} \Longrightarrow P_{1}$ for any $k$, since $$ M(\underbrace{a, \ldots, a}_{k}, \underbrace{b, \ldots, b}_{k}, c)=M(a, b, c) $$ for any $a, b, c$. We will now prove $P_{1}+P_{k} \Longrightarrow P_{k+1}$ for any $k$, which will prove the result. Actually, we will show that the majority of any $2 k+3$ strings $x_{1}, \ldots, x_{2 k+3}$ can be expressed by 3 and $(2 k+1)$-majorities. WLOG assume that $M\left(x_{1}, \ldots, x_{2 k+3}\right)=0 \ldots 0$, and let $\odot$ denote binary AND. Claim - We have $M\left(x_{1}, x_{2}, M\left(x_{3}, \ldots, x_{2 k+3}\right)\right)=x_{1} \odot x_{2}$. Proof. Consider any particular bit. The result is clear if the bits are equal. Otherwise, if they differ, the result follows from the original hypothesis that $M\left(x_{1}, \ldots, x_{2 k+3}\right)=0 \ldots 0$ (removing two differing bits does not change the majority). By analogy we can construct any $x_{i} \odot x_{j}$. Finally, note that $$ M\left(x_{1} \odot x_{2}, x_{2} \odot x_{3}, \ldots, x_{2 k+1} \odot x_{2 k+2}\right)=0 \ldots 0 $$ as desired. (Indeed, if we look at any index, there were at most $k+1$ 's in the $x_{i}$ strings, and hence there will be at most $k$ 's among $x_{i} \odot x_{i+1}$ for $i=1, \ldots, 2 k+1$.) Remark. The second solution can be interpreted in circuit language as showing that all " $2 k+1$-majority gates" are equivalent. See also https://cstheory.stackexchange.com/ a/21399/48303, in which Valiant gives a probabilistic construction to prove that one can construct $(2 k+1)$-majority gates from a polynomial number of 3-majority gates. No explicit construction is known for this. ## §2.2 USA TST 2018/5, proposed by Evan Chen Available online at https://aops.com/community/p9735608. ## Problem statement Let $A B C D$ be a convex cyclic quadrilateral which is not a kite, but whose diagonals are perpendicular and meet at $H$. Denote by $M$ and $N$ the midpoints of $\overline{B C}$ and $\overline{C D}$. Rays $M H$ and $N H$ meet $\overline{A D}$ and $\overline{A B}$ at $S$ and $T$, respectively. Prove there exists a point $E$, lying outside quadrilateral $A B C D$, such that - ray $E H$ bisects both angles $\angle B E S, \angle T E D$, and - $\angle B E N=\angle M E D$. The main claim is that $E$ is the intersection of $(A B C D)$ with the circle with diameter $\overline{A H}$. ![](https://cdn.mathpix.com/cropped/2024_11_19_420dc3a54c986f92a77dg-14.jpg?height=1012&width=786&top_left_y=1050&top_left_x=635) The following observation can be quickly made without reference to $E$. ## Lemma We have $\angle H S A=\angle H T A=90^{\circ}$. Consequently, quadrilateral $B T S D$ is cyclic. Proof. This is direct angle chasing. In fact, $\overline{H M}$ passes through the circumcenter of $\triangle B H C$ and $\triangle H A D \sim \triangle H C B$, so $\overline{H S}$ ought to be the altitude of $\triangle H A D$. From here it follows that $E$ is the Miquel point of cyclic quadrilateral $B T S D$. Define $F$ to be the point diametrically opposite $A$, so that $E, H, F$ are collinear, $\overline{C F} \| \overline{B D}$. By now we already have $$ \measuredangle B E H=\measuredangle B E F=\measuredangle B A F=\measuredangle C A D=\measuredangle H A S=\measuredangle H E S $$ so $\overline{E H}$ bisects $\angle B E S$, and $\angle T E D$. Hence it only remains to show $\angle B E M=\angle N E D$; we present several proofs below. I First proof (original solution). Let $P$ be the circumcenter of $B T S D$. The properties of the Miquel point imply $P$ lies on the common bisector $\overline{E H}$ already, and it also lies on the perpendicular bisector of $\overline{B D}$, hence it must be the midpoint of $\overline{H F}$. We now contend quadrilaterals $B M P S$ and $D N P T$ are cyclic. Obviously $\overline{M P}$ is the external angle bisector of $\angle B M S$, and $P B=P S$, so $P$ is the arc midpoint of $(B M S)$. The proof for $D N P T$ is analogous. It remains to show $\angle B E N=\angle M E D$, or equivalently $\angle B E M=\angle N E D$. By properties of Miquel point we have $E \in(B M P S) \cap(T P N D)$, so $$ \measuredangle B E M=\measuredangle B P M=\measuredangle P B D=\measuredangle B D P=\measuredangle N P D=\measuredangle N E D $$ as desired. 【 Second proof (2011 G4). By 2011 G 4 , the circumcircle of $\triangle E M N$ is tangent to the circumcircle of $A B C D$. Hence if we extend $\overline{E M}$ and $\overline{E N}$ to meet $(A B C D)$ again at $X$ and $Y$, we get $\overline{X Y}\|\overline{M N}\| \overline{B D}$. Thus $\measuredangle B E M=\measuredangle B E X=\measuredangle Y E D=\measuredangle N E D$. I Third proof (involutions, submitted by Daniel Liu). Let $G=\overline{B N} \cap \overline{M D}$ denote the centroid of $\triangle B C D$, and note that it lies on $\overline{E H F}$. Now consider the dual of Desargues involution theorem on complete quadrilateral $B M D N C G$ at point $E$. We get $$ (E B, E D), \quad(E M, E N), \quad(E C, E G) $$ form an involutive pairing. However, the bisector of $\angle B E D$, say $\ell$, is also the angle bisector of $\angle C E F$ (since $\overline{C F} \| \overline{B D})$. So the involution we found must coincide with reflection across $\ell$. This means $\angle M E N$ is bisected by $\ell$ as well, as desired. 【 Authorship comments. This diagram actually comes from the inverted picture in IMO 2014/3 (which I attended). I had heard for many years that one could solve this problem quickly by inversion at $H$ afterwards. But when I actually tried to do it during an OTIS class years later, I ended up with the picture in the TST problem, and couldn't see why it was true! In the process of trying to reconstruct this rumored solution, I ended up finding most of the properties that ended up in the January TST problem (but were overkill for the original IMO problem). Let us make the equivalence explicit by deducing the IMO problem from our work. Let rays $E M$ and $E N$ meet the circumcircles of $\triangle B H C$ and $\triangle B N C$ again at $X$ and $Y$, with $E M