problem: 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.

solution: 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 $p<q$ are distinct primes dividing $n$. Reorder the divisors $d_{i}$ so that $d_{1}=q$. Then $p, q \in I_{1}$, and so $I_{1}$ should contain strictly fewer than $\varphi\left(d_{1}\right)=q-1$ elements relatively prime to $n$, hence the inequality is strict.


solution: The equality case is $n=p^{e}$ for $p$ prime and a positive integer $e$. It is easy to check that this works. I Second solution (Ivan Borsenco and Evan Chen). Let $n=p_{1}^{e_{1}} \ldots p_{k}^{e_{k}}$, where $p_{1}<p_{2}<\ldots$. We are going to assume $k \geq 2$, since the $k=1$ case was resolved in the very beginning, and prove the strict inequality.  For a general $N$, the number of relatively prime integers in $[1, N]$ is given exactly by  $$ f(N)=N-\sum_{i}\left\lfloor\frac{N}{p_{i}}\right\rfloor+\sum_{i<j}\left\lfloor\frac{N}{p_{i} p_{j}}\right\rfloor-\ldots $$  according to the inclusion-exclusion principle. So, we wish to show that $f(\sigma(n))<n$ (as $k \geq 2$ ). Discarding the error terms from the floors (noting that we get at most 1 from the negative floors) gives  $$ \begin{aligned} f(N) & <2^{k-1}+N-\sum_{i} \frac{N}{p_{i}}+\sum_{i<j} \frac{N}{p_{i} p_{j}}-\ldots \\ & =2^{k-1}+N \prod_{i}\left(1-p_{i}^{-1}\right) \\ & =2^{k-1}+\prod_{i}\left(1-p_{i}^{-1}\right)\left(1+p_{i}+p_{i}^{2}+\cdots+p_{i}^{e_{i}}\right) \\ & =2^{k-1}+\prod_{i}\left(p_{i}^{e_{i}}-p_{i}^{-1}\right) . \end{aligned} $$   $$ \begin{aligned} f(N) & <2+\left(p_{1}^{e_{1}}-p_{1}^{-1}\right)\left(p_{2}^{e_{2}}-p_{2}^{-1}\right) \\ & =2+n-\frac{p_{2}^{e_{2}}}{p_{1}}-\frac{p_{1}^{e_{1}}}{p_{2}}+\frac{1}{p_{1} p_{2}} \\ & \leq 2+n-\frac{p_{2}}{p_{1}}-\frac{p_{1}}{p_{2}}+\frac{1}{p_{1} p_{2}} \\ & =n+\frac{1-\left(p_{1}-p_{2}\right)^{2}}{p_{1} p_{2}} \leq n \end{aligned} $$  On the other hand if $k \geq 3$ we may now write  $$ \begin{aligned} f(N) & <2^{k-1}+\left[\prod_{i=2}^{k-1}\left(p_{i}^{e_{i}}\right)\right]\left(p_{1}^{e_{1}}-p_{1}^{-1}\right) \\ & =2^{k-1}+n-\frac{p_{2}^{e_{2}} \ldots p_{k}^{e_{k}}}{p_{1}} \\ & \leq 2^{k-1}+n-\frac{p_{2} p_{3} \ldots p_{k}}{p_{1}} . \end{aligned} $$  If $p_{1}=2$, then one can show by induction that $p_{2} p_{3} \ldots p_{k} \geq 2^{k+1}-1$, which implies the result. If $p_{1}>2$, 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.


problem: 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} $$

solution: 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.


solution: We claim that the only functions $f$ are constant functions. (It is easy to see that they work.) 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 .


solution: We claim that the only functions $f$ are constant functions. (It is easy to see that they work.) 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 $a<b$,  $$ \operatorname{Pr}\left[\lim _{n \rightarrow \infty} f\left((x, y)+X_{1}+X_{2}+\cdots+X_{n}\right) \in[a, b]\right] \in\{0,1\} $$  Hence, there exists a single value $v$ such that with probability 1 ,  $$ \operatorname{Pr}\left[\lim _{n \rightarrow \infty} f\left((x, y)+X_{1}+X_{2}+\cdots+X_{n}\right)=v\right]=1 $$  Obviously, this value $v$ must equal $f(x, y)$. Now, we show this value $v$ is the same for all $(x, y)$. Note that any two starting points have a positive chance of meeting. Therefore, we are done.


