[Math] Coin Arrangement Puzzle

puzzle

Disclaimer: I'm not sure how math related this puzzle is (it could potentially be), but I thought it was an interesting puzzle, and I also don't know how to solve it so I wanted to see if anyone had any ideas.

You have a board divided in quarters and a coin is in each spot. You
do not know whether each is facing heads or tails upwards. In each
turn, you can choose flip any number of coins. Specify a sequence of
turns that guarantees that at some point all coins will be facing the
same direction.

Follow up: Between each of your turns, the board is rotated an arbitrary
amount amount (90, 180, 270 degrees). Specify a sequence of moves that
guarantees that at some point all coins will be facing the same
direction.

Best Answer

For the follow-up you have to assume that success will be announced after each try if you manage. We assume that a malevolent adversary controls the rotation, but you can flip a single coin, an opposite pair, or an adjacent pair at your option. You just can't keep track of anything except relative position between flips. You start knowing they are not all heads or all tails. Flip two opposite coins. If that doesn't work, you either have an odd number of heads or two adjacent heads. Flip two neighboring coins. If that doesn't work, you either have two opposite heads or an odd number of heads. Flip two opposite coins. If that doesn't work, you have an odd number of heads. Note that so far, we have always flipped an even number, so the parity hasn't changed. Flip one coin. If that doesn't work, you have two heads and two tails. Flip two opposite coins. If that doesn't work, you have two neighboring heads. Flip two adjacent. If that doesn't work, you have two opposite heads. Flip two opposite. Guaranteed to work.

If success is all heads instead of all the same, put flip all four at the start and after every step of the above.

Related Question