Two players, Alex and Brad, take turns removing marbles from a jar which initially contains $2015$ marbles. Assume that on each turn the number of marbles withdrawn is a power of two. If Alex has the first turn and the player who takes the last marble wins, is there a winning strategy for either of the players?
I try to solve it like the follow:
First) I assume that both player know the amount of marbles they took each other
Second) The problem say they pick power of 2 then the possible picks are $[1 , 2 , 4, 8, 16 ,32,64 128 , 256 , 512 , 1024]$ there are only $2015$ marbles.
Third) the game has 2 players.
Continue:
a) The only odd pick is $1$ due to $2^0$ is $1$. The rest are odds
If player A pick odd (1) B must pick an even number and A continue pick even and also B until complete the $2015$.
And
If player A pick even (2, 4, etc) B must pick an odd (1) number and A continue pick even and also B until complete the $2015$.
I cannot see how can I use 2015 to set a winning rule, I also try use binary but I couldn’t do any advance.
Please, let me know what I am doing wrong and how I can continue. Thanks, Greg Martin and Shailesh for your help.
Note: I try to use brute fore (excel ;-) ) but I see that multiple of 3 are the wining but I can’t not put my assumption in words with the $2015$ number.
Thanks again.
We first prove the following facts:
proof sketch: Observe that $y$, which is power of $2$, can not be multiple of $3$.
proof sketch: Let $y = x\bmod 3$.
We next introduce two concepts. Denote the # of marbles remaining in the beginning of a turn as $x$. If $x$ is multiple of $3$, that turn is called a L-turn (lose), otherwise it's a W-turn (win). Easy to observe that ONLY in a W-turn, a player can win the game. (If $x$ is multiple of $3$, it can not be power of $2$.) According to the two facts above, we know that
Consequently,
Summary: Since $n = 2015$ is not multiple of $3$, the first player will win the game if he plays optimally.