Joe and Penny play a game. Initially there are $5000$ stones in a pile, and the two players remove stones from the pile by making a sequence of moves. On the $k$-th move, any number of stones between $1$ and $k$ inclusive may be removed. Joe makes the odd-numbered moves and Penny makes the even-numbered moves. The player who removes the very last stone is the winner. Who wins if both players play perfectly?
Problem
Source: BMO SL 2023 C1
Tags: combinatorics, AZE BMO TST, TST
04.05.2024 21:41
..........
05.05.2024 12:22
Penny wins. The strategy is as follows: If we find $s_1,s_2,\dots s_k,x$ such that $s_i\in \{2i,2i+1\}$ and $x\in \{2k+2,2k+3\}$ and $5000=s_1+s_2+\dots s_k+x $,we are done because then if joe picks $x_1,\dots x_k$ then penny chooses $s_1-x_1,s_2-x_2,\dots s_k-x_k $ and the remaining sum is $x$ and joe is next to move.But joe cannot pick all of them and remain at most $2k+2$ so penny can take all of them. But we can just take $k=69; s_i=2i+1$ for $i=1,2\dots 30 s_i=2i$ for $i=31\dots 69$ and $x=140$ and we are done.
06.05.2024 17:39
11.05.2024 18:15
a_507_bc wrote: Joe and Penny play a game. Initially there are $5000$ stones in a pile, and the two players remove stones from the pile by making a sequence of moves. On the $k$-th move, any number of stones between $1$ and $k$ inclusive may be removed. Joe makes the odd-numbered moves and Penny makes the even-numbered moves. The player who removes the very last stone is the winner. Who wins if both players play perfectly? I think this can be generalised If $n=a^2+b$ for $0\leqslant b\leqslant 2a$, then If $0\leqslant b \leqslant a-1$, Joe Wins If $a\leqslant b\leqslant 2a$, Penny Wins
29.08.2024 17:01
FredAlexander wrote: .......... $Hi$
08.09.2024 09:12
We solve the general case for $n$ stones. Our claim is that Joe can win for all positive integers $n$ of the form, \[k^2 \le n \le k^2 + k -1\]for each positive integer $k$, and that Penny can win for all positive integers $n$ of the form, \[k^2 + k \le n \le (k+1)^2-1\]for each positive integer $k$. We attempt to show this via induction. In fact, we claim that the winning player can win on his/her $k^{\text{th}}$ move. The \textit{size} of a move, is the maximum number of stones that can be picked up by that player in that move. It is quick to check that Joe wins for $n=1$ (in one move) and that Penny wins for $n=2$ and $n=3$ (in her first move). Now, assume that the claim holds for $k=m$. We wish to show that it holds when $k=m+1$. For positive integers, \[(m+1)^2 \le n \le (m+1)^2 + m\]Now, by our inductive hypothesis we know that Joe can force a scenario where at the end of his $m^{\text{th}}$ move the number of stones removed is between $m^2$ and $m^2+m-1$. For $(m+1)^2$, Joe removes $m^2$ stones by the end of his $m^{\text{th}}$ move and since $(m+1)^2 - m^2 = 2m+1>2m$ Penny cannot immediately win. Further, after Penny's move Joe can immediately win since his next move is of size $2m+1$. For $(m+1)^2 + a$ where $1\le a \le m$, Joe forces $m^2 \le m^2+a-1 \le m^2+m-1$ (which is guaranteed by the inductive hypothesis) leaving $2m+2$ stones. Penny cannot win immediately (since his move size is $2m$) so Joe can finish afterwards (as his move size is $2m+1$ and since Penny takes a non-zero number of stones at most $2m+1$ will be left over). Thus, for all these $n$ Joe has a winning strategy. We can repeat the argument for Penny. We know that Penny can force a scenario where at the end of his $m^{\text{th}}$ move the number of stones removed is between $m^2+m$ and $(m+1)^2-1$. For $(m+1)^2 + m+1$, Penny removes $m^2+m$ stones by the end of his $m^{\text{th}}$ move leaving $2m+2$ stones. Joe's next move is of size $2m+1$ so he cannot win, and Penny finishes immediately afterwards. For $(m+1)^2 + m+1+ a$ where $1\le a \le m+1$, Penny forces $m^2 + m \le m^2+m+a-1 \le (m+1)^2 -1 $ (which is guaranteed by the inductive hypothesis). This leaves $2m+3>2m+1$ stones left, which Joe cannot pick up. Thus, after Joe picks some non-zero amount of stones, at most $2m+2$ stones will be left over, which Penny can pick up (since his next move is of size $2m+2$). So here, \[71^2>5000=70^2 + 100 > 70^2 + 70\]which implies that Penny wins.