problem: 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?

solution: In graph theoretic terms: we wish to determine the maximum possible value of  $$ S(G):=\sum_{e=v w} \min (\operatorname{deg} v, \operatorname{deg} w) $$  across all graphs $G$ with 2017 edges. We claim the answer is $63 \cdot\binom{64}{2}+1=127009$. 【 First solution (combinatorial, Evan Chen). First define $L_{k}$ to consist of a clique on $k$ vertices, plus a single vertex connected to exactly one vertex of the clique. Hence $L_{k}$ has $k+1$ vertices, $\binom{k}{2}+1$ edges, and $S\left(L_{k}\right)=(k-1)\binom{k}{2}+1$. In particular, $L_{64}$ achieves the claimed maximum, so it suffices to prove the upper bound.  ## Lemma  Let $G$ be a graph such that either  - $G$ has $\binom{k}{2}$ edges for some $k \geq 3$ or - $G$ has $\binom{k}{2}+1$ edges for some $k \geq 4$.  Then there exists a graph $G^{*}$ with the same number of edges such that $S\left(G^{*}\right) \geq S(G)$, and moreover $G^{*}$ has a universal vertex (i.e. a vertex adjacent to every other vertex).   1. Suppose $n=k$ and $m=\binom{k}{2}$. Then $G$ must be a clique so pick $G^{*}=G$. 2. Suppose $n=k+1$ and $m=\binom{k}{2}+1$. If $G$ has no universal vertex, we claim we may take $G^{*}=L_{k}$. Indeed each vertex of $G$ has degree at most $k-1$, and the average degree is  $$ \frac{2 m}{n}=\frac{k^{2}-k+2}{k+1}<k-1 $$  using here $k \geq 4$. Thus there exists a vertex $w$ of degree $1 \leq d \leq k-2$. The edges touching $w$ will have label at most $d$ and hence  $$ \begin{aligned} S(G) & \leq(k-1)(m-d)+d^{2}=(k-1) m-d(k-1-d) \\ & \leq(k-1) m-(k-2)=(k-1)\binom{k}{2}+1=S\left(G^{*}\right) \end{aligned} $$  Now we settle the inductive step. Let $w$ be a vertex with minimal degree $0 \leq d<k-1$, with neighbors $w_{1}, \ldots, w_{d}$. By our assumption, for each $w_{i}$ there exists a vertex $v_{i}$ for which $v_{i} w_{i} \notin E$. Now, we may delete all edges $w w_{i}$ and in their place put $v_{i} w_{i}$, and then delete the vertex $w$. This gives a graph $G^{\prime}$, possibly with multiple edges (if $v_{i}=w_{j}$ and $w_{j}=v_{i}$ ), and with one fewer vertex. ![](https://cdn.mathpix.com/cropped/2024_11_19_420dc3a54c986f92a77dg-08.jpg?height=296&width=828&top_left_y=525&top_left_x=613)  We then construct a graph $G^{\prime \prime}$ by taking any pair of double edges, deleting one of them, and adding any missing edge of $G^{\prime \prime}$ in its place. (This is always possible, since when $m=\binom{k}{2}$ we have $n-1 \geq k$ and when $m=\binom{k}{2}+1$ we have $n-1 \geq k+1$.)  Thus we have arrived at a simple graph $G^{\prime \prime}$ with one fewer vertex. We also observe that we have $S\left(G^{\prime \prime}\right) \geq S(G)$; after all every vertex in $G^{\prime \prime}$ has degree at least as large as it did in $G$, and the $d$ edges we deleted have been replaced with new edges which will have labels at least $d$. Hence we may apply the inductive hypothesis to the graph $G^{\prime \prime}$ to obtain $G^{*}$ with $S\left(G^{*}\right) \geq S\left(G^{\prime \prime}\right) \geq S(G)$.  The problem then is completed once we prove the following: Claim - For any graph $G$,  - If $G$ has $\binom{k}{2}$ edges for $k \geq 3$, then $S(G) \leq\binom{ k}{2} \cdot(k-1)$. - If $G$ has $\binom{k}{2}+1$ edges for $k \geq 4$, then $S(G) \leq\binom{ k}{2} \cdot(k-1)+1$.   Let $H$ be the subgraph obtained when $v$ is deleted. Then $m=\binom{k}{2}+\varepsilon-p$ is the number of edges in $H$; from $p \geq k-1+\varepsilon$ we have $m \leq\binom{ k-1}{2}$ and so we may apply the inductive hypothesis to $H$ to deduce $S(H) \leq\binom{ k-1}{2} \cdot(k-2)$. ![](https://cdn.mathpix.com/cropped/2024_11_19_420dc3a54c986f92a77dg-08.jpg?height=349&width=455&top_left_y=2004&top_left_x=795)  Now the labels of edges $v w_{i}$ have sum  $$ \sum_{i=1}^{p} \min \left(\operatorname{deg}_{G} v, \operatorname{deg}_{G} w_{i}\right)=\sum_{i=1}^{p} \operatorname{deg}_{G} w_{i}=\sum_{i=1}^{p}\left(\operatorname{deg}_{H} w_{i}+1\right)=2 m+p $$  For each of the edges contained in $H$, the label on that edge has increased by exactly 1, so those edges contribute $S(H)+m$. In total,  $$ \begin{aligned} S(G) & =2 m+p+(S(H)+m)=(m+p)+2 m+S(H) \\ & \leq\binom{ k}{2}+\varepsilon+2\binom{k-1}{2}+\binom{k-1}{2}(k-2)=\binom{k}{2}(k-1)+\varepsilon \end{aligned} $$


