Mind Games

Mind Games

View Stats:
Nik Mar 6, 2016 @ 1:10pm
3,4,5 coins puzzle unsolvable?
I don't seem to see a solution to the 3,4,5 coins puzzle. Any hint welcome
< >
Showing 1-11 of 11 comments
acerdevilinops Mar 6, 2016 @ 1:35pm 
start witht the row of 3.
Nik Mar 6, 2016 @ 3:20pm 
I did but at any action (take one, two or all three) the AI counters so that at the end are left only two coins and me to choose, so I lose. What do I miss?
7_of_9 Mar 6, 2016 @ 3:41pm 
If memory serves me well, take 2 out of the first row and 2 out of the second one
Nik Mar 6, 2016 @ 9:42pm 
Somehow I did it starting as you said. Thanks.
alphabetsoup Mar 7, 2016 @ 2:29am 
It's called a Nim puzzle and the maths behind it is really simple once you understand it. You only need to know how binary numbers work. There's a lot of articles online about it. I can go into more detail it if you're interested.
Last edited by alphabetsoup; Mar 7, 2016 @ 2:29am
macmac Mar 7, 2016 @ 8:09am 
Still can't do it.
just trying to turn the 3.4.5 situation into 1.2.3 situation.
alphabetsoup Mar 7, 2016 @ 11:44pm 
Taking two from the top row will always be the first move. (1,4,5)

Second move depend on how the computer moves., if it takes two from row 2, take two from row 3. If it takes two from row 3, take two from row 2. (1,2,3)

Then next, do whatever it takes to make two rows of the same number of coins. (probably 2,2)

Lastly, just mirror the computer's moves on the longer row. It'll probably take 1 from a row; you take 1 from the other. You'll take the last coin no matter what.
Last edited by alphabetsoup; Mar 7, 2016 @ 11:47pm
Marquise* Jul 11, 2016 @ 10:38pm 
I don't get it. No matter how much I take or is left I just hear the muhahahaha! I mean if the AI just finishes a whole row. or it is my turn to do so, no matter what the oieces turn to their gold face an Muhahaha.

I dunno How to skip a puzzle to this game yet or if I have the option and it is the first one after the entrance.
Mickmane Apr 17, 2019 @ 3:21pm 
Originally posted by alphabetsoup:
Taking two from the top row will always be the first move. (1,4,5)

Second move depend on how the computer moves., if it takes two from row 2, take two from row 3. If it takes two from row 3, take two from row 2. (1,2,3)

Then next, do whatever it takes to make two rows of the same number of coins. (probably 2,2)

Lastly, just mirror the computer's moves on the longer row. It'll probably take 1 from a row; you take 1 from the other. You'll take the last coin no matter what.

Thanks! That did it. :)) On my own I was getting nowhere, so looked for a solution here.

(I hope this doesn't count as necroing the thread, even though it's old, it's still valid!)

Originally posted by alphabetsoup:
It's called a Nim puzzle and the maths behind it is really simple once you understand it. You only need to know how binary numbers work. There's a lot of articles online about it. I can go into more detail it if you're interested.

I know binary numbers, but don't see how this puzzle has anything to do with them. (Maybe I'm too old and fuzzy-headed by now.) Not sure if this is the place to go into more detail, but I'd be interested. :)
sfnhltb Jun 8, 2020 @ 3:14pm 
Originally posted by Mickmane:
I know binary numbers, but don't see how this puzzle has anything to do with them. (Maybe I'm too old and fuzzy-headed by now.) Not sure if this is the place to go into more detail, but I'd be interested. :)

The solution to any nim puzzle is to calculate the nim-sum, which is essentially breaking it down into binary digits and eliminating any pairs of binary digits from among the stacks, if you find the value is 0 on your turn you have lost unless the opponent messes up (which it presumably won't with a computer playing and such a trivial algorithm to work out the right move), if not make a move that makes it 0 and you should win.

For the starting position in this game we have 3,4,5 so in binary 011, 100 and 101 - the two fours and two ones cancel, leaving a nim sum of 2 coming from the first stack of 3. So the correct move is to take two from the stack of three (as mentioned by a couple of other posters).

This then leaves the computer in an impossible position (if we don't make a mistake) - if it takes the one left from the first stack we can match its move and remove one from the third stack leaving two stacks of 4 and then we can mirror down any moves the computer makes until we win by making the last move (or in the normal version of nim where you want to force the opponent to take the last piece we match down to the last move when we either take one more or less piece to leave a singletone behind).

Equally if the AI decides to take 4 from the 5 stack to leave 1, 4, 1 we take 4 from the middle stack matching his move again and leaving two singleton stacks to win, or it could take 1 from the 5 stack leaving 1,4,4 and we take the single 1 to get to that same two stacks of four from the previous paragraph, or if it took 2 from the middle stack to leave 1, 2, 5 we can remove 2 from the last stack and leave 1, 2, 3), and so on.

The decomposition of the stack numbers into binary is essentially because we need to engineer a situation where we control the game because each move by the opponent can be matched on another stack (or the same one, for example if we messed up at 1,4,1 and only took 2 from the middle stack, the correct move is then to remove the 2 we left as that is now the sole unmatched digit in the nim sum).
< >
Showing 1-11 of 11 comments
Per page: 1530 50