## 10165 - Stone Game

Moderator: Board moderators

10153EN
Experienced poster
Posts: 148
Joined: Sun Jan 06, 2002 2:00 am
Location: Hong Kong
Contact:

### 10165 - Stone Game

Dear all,

I still have no idea on how to solve this problem after thinking over it for some time. Could anyone give me some hint on it?

Thx.

Stefan Pochmann
A great helper
Posts: 284
Joined: Thu Feb 28, 2002 2:00 am
Location: Germany
Contact:
It's the "Nim" game and you should easily find information in google when you search for "nim" and "xor", for example here:

http://web.usna.navy.mil/~wdj/nim.htm

konsept
New poster
Posts: 22
Joined: Wed Dec 19, 2001 2:00 am
Contact:

### 10165 - Stone Game

Hi,
Can someone explain the solution to this problem ?
it looks similar to the NIM-game.

Thank you.

Shih-Chia Cheng
New poster
Posts: 17
Joined: Fri May 24, 2002 4:24 am
Location: Taiwan
Contact:

### Re: 10165 - Stone Game

konsept wrote:Hi,
Can someone explain the solution to this problem ?
it looks similar to the NIM-game.

Thank you.
Convert all numbers into binary sequences and list them all one in a row.
Then you may think what the best strategy is for playing the game.
If this is still obscure, consider the special case when there are only two
piles of stones. Try to generalize your solution for this special case.
Good luck~

Yu Fan
New poster
Posts: 26
Joined: Thu Nov 13, 2003 3:52 am

### 10165

I've viewed some topics says that it could be solved with binary sequence... but i can't imagine it.
someone helps me?

vedex
New poster
Posts: 7
Joined: Sat Jul 02, 2005 8:31 pm
I am not going to prove you why my solution is right. This is a very popular game called Nim. Lets say we have n stones a1, a2, ... , an
If, and only if, a1 xor a2 xor ... xor an = 0 =) 'NO'
a1 xor a2 xor ... xor an <> 0 =) 'YES'

Tanu
Learning poster
Posts: 70
Joined: Sun May 29, 2005 12:46 pm
Location: Mars

### Hay

Yah thats true i got accepted by this way
but can anyone let me know how it works.