The first two spots on the board will be:

00 01 10 11

if the sum is even change these as follows:

10 11 00 01

if the sum is odd:

01 00 11 10

The next guy will come in and pick the second square if there are an even number of rocks, and the first if odd.

“The first wise man has to decide whether to remove one rock or to add one rock to an empty cell.”

If the first wise man must choose between these two options, as we have been assuming, then there is no 3-square solution. If the first wise man has the option of leaving the board as it is, your solution seems to work.

]]>The rocks on the board presented to the second wise man encode a binary string (such as 010 for a rock on only the second square). There are 8 such strings; to each we must assign a colour (by which I mean Square A, B, or C) such that

* At most one move is needed to get to any other colour

Then, by puzzling a little, the following colouring works:

000 a

001 b

010 c

011 c

100 c

101 c

110 b

111 a

Example: the first wise man is presented with rock combination 001 and square c. He adds a rock to make 011. Etc. In fact, in my construction I didn’t need the combination 100, as it is already connected to all other colours. I did not build this table in any systematic way, but I am sure it can be done.

]]>My students are totally engaged when I include online math games within a lesson or as homework. The repetition and association that games = fun really helps them capture the subjects. My class really enjoys https://www.mangahigh.com/en_gb/ a new site with Algebra, Geometry, Quizzes, etc.

]]>And it seems to me that you are both advocating the same solution, the “xor” function having the same effect as binary addition without carrying, yes?

The solution as I now understand it makes perfect sense, but then I wondered why it wouldn’t work for any number of squares. So I went back and applied it to our three-square chessboard, which we know won’t work. And I see that if the sultan presents our first wise man with a three-square chessboard (00, 01, 10) with a single rock on the second square, and then chooses the third square, then the first wise man will have no way of turning the 01 into a 10 by moving only one rock. But if a fourth square were added (11), then the first wise man could put a rock on it, and the second wise man would know that the third square had been chosen.

So the reason that this solution can only work for a power-of-two chessboard is that only powers of two will give the first wise man the full range of options to switch the binary digits needed to change any number into any other. And the light breaks through the clouds!

Thanks again to you both, and to our wise host for posing the problem and providing this forum.

]]>If A xor B xor C xor Answer = K, then A xor B xor C xor K = Answer. This is a fairly obvious theorem, noting that X xor X is 0. And 0 xor X is X. So, if you take the first statement, and do C xor B xor A xor on both sides, we get the second statement.

Here, we number the squares of 8×8 from 0 to 63 in the obvious manner like the above proof, from 000000 to 111111. Now look at all those squares with a H and write them down (each is a 6 digit number). Also write down the secret square. Xor them all. We are essentially doing A xor B xor C xor Answer. We’ll get a K, some 6 digit number implying a square. Flip that square. Now, the next guy comes in. Looks at all those squares with a H and writes them down. Xors them all. He is essentially doing A xor B xor C xor K. He will get the answer.

Just in case people have qualms, note that flipping a coin is equivalent to taking a Xor. If the coin was a T and it became a H, it is obvious, the second guy will do A xor B xor C xor K. But if it was a H, and became a T, that square will not be part of the second list, and the second guy will be doing just A xor C, which you must note is the same as A xor K xor C xor K.

]]>Imagine that the wise men DO come up with a strategy. However complicated it is, we can depict it in a chart like so:

1. Fold a piece of paper to make two columns. Label them BEFORE and AFTER.

2. There are 8 possible configurations of pebbles. Draw each of them once in the BEFORE column. Do the same in the AFTER column.

3. For each BEFORE configuration, draw a red line connecting it to the AFTER configuration which the first wise man will select if the sultan has pointed to the first square. Similarly, draw green and blue lines to show what the first wise man will do if the sultan points to the second or third square, respectively.

When the chart is complete, there should be 24 lines in all, including 8 of each color. Coming out of each BEFORE configuration are one red, one green, and one blue line. A BEFORE and AFTER pair are only linked if they differ by the addition or removal of exactly one pebble, so there must be exactly 3 lines coming into each AFTER configuration as well.

The second wise man only sees an AFTER configuration. The chart indicates whether he has enough information to decode the sultan’s choice. If all the lines coming into that AFTER configuration are the same color, then he knows the sultan’s choice; otherwise, he can’t be sure. So, the strategy is only successful if every AFTER configuration is “monochromatic,” which would imply that the total number of red (or green, or blue) lines is a multiple of 3. That contradicts what we already know, namely, that there are 8 lines of each color. Therefore, no strategy can be successful all the time.

The logic of this proof should hold up whenever the number of squares isn’t a power of 2. Bill, that backs up a guess you made in your second comment, but it also makes me doubt your solution to the original puzzle. There are some details I wasn’t able to fill in… but assuming the solution works, it must somehow rely on 64 being a power of 2, and I can’t see how it does. However… what if instead of using 0-63, we use 6-bit binary codes for all the squares, and do all the arithmetic without carries? Then I think your solution works. The nice thing about binary arithmetic is that +1 = -1 (so adding a pebble becomes equivalent to removing a pebble).

]]>Assign each of the cells of the chessboard a number from 0-63. The number of the cell chosen by the sultan will be called X.

The first wise man should add up the total of the numbers of the cells that have a rock, and subtract the numbers of the cells that do not have a rock. The result will be an even number. If this number is negative, add any multiple of 128 that will make it positive. Now divide by 128. Take half of the remainder of that division and call it Y.

The first wise man now has the task of altering the chessboard so that the Y-value of the new configuration equals X. If X is larger than the current Y, then Y=Y+64. Subtract X from Y. This is the number of the cell that the first wise man should perform his action on.

The second wise man now may look at the board, derive the Y-value, and identify the sultan’s cell. The sultan will then give them 100 gold coins to be divided by whatever intricate system they wish to devise.

]]>