I happened upon a puzzle (https://www.etsy.com/listing/98226237, image), and fairly quickly figured out how to solve it. However, then I tried to explain to a bright 9-year old why that solution works. And though I kind of succeeded, it was really hard to make the explanation ("proof") simple and understandable.
So my question is: What is the simplest explanation that we can come up with?
Here is the game (in my own words). Given is a row of 9 slots, each one having a coin showing heads or tails. The following moves are allowed:
- Optionally, only as the first move, flip over any one coin.
- Repeatedly, take any coin showing head, and flip over the coins in the neighboring slots (if any).
The goal is to take all coins.
My question is to describe all winning strategies (i.e., the set of all 'winning' moves at each point in the game), and prove it correct, in the simplest and/or most convincing way possible. Preferably using the least amounts of surprises/'rabbits'.
For completeness, if I got this right, here is the solution that needs to be explained:
- First, if the number of heads is even: Flip over any coin. (Now the number of heads is odd.)
- Then repeatedly: In any 'segment' of non-empty slots, choose the now 1st, 3rd, 5th, ..., or last 'head' coin to take-and-flip-over-neighbors.
(Note that this works for any number of slots, not just for 9 slots.).
OK. Here's a proof: I'll split into two cases:
The "bad" case: the game consists of a single segment of adjacent coins, all
T. This case can be solved by turning the first coin toH, and then taking it; the result can then be solved by case 2The "really good" case, where the game consists of a sequence of coins containing an odd number of
Hs. (Details on solving this in a moment)The "sort of bad" case: the game consists of a sequence of adjacent coins, with a nonzero even number of
Ts. (The cases of, say,TTorTTTTare worth considering as examples). As in case 1, we can flip any coin, producing an odd number ofTs. To make this explicit: pick the firstTand flip it, thus reducing the number ofTs and leaving an odd number ofTs. (With this simplification, we can see that this is really handled exactly the same as case 1, so we can lump them together into "the bad cases". What makes them "bad" (from my point of view) is that they're solvable only if you can use the 'first-move-only' move where you flip just one coin. We'll see why that's a problem in a moment.At this point, it's worth simply solving all 1- and 2-coin problems:
Solution TableH-- take coin 1 (T1)T-- flip coin one; take coin 1 (F1T1)HH-- F1T2T1HT-- T1T2TH-- T2T1TT-- F1T1T2Now let me look at case 2 (but only for 3 coins or more, because I've solved all the 1- and 2-coin problems) and split it into a few cases:
2a. The sequence starts
HTxxxwhere thexs indicate any number (possibly zero!) of either H or T.2b. The sequence starts
THTxxx2c. The sequence starts
THHxxx2d. The sequence starts
TTxxx(where at least one of the remaining coins must be anHbecause we're in case 2, where there's an odd number ofHs).In the first three cases, I'm going to show how to reduce the problem to a smaller problem that is in case 2; we can then (once I handle the fourth case) repeat and repeat until we're down to one or two coins, and then apply the solutions in the solution table to finish off. SO here goes:
2a.
HTxxx: T1 to produce-Hxxx, a shorter sequence with exactly the same (odd) number of heads! (the dash indicates an empty space)2b.
THTxxx: T2 to produceH-Hxxx, a pair of sequences; the left one is solvable by the solution table; the right one is shorter, but has the same (odd) number of heads we had before the "T2".2c.
THHxxx: T2 to produceH-Txxx. Again the left sequence is easy, and the right sequence is shorter, but contains two fewerHs than the original sequence, i.e., an odd number ofHs, so we're still in case 2.The remaining case is case 2d: we start with a sequence of the form
T...THxxx, where the dots indicate an arbitrarily long sequence ofTs. There are two subcases:T...THTxxxandT...THHxxx. The savvy reader will observe that these are simply a sequence ofTs followed by cases 2b or 2c. We apply exactly the same solution: flip the firstH. The sequence splits intoT....H-Hxxx, orT...H-TxxxIn each case, the left hand sequence has exactly oneH, so we're in the "good" case. The right-hand sequence is shorter than the original, but has either (i) the same (odd) number ofHs as before the split, or (ii) two fewer (hence again an odd number of)Hs as before the split.So in each case-2 situation, we've reduced the problem to one or two smaller case-2 situations, which we can solve independently. We're done.