math/logic puzzle

There’s a room with a table which has 4 silver dollars sitting on it, one at each point of the compass. They are covered by cups so you can’t see them.

You enter the room. You may pick up any two cups. You may then examine the dollars there, to see if they are heads-up or tails-up. You may then flip either or both or neither of them over, and replace the cups. At this point, you will be told if you have accomplished your goal of getting all 4 into the same heads-up or tails-up state.

If you have not accomplished your goal, you leave the room, the table is picked up and rotated a random amount, and then you repeat the process.
The question is: What is a strategy that guarantees that you will succeed within a fixed number of operations?

This is in no way a trick question (ie, the answer is not to use your body heat to warm up the coins or anything outside-the-box like that). It is, however, a tricky question.

How about this:

  1. Turn over a north/south combo (N/S). Make them both heads. If this fails, return to the room and:

  2. Turn over a N/S combo. If they are not both heads, you can confidently turn these two to heads and win. However, if they are both heads you must now switch them both to tails. If this doesn’t win you next:

  3. Turn over another N/S combo. If they are not both tails, you can turn them that way and win. However, if they are both tails you now turn just one of the coins. You of course will not win… however…

  4. Upon your return you now turn over a North/East combo. Flip over both coins. You have now aligned two heads— one opposite the other, and two tails – one opposite the other. You can now, finally:

  5. Return to the table, select a N/S combo and turn them over. This guarantees victory.

I can’t do better than that…can I?

It should be noted that at step 4, when you turn over the North/East combination, you may find either two heads or two tails instead of one of each. If so, flip them both and win.

Lovely work, there, Biotop. I was about to post my solution but yours is shorter and more elegant.

What was your solution, MonkeyMensch? I’m not yet convinced I’ve found the tightest answer.

Sigh. I was supposed to be doing the company bank reconciliation tonight, instead I’ve just been sitting here in the office flipping coins. I still wonder if this somehow can’t be reduced another step…?

A maddening puzzle, MaxTheVool!

That’s more or less the same as my answer, except that I looked at it backward

(1) If we know that we have 2H and 2T and they’re opposites (HTHT around the table), it’s easy to win

(2) If we know that we have 2H and 2T and they’re consecutive (HHTT) it’s easy to win… open two that are side by side. If they’re the same, flip and win. If they’re not, flip and go to (1)

(3) If we know that we have 2H and 2T but don’t know what orientation, it’s easy to win. Open NS. If they’re the same, flip and win. If they’re not, leave them and go to (2)
(4) If we know we have 3H and 1 T, it’s easy to win. Open any two. If you see a T, flip and win. If you don’t, flip an H to T and go to (3)

(5) It’s easy to get to 3H and 1T. Open NS and flip to H. Then open NE and flip to H. Then go to (4)