# The Monster and the Chessboard [duplicate]

You have a standard checkerboard with 64 squares and a coin in each square, randomly facing heads or tails up. There is an evil monster in the room with you and he arbitrarily selects some square and tells you that it is the magic square.

You are allowed to flip one and only one coin on any one square of your choice. Then your friend comes in and he is supposed to guess the location of the magic square correctly, without any help from you. You and your friend are allowed to discuss some strategy beforehand..

What strategy should you use so that you and your friend won't be eaten by the monster? (a.k.a your friend is able to choose the correct square?)

The question has a mathematical/logical answer, and it is all pure strategy. So no answers that try to go around that please :)

• Can put oil on hand, so friend can find which coin is flipped and everytime he cleans it afterwards:P – Preet Dec 19 '17 at 2:06
• Can flip coin from any square? or one from a set selected by monster? – Preet Dec 19 '17 at 2:11
• "You are allowed to flip one and only one coin on any one square of your choice. " – NL628 Dec 19 '17 at 2:13

## 2 Answers

Label all the coins, in binary, with 0-63.
Then, take the bitwise XOR of all the heads that are showing, and XOR that with the label of the magic square. Flip the coin whose label is the result. Then, the strategy would be for your friend to come in, take the XOR of all the heads, and the result would be the label of the magic square.

• I have honestly never seen this idea before, and I think it works! – NL628 Dec 19 '17 at 2:20
• this is the same as my answer... just more detailed. – Jasen Dec 19 '17 at 2:23
• @Jasen I'm sorry but I didn't understand what you meant by hamming code, and I wanted a simple to understand solution. – NL628 Dec 19 '17 at 2:23
• no problem, your answer is better. this question will probably be deleted soon, – Jasen Dec 19 '17 at 2:42

use a hamming code

because

the result is a binary number from 0 the 63 fliping each coin will give a different result, so one of the 63 coinds will point to the magic square.

• and yeah this is a duplicate question. – Jasen Dec 19 '17 at 2:21