solution: In graph theoretic terms: we wish to determine the maximum possible value of  $$ S(G):=\sum_{e=v w} \min (\operatorname{deg} v, \operatorname{deg} w) $$  across all graphs $G$ with 2017 edges. We claim the answer is $63 \cdot\binom{64}{2}+1=127009$. 【I Second solution (algebraic, submitted by contestant James Lin). We give a different proof of $S(G) \leq 127009$. The proof proceeds using the following two claims, which will show that $S(G) \leq 127010$ for all graphs $G$. Then a careful analysis of the equality cases will show that this bound is not achieved for any graph $G$. Since the example $L_{64}$ earlier has $S\left(L_{64}\right)=127009$, this will solve the problem.  ## Lemma (Combinatorial bound)  Let $G$ be a graph with 2017 edges and let $d_{1} \geq d_{2} \geq \cdots \geq d_{n}$ be the degree sequence of the graph (thus $n \geq 65$ ). Then  $$ S(G) \leq d_{2}+2 d_{3}+3 d_{4}+\cdots+63 d_{64}+d_{65} $$   $$ S(G)=\sum_{i=1}^{n} a_{i} d_{i} $$  The inequality $\sum a_{i} d_{i} \leq d_{2}+2 d_{3}+3 d_{4}+\cdots+63 d_{64}+d_{65}$ then follows for smoothing reasons (by "smoothing" the $a_{i}$ ), since the $d_{i}$ are monotone. This proves the given inequality.  Once we have this property, we handle the bounding completely algebraically.  ## Lemma (Algebraic bound)  Let $x_{1} \geq x_{2} \geq \cdots \geq x_{65}$ be any nonnegative integers such that $\sum_{i=1}^{65} x_{i} \leq 4034$. Then  $$ x_{2}+2 x_{3}+\cdots+63 x_{64}+x_{65} \leq 127010 $$  Moreover, equality occurs if and only if $x_{1}=x_{2}=x_{3}=\cdots=x_{64}=63$ and $x_{65}=2$.   - Suppose there are indices $1 \leq i<j \leq 64$ such that $x_{i}>x_{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} $$  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.


problem: 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$.

solution: 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$.   $$ 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.


solution: Let $M$ denote the majority function (of any length). 【 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}$.  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$.)


problem: 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$.

solution: 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.   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.


solution: 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.   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. 【 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$.


