Skip to main content

Chapter 25 Nim Sums

Exercises Practice Problems

1. Covert to Binary.

Write each of the following numbers in binary by first writing them as a sum of powers of 2.

  1. \(14\)

  2. \(25\)

  3. \(40\)

  4. \(\displaystyle 63\)

Solution.

  1. \(14 = 8+4+2\) which is binary = \(1110\)

  2. \(25 =16+8+1\) which is binary = \(11001\)

  3. \(40 =32+8\) which is binary = \(101000\)

  4. \(63 = 32+16+8+4+2+1\) which is binary = \(111111\)

2. Nim Sums.

Calculate the following nim sums

  1. \(\displaystyle 12 \oplus 10 \oplus 8\)

  2. \(\displaystyle 20 \oplus 15 \oplus 10 \)

  3. \(\displaystyle 23 \oplus 17 \oplus 10 \oplus 4 \)

Solution.

  1. We calculate

    \begin{equation*} \begin{array}{r} 1100 \\ 1010 \\ \oplus 1000 \\ \hline 0110 \end{array} \end{equation*}

    which is \(6\)

  2. We calculate

    \begin{equation*} \begin{array}{r} 10100 \\ 01111 \\ \oplus 01010 \\ \hline 10001 \end{array} \end{equation*}

    which is 17.

  3. We calculate

    \begin{equation*} \begin{array}{r} 10111 \\ 10001 \\ 01010 \\ \oplus 00100 \\ \hline 01000 \end{array} \end{equation*}

    which is 8.

3. Nim Sums for Nim Positions.

You have analyzed the following Nim positions in a previous exercise. For each position, calculate the nim sum of the pile sizes. What do you observe?

Solution.
  1. The nim sum of this \(\cN\)-position is 3.

  2. The nim sum of this \(\cN\)-position is 3.

  3. The nim sum of this \(\cP\)-position is 0.

  4. The nim sum of this \(\cN\)-position is 4.

  5. The nim sum of this \(\cP\)-position is 0.

  6. The nim sum of this \(\cN\)-position is 2.

The \(\cP\)-positions have nim sum 0 and the \(\cN\)-postions have nonzero nim sum.

4. Who Wins these Nim Positions?

Use nim sums to determine whether each of these nim positions is an \(\cN\)-postion or a \(\cP\)-position. If it is an \(\cN\)-position, list all of the winning moves.

Solution.
\begin{equation*} \begin{array}{r} 010 \\ 011 \\ \oplus 101 \\ \hline 100 \end{array} \end{equation*}

The winning move is \((2,3,1)\text{.}\)

Solution.
\begin{equation*} \begin{array}{r} 010 \\ 010 \\ 110 \\ \oplus 100 \\ \hline 010 \end{array} \end{equation*}

There are three winning moves: \((0,2,6,4)\) and \((2,0,6,4)\) and \((2,2,4,4)\text{.}\)

Solution.
\begin{equation*} \begin{array}{r} 001 \\ 011 \\ 100 \\ \oplus 101 \\ \hline 011 \end{array} \end{equation*}

There is one winning move: \((1,0,4,5)\text{.}\)