Let $ S = \{x_1, x_2, \ldots, x_{k + l}\}$ be a $ (k + l)$-element set of real numbers contained in the interval $ [0, 1]$; $ k$ and $ l$ are positive integers. A $ k$-element subset $ A\subset S$ is called nice if \[ \left |\frac {1}{k}\sum_{x_i\in A} x_i - \frac {1}{l}\sum_{x_j\in S\setminus A} x_j\right |\le \frac {k + l}{2kl}\] Prove that the number of nice subsets is at least $ \dfrac{2}{k + l}\dbinom{k + l}{k}$. Proposed by Andrey Badzyan, Russia
Problem
Source: IMO ShortList 2008, Combinatorics problem 5, German TST 2, P3, 2009
Tags: combinatorics, Probabilistic Method, counting, IMO Shortlist
10.07.2009 19:01
Let \[ f(A) = \frac{l ( \sum_{x_{i}\in A}x_{i} ) - k ( \sum_{x_{j}\in S\setminus A}x_{j} )}{k+l}.\] Rearrange the given condition to get $ A \text{ is nice} \Leftrightarrow |f(A)| \leq \frac{1}{2}$ (*). Let $ s_1, s_2, \ldots s_{k+l}$ be an arbitrary permutation of $ S$, and for $ i = 1, 2, \ldots k+l$, let $ A_i = \{s_i, s_{i+1}, \ldots s_{i+k-1} \}$ be $ k$-element subsets (we take the indices of the $ s_j$ mod $ k+l$). Consider $ f(A_{i+1}) - f(A_i)$. $ A_i$ and $ A_{i+1}$ differ by one element. If $ u,v$ are the elements of $ S$ such that $ u \in A_i, u \notin A_{i+1}, v \notin A_i, v \in A_{i+1}$, then $ f(A_{i+1}) - f(A_i) = \frac{lv-ku-lu+kv}{k+1} = v-u$, so $ |f(A_{i+1}) - f(A_i)| \leq 1$ (1). Finally, it is easy to see that $ \sum_{i=1}^{k+l} f(A_i) = 0$ (2). Now consider $ f(A_1), f(A_2), \ldots f(A_{k+l})$. We want to show two of these satisfy (*). If all are $ 0$ then we are done. Otherwise there is a positive and a negative one by (2); suppose $ f(A_i), f(A_j)$ are positive and negative respectively. In $ f(A_i), f(A_{i+1}), \ldots f(A_j)$ (indices mod $ k+l$), let $ f(A_{x}), f(A_{x+1})$ be the two adjacent terms of the sequence where the sign flips. If $ |f(A_{x})|$ and $ |f(A_{x+1})|$ are both greater than $ \frac{1}{2}$, then this contradicts (1) by the triangle inequality. So one of $ A_x, A_{x+1}$ is nice. Now repeat the same argument on $ f(A_j), f(A_{j+1}), \ldots f(A_i)$ to get a second nice subset. How many nice subsets did we actually find? There's $ (k+l)!$ permutations of $ S$, but we counted every subset of $ S$ $ (k+l)k! l!$ times. So that makes at least $ \frac{2}{k+l} \cdot \frac{(k+l)!}{k!l!}$ subsets, which is the same as the lower bound the problem gives.
19.01.2015 04:32
I have the same solution as above this is very very nice
22.05.2020 23:25
Solution from Twitch Solves ISL: We let $\Delta(A)$ denote the quantity in the absolute value as a function of $A$. Let $n = k+\ell$ for brevity. Consider a random permutation $\pi$ of $\{1, 2, \dots, n\}$. Look at the following $k+\ell$ sets, the ``cyclic shifts'': \begin{align*} A_1 &= \left\{ x_{\pi(1)}, x_{\pi(2)}, \dots, x_{\pi(k)} \right\} \\ A_2 &= \left\{ x_{\pi(2)}, x_{\pi(3)}, \dots, x_{\pi(k+1)} \right\} \\ A_3 &= \left\{ x_{\pi(3)}, x_{\pi(4)}, \dots, x_{\pi(k+2)} \right\} \\ &\vdotswithin{=} \\ A_{n-1} &= \left\{ x_{\pi(n-1)}, x_{\pi(n)}, \dots, x_{\pi(n-2)} \right\} \\ A_{n} &= \left\{ x_{\pi(n)}, x_{\pi(1)}, \dots, x_{\pi(n-1)} \right\}. \end{align*}We evidently have \[ \sum_1^{n} \Delta(A_i) = 0. \]However, any two consecutive $\Delta(A_i)$ are going to differ by at most $\delta \overset{\text{def}}{=} \frac 1k + \frac 1\ell$. However we note that: Lemma: If we have (cyclic) sequence of $n \ge 2$ numbers with mean zero, and whose consecutive terms differ by at most $\delta$, then there will always be at least two numbers with absolute value at most $\delta/2$. In other words, among these $n$ sets, there must be at least two nice ones, regardless of $\pi$. However, if $p$ is the fraction of $k$-element subsets which are nice, then the expected number of nice sets is exactly $n \cdot p$. So we conclude $p \ge \frac 2n$ as desired.
31.05.2020 02:17
Solved with eisirrational, goodbear, Th3Numb3rThr33. First we rephrase the condition: Claim: A \(k\)-element subset \(A\subset S\) is nice if and only if \[\left\lvert\sum_{x_i\in A}x_i-\mathop{\mathbb E}_A\left[\sum_{x_i\in A}x_i\right]\right\rvert\le\frac12.\] Proof. This is straightforward: \begin{align*} \left\lvert\frac1k\sum_{x_i\in A}x_i-\frac1\ell\sum_{x_j\in S\setminus A}x_j\right\rvert&\le\frac{k+\ell}{2k\ell}\\ \iff\left\lvert\frac{k+\ell}{k\ell}\sum_{x_i\in A}x_i-\frac1\ell\sum_{x_j\in S}x_j\right\rvert&\le\frac{k+\ell}{2k\ell}\\ \iff\left\lvert\sum_{x_i\in A}x_i-\frac k{k+\ell}\sum_{x_j\in S}x_j\right\rvert&\le\frac12, \end{align*}as claimed. \(\blacksquare\) Now we prove a stronger statement: \begin{quote} Let \((x_1,\ldots,x_{k+\ell})\) be any permutation of the elements of \(S\); then among the \(k+\ell\) cyclic shifts shown below \begin{align*} A_1&=\{x_1,x_2,\ldots,x_k\}\\ A_2&=\{x_2,x_3,\ldots,x_1\}\\ &\;\vdots\\ A_{k+\ell}&=\{x_{k+\ell},x_1,\ldots,x_{k-1}\}, \end{align*}at least two are nice. \end{quote} Note that the expected value of \(\sum_{x_i\in A}x_i\) where \(A\) is chosen from \(S\) is the same as the expected value where \(A\) is chosen from one of the \(k+\ell\) cyclic shifts. Observe that the quantity \[f(A):=\sum_{x_i\in A}x_i-\mathop{\mathbb E}_A\left[\sum_{x_i\in A}x_i\right]\]averages to zero. But \(\left\lvert f(A_i)-f(A_{i+1})\right\rvert\le1\) for each \(i\), so it \(f(A)\) is in the interval \([-\frac12,\frac12]\) at least twice.
29.06.2022 11:40
Let $S_1 = \sum_{x_i \in A} x_i$ and $S_t$ be the total sum of elements. Then $\left |\frac {1}{k}\sum_{x_i\in A} x_i - \frac {1}{l}\sum_{x_j\in S\setminus A} x_j\right |\leqslant \frac {k + l}{2kl}$ rearranges to $\left |S_1 - c \right| \leqslant \frac{1}{2}$, where $c = \frac{kS_t}{k+l}$. Let $y_1, y_2, \cdots, y_{k+l}$ be a random permutation of $S$ and consider the $k$ element subsets of the form $y_i, y_{i+1}, \cdots y_{i+k-1}$ where indices are taken mod $k+l$. The sum of values of $|S_1 - c|$ of these subsets is zero and among any consecutive subsets, as all elements are in $[0,1]$, the value changes by at most $1$. So its absolute value must be at most $\frac{1}{2}$ for at least $2$ of these permutations. Therefore, dividing all possible permutations and considering the cyclic shifts, out of $k+l$, at least $2$ are nice, so the number of nice subsets is at least $\frac{2}{k+l}$ of all the possible subsets, so at least $ \dfrac{2}{k + l}\dbinom{k + l}{k}$
13.11.2022 16:33
For given set $A\subset S$ define $$f(A)=\frac {1}{k}\sum_{x_i\in A} x_i - \frac {1}{l}\sum_{x_j\in S\setminus A} x_j.$$For an arbtrary permutation $y_1,y_2,...,y_{k+l}$ of $x_1,x_2,...,x_{k+l}$ (with cyclic numeration of indices) define set $A_i=\left \{ y_i,y_{i+1},...,y_{i+k-1}\right \};$ we may see that $\sum_{i=1}^{k+l} f(A_i)=0$ and $|f(A_i)-f(A_{i+1})|\leq \frac 1k +\frac 1l,$ so there at least two different values of $n$ such that $|f(A_n)|\leq \frac{k+l}{2kl},$ and all $A_n$ are nice. By considering all permutations and cyclic shifts we obtain that at least $\frac{2}{k+l}$ of all $\binom{k+l}{k}$ $k-$subsets are nice as desired.
22.02.2023 17:00
very nice combination of local and global Pick an arbitrary permutation $\sigma$ of $\{1,\ldots,k+l\}$ and consider the $k+l$ "cyclic" choices for $A$: \begin{align*} A_1&=\{x_{\sigma(1)},x_{\sigma(2)},\ldots,x_{\sigma(k)}\}\\ A_2&=\{x_{\sigma(2)},x_{\sigma(3)},\ldots,x_{\sigma(k+1)}\}\\ &\vdots\\ A_{k+l}&=\{x_{\sigma(k+l)},x_{\sigma(1)},\ldots,x_{\sigma(k+l-1)}\}. \end{align*}If we define $$f(A)=\frac{1}{k}\sum_{x_i \in A} x_i-\frac{1}{l} \sum_{x_j \in S \setminus A} x_j,$$then it is clear that $\sum_{i=1}^{k+l} f(A_i)=0$. On the other hand, we can see that $|f(A_{i+1})-f(A_i)|\leq \frac{k+l}{kl}$. We thus prove the following key claim. Claim: There exist at least two $A_i$ where $|f(A_i)|\leq \frac{k+l}{2kl}$. Proof: First off, if every $|f(A_i)| \leq \frac{k+l}{2kl}$, then we are clearly done because $k+l\geq 2$. Thus assume otherwise, so WLOG (by shifting and symmetry) we have $f(A_1)<-\frac{k+l}{2kl}$. If there also exists $i$ with $f(A_i)>\frac{k+l}{2kl}$, then by "discrete continuity" we must have some $1<j_1<i$ with $|f(A_{j_1})| \leq \frac{k+l}{2kl}$, since we cannot cross the interval $[-\frac{k+l}{2kl},\frac{k+l}{2kl}]$ without being within it. Likewise, we must have some $i<j_2<k+l+1$ where $|f(A_{j_2})|\leq \frac{k+l}{2kl}$. If such an $i$ does not exist, then suppose that we have $|f(A_j)|\leq \frac{k+l}{2kl}$, and $j$ is unique (otherwise we are simply done). On the other hand this means that $$\sum_{i=1}^{k+l} f(A_i)>(k+l-1)\cdot -\frac{k+l}{2kl}+\frac{k+l}{2kl}\geq 0,$$which contradicts the fact that the RHS sum must be exactly $0$. To finish, by performing a global sum across all choices of $\sigma$, we find that at the proportion of the $\binom{k+l}{k}$ $k$-element subsets which are nice is at least $\frac{2}{k+l}$, which is the desired bound. $\blacksquare$ Remark: For me it was easier to see what was going on in $f$ by writing everything in terms of $S:=\sum_{i=1}^{k+l} x_i$ and $\sum_{x_i \in A} x_i$, which also makes the discrete continuity idea a bit more clear, but "mathematically" there is no difference.
30.05.2024 21:37
We'll show that for each permutation of $S$, which we will denote $x_1, x_2, \dots, x_{k+l}$ without loss of generality, there exist two indices $i$ such that $\{x_i,x_{i+1},x_{i+2},\dots,x_{i+k-1}\}$ is a nice set, where indices are taken $\pmod {k+l}$. $~$ Let $f(A)$ denote the value \[\frac {1}{k}\sum_{x_i\in A} x_i - \frac {1}{l}\sum_{x_j\in S\setminus A} x_j\]and let $A_i$ denote the set $\{x_i,x_{i+1},x_{i+2},\dots,x_{i+k-1}$ then note that \[f(A_1)+f(A_2)+\dots+f(A_n)=0\]Consider $|f(A_i)-f(A_{i+1})|$. Note that to go from $f(A_i)$ to $f(A_{i+1})$ we are adding $(\tfrac{1}{k}+\tfrac{1}{l})(a_{i+k}-a_{i})$. Let $d=\tfrac{1}{k}+\tfrac{1}{l}$ then $|f(A_i)-f(A_{i+1})|\le d$. $~$ Now, we show that there are two $i$ such that $|f(A_i)|\le \tfrac{d}{2}$. Note that there must exist $j$ such that $f(A_j)\ge 0$ and $f(A_{j+1})\le 0$, then clearly either $j$ or $j+1$ satisfies the conditions. Furthermore, there exists $m$ such that $f(A_m)\le 0$ and $f(A_{m+1})\ge 0$ then clearly $m$ or $m+1$ satisfies the conditions. If the only instances where this happens are such that $\{j,j+1\}\cap\{m,m+1\}\neq \emptyset$ the cases are also easy to check.