solution: 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.   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 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<E X$ and $E N<E Y$. As above we concluded $E M / E X=E N / E Y$ and so $\overline{M N} \| \overline{X Y} \Longrightarrow \overline{X Y} \perp \overline{A H C}$.  Now consider an inversion at $H$ which swaps $B \leftrightarrow D$ and $A \leftrightarrow C$. The point $E$ goes to $E^{*}$ diametrically opposite $A$. Points $X$ and $Y$ go to points on $X^{*} \in \overline{A D}$ and $Y^{*} \in \overline{A B}$. Since the reflection of $E$ across $\overline{P X}$ is supposed to lie on $(B A E)$, it follows that the circumcenter of $\triangle H X^{*} E^{*}$ lies on $\overline{A D}$. Consequently $X^{*}$ plays the role of point " $T$ " in the IMO problem. Then $Y^{*}$ plays the role of point " $S$ " in the IMO problem.  Now the fact that $\left(H X^{*} Y^{*}\right)$ is tangent to $\overline{B D}$ is equivalent to $\overline{X Y} \perp \overline{A H C}$ which we already knew.


problem: 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.)

solution: Clearly Bob can compute the number $N$ of points. The main claim is that: Claim - Fix $m$ and $n$ as in the problem statement. Among all sets $T \subseteq \mathbb{Z}^{2}$ with $N$ points, the set $S$ is the unique one which maximizes the value of  $$ F(T):=\sum_{(x, y) \in T}\left(x^{2}+y^{2}\right)\left(m+n-\left(x^{2}+y^{2}\right)\right) . $$  As a result of this observation, it suffices to show that Bob has enough information to compute $F(S)$ from the data given. (There is no issue with fixing $m$ and $n$, since Bob can find an upper bound on the magnitude of the points and then check all pairs ( $m, n$ ) smaller than that.) The idea is that he knows the full distribution of each of $X, Y$, $X+Y, X-Y$ and hence can compute sums over $T$ of any power of a single one of those linear functions. By taking linear combinations we can hence compute $F(S)$.  Let us make the relations explicit. For ease of exposition we take $Z=(X, Y)$ to be a uniformly random point from the set $S$. The information is precisely the individual distributions of $X, Y, X+Y$, and $X-Y$. Now compute  $$ \begin{aligned} \frac{F(S)}{N} & =\mathbb{E}\left[(m+n)\left(X^{2}+Y^{2}\right)-\left(X^{2}+Y^{2}\right)^{2}\right] \\ & =(m+n)\left(\mathbb{E}\left[X^{2}\right]+\mathbb{E}\left[Y^{2}\right]\right)-\mathbb{E}\left[X^{4}\right]-\mathbb{E}\left[Y^{4}\right]-2 \mathbb{E}\left[X^{2} Y^{2}\right] \end{aligned} $$  On the other hand,  $$ \mathbb{E}\left[X^{2} Y^{2}\right]=\frac{\mathbb{E}\left[(X+Y)^{4}\right]+\mathbb{E}\left[(X-Y)^{4}\right]-2 \mathbb{E}\left[X^{4}\right]-2 \mathbb{E}\left[Y^{4}\right]}{12} $$  Thus we have written $F(S)$ in terms of the distributions of $X, Y, X-Y, X+Y$ which completes the proof.   - An obstruction to purely combinatorial arguments is that if you take an octagon with points $( \pm a, \pm b)$ and $( \pm b, \pm a)$ then the two ways to pick every other point (going around clockwise) are indistinguishable by Bob. This at least shows that Bob's task is far from possible in general, and hints at proving an inequality. - A related and more standard fact (among a certain type of person) is that given a probability distribution $\mu$ on $\mathbb{R}^{n}$, if I tell you the distribution of all 1-dimensional projections of $\mu$, that determines $\mu$ uniquely. This works because this information gives me the Fourier transform $\hat{\mu}$, and Fourier transforms are injective. For the continuum version of this problem, this connection gives a much larger family of counterexamples to any proposed extension to arbitrary non-annular shapes. Indeed, take a fast-decaying smooth function $f: \mathbb{R}^{2} \rightarrow \mathbb{R}$ which vanishes on the four lines  $$ x=0, y=0, x+y=0, x-y=0 . $$  Then the Fourier transform $\hat{f}$ will have mean 0 on each line $\ell$ as in the problem statement. Hence the positive and negative parts of $\hat{f}$ will not be distinguishable by Bob.