/magic-coin

Solutions to the magic coin problem

Primary LanguagePython

Problem

The "Magic Coin" problem:

  1. There is a room with a 64x64 grid of coins
  2. All coins have a heads and tails side and start in random orientation (~50% heads-up, ~50% tails-up)
  3. One coin is the "magic coin" but is indistinguishable from the other coins
  4. You have a friend with you who enters the room first and is shown which coin is the magic coin
  5. Your friend has the option to flip ONE of the 642 coins (or they may flip no coins)
  6. Your friend leaves the room (out a back door) and you enter the room
  7. You must determine the location of the magic coin

Stipulations:

  • You are not allowed to see the initial state of the coins (you cannot see the coins until after your friend has left the room).
  • You and your friend may communicate, but only before your friend enters the room. Once your friend has entered the rom, you effectively never communicate with them again.
  • The only possible action your friend can take is to flip a coin completely (no rotating, moving, marking or the like).
  • No mechanics exist which are not stated in the problem (e.g. you can't stand a coin up on its edge, yell to your friend through the walls, etc.)

Solutions

~SPOILER ALERT~

See solutions directory.

Feel free to submit pull requests with new solutions!