Problems

Age
Difficulty
Found: 2994

Let x,y be nonnegative integers. Determine when Nim(x,y) is a losing position and when it is a winning position.

When we write 137 in decimal, we mean 1×102+3×10+7×1. If we write it instead using powers of 2, we have 137=1×27+0×26+0×25+0×24+1×23+0×22+0×21+1×20. To tell apart binary representation from decimals, we can use the following notation: 137=(10001001)2.

What is the number 273 in binary? Note that using binary is useful for finding whether a particular Nim game is a winning position or a losing position.

Let us define XOR (or addition mod 2). XOR is defined for 0 and 1 only. Here is a table recording the values of XOR:

XOR 0 1
0 0 1
1 1 0

Now we define the important concept of nim-sum. Given two natural numbers x and y, we first convert them into binary representations and then compute XOR on individual digits. The resulting number, denoted xy, is the nim-sum of x and y. Here is an example.

1 0 1 1 0
XOR 0 0 1 0 1
1 0 0 1 1

This is simply saying 225=19. Note that 22=(10110)2 and 5=(00101)2.

Verify (xy)z=x(yz), so we can speak of xyz with no ambiguity.

Show that xy=0 if and only if x=y. Remember that xy denotes the nim-sum of x and y.

Show that Nim(x,y,z) is a losing position if and only if xyz=0. Remember that xy denotes the nim-sum of x and y.

Is Nim(7,11,15) a winning position or a losing position? If it is a winning position, what is the optimal move?

Show that Nim(x1,,xk) is an losing position if and only if x1xk=0. xy denotes the nim-sum of x and y.

Suppose you have a coffee mug made of stretchy and expandable material. How do you mold it into a donut that has a hole inside?