I can’t solve the problem below, I tried assigning a value to each student based on the difference between the amount of girls in the k students in front of him (him included) and the amount of girls in the k students before him but I couldn’t figure it out. I also tried Bottom down induction but that also failed. Any ideas?
Combinatorics existence problem. IMO shortlist
combinatoricscontest-math
Related Solutions
If you know generating functions, then here is a solution:
Let $s_n$ denote the sum $\sum_{k \geq 0} \frac{(-1)^k}{n - k}\binom{n - k}k$ and let $S(X)$ be the formal power series $S(X) = \sum_{n \geq 1} s_n X^n$.
We compute:
\begin{eqnarray} S(X) &=& \sum_{n \geq 1} \frac 1 n X^n + \sum_{n \geq 1}\sum_{k \geq 1} \frac{(-1)^k}{n - k}\binom{n - k}k X^n\\ &=& -\log(1 - X) + \sum_{k \geq 1}\sum_{n \geq 2k}\frac{(-1)^k}k \binom{n - k - 1}{k - 1}X^n\\ &=& -\log(1 - X) + \sum_{k \geq 1}\frac{(-1)^k}k X^{2k}\sum_{n \geq 0}\binom{n + k - 1}{k - 1}X^n\\ &=& -\log(1 - X) - \sum_{k \geq 1}\frac{ (-1)^{k - 1}} k \left(\frac{X^2}{1 - X}\right)^k\\ &=& -\log(1 - X) - \log\left(1 + \frac{X^2}{1 - X}\right)\\ &=& -\log(1 - X + X^2)\\ &=& -\log(1 - \omega X) - \log(1 - \overline\omega X)\\ &=& \sum_{n \geq 1}\frac{\omega^n + \overline\omega^n}n X^n, \end{eqnarray} where $\omega = \frac{1 + \sqrt{-3}}2$ is a primitive sixth root of unity.
Thus we have $s_n = \frac 1 n \cdot 2 \operatorname{Re}(\omega^n)$.
Now $\omega^n$ only depends on $n \mod 6$. Therefore: $$s_n = \begin{cases} \frac 2 n, & n \equiv 0\mod 6;\\ \frac 1 n, & n \equiv 1, 5\mod 6;\\ \frac {-1} n, & n \equiv 2, 4 \mod 6;\\ \frac{-2} n, & n \equiv 3 \mod 6. \end{cases}$$
And the answer to the original question follows from the fact that $1991 \equiv 5 \mod 6$.
The given solution is incorrect, for the reason you mentioned; if $a_{2001}=1$ and all other cards are zero, then $S=1$, yet the game is over. The correct solution is to let $T=a_{1960}+a_{1910}+a_{1860}+\dots+a_{10}$, and apply the same logic to $T$. Indeed, if $T>0$, then any nonzero term of $T$ gives a legal move.
They made two mistakes. First of all, they confused left and right, and meant to say that $a_i$ is the $i^{th}$ card from the right end. Second, they seemed to be thinking that the rules were as follows: you can select any card which is gold, and then flip it and the $49$ cards to its right to the other side. If there are fewer then $49$ such cards, then you just flip all that you can. With these two changes, their value of $S$ works.
Best Answer
Let $a_i=1$ if $i$ is a girl, $0$ otherwise. Let $f(n,k)=\sum_{i=n}^{n+k-1}a_i$, so we want to show that $f(n,k)=f(n+k,k)$ for some $1\leq n\leq1000$ and $100\leq k\leq 300$.
Define $g(n,k)=f(n+k,k)-f(n,k)$, and assume for contradiction that $g(n,k)\neq0$. Then as $\lvert f(n+1,k)-f(n,k)\rvert\leq1$, it follows that $\lvert g(n+1,k)-g(n,k)\rvert\leq 2$.
Now $\sum_{n=1}^{1000}g(n,k)=0$, so somewhere $g(n,100)$ goes from $-1$ to $+1$, WLOG $g(0,100)=-1$ and $g(1,100)=1$. So this implies $a_0=0$, $a_{100}=1$, $a_{200}=0$. If $a_{201}=1$, then $g(0,101)=0$, so we must have $a_{201}=0$. Similarly, $a_{-1}=0$. Continuing like this, we see that $$a_{201}=a_{202}=\dots=a_{402}=a_{-1}=a_{-2}=\dots=a_{-200}=0,$$ but then $g(201,101)=0$, a contradiction.