Thursday 15 January 2015

strategy - Coin Flipping Game with the Devil


You die, and awake in Hell. Satan awaits you, and has prepared a curious game. He has arranged $n$ quarters in a line, going in the east/west direction. He placed the coins at the ends tails up, and all others heads up, like so: $$ \text{T H H H }\cdots \text{ H H H T} $$


Satan explains the rules.



  • Once a day, a coin is removed from the east end, and placed on the west end.


    • If the coin was initially tails-up, then you get to choose whether the coin is placed heads up or down.

    • If it was initially heads-up, then Satan gets to make this choice.



  • If the coins are all heads up at the end of a day, you get to leave Hell.


Satan will of course try his hardest to make sure you never leave.


For example, when $n=5$, we start with $\text{T H H } \color{red}{\text H} \color{green}{\text{ T}}$. The first day is your choice; if you choose heads, the arrangement becomes $\color{green}{\text{H }}\text{T H H } \color{red}{\text H} $. The next three days, however, will be Satan's choice. He may fight back on the second day by choosing tails, resulting in $\color{red}{\text{T } }\color{green}{\text{H }}\text{T H H } $.


Is there a strategy that eventually guarantees your salvation? Or can Satan conspire to keep you in Hell forever?



Addendum: To give credit where it is due, this puzzle from The Puzzle Toad, (under the name "Zeroise Me") which is a superb collection of similarly clever and enjoyable conundrums.



Answer



Satan should stick to fiddling. You will win, and here is a simple proof.


Consider the game $n$ turns at a time. After each cycle of $n$ turns, all the coins are in their original position (though not necessarily flipped the same way).


Replace $H$ with $0$ and $T$ with $1$.


In each cycle, you flip all $1$'s to $0$'s, until Satan flips a $0$ to a $1$. Once Satan makes a flip, you stop and leave the rest of this cycle's coins alone.


Satan must always make a flip during a cycle. If not, then you have just flipped all the coins to $0$, and you win.


Read the sequence of coins as a binary number. Each cycle's play starts at the ones place and progresses to the largest place. Satan makes the last flip in each cycle, and that flip flips a $0$ to a $1$. Therefore, after each cycle, the number gets larger.


But it can't get larger forever. After at most $2^n$ cycles, it reaches $111...1$. Put on your smuggest face and flip all the coins for a well-deserved win.


No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...