Matthew's blog

2024-06-16   Chaos in 3-pile Nim

This exposition is based on results in "Combinatorial games with a pass: A dynamical systems approach" by Morrison, Friedman, and Landsberg.

Nim

You can play against the computer in Nim-with-a-pass to get a feel for the game:

This computer opponent plays a basic strategy. In the next section, we'll devise and visualize optimal play for 3-pile Nim-with-a-pass. While ordinary 3-pile Nim has been solved, adding a pass move (which can be used once per game by either player in a non-terminal position) dramatically increases the game's strucutre and complexity. We'll view Nim as a dynamical system by defining an operator that acts on sets of \(\mathscr{N}\)-positions according to Nim rules. Nim-with-a-pass can be understood as an instantiation of a generic game, which is a perturbation of the Nim dynamical system. This framework will help explain a scale invariance property and fractal structure arising in 3-pile Nim-with-a-pass.

3-pile Nim

Before tackling Nim-with-a-pass, we'll first analyze traditional Nim. In 3-pile Nim, a game position can be represented by a triplet of nonnegative integers \((x, y, z)\). Our goal is to study the set of \(\mathscr{P}\)-positions as a three-dimensional object, which we'll call the \(\mathscr{P}\)-set \cite{nonlinear}. We know that this set is characterized by triplets whose XOR sum is zero, but this framework will generalize to the pass version. Consider partioning the position space into two-dimensional "sheets" indexed by \(x\), with \(y\) and \(z\) being coordinates within a sheet.

Definition 1.1 The \textit{loser sheet} at level $x$, denoted $L^{x}$, is an infinite boolean matrix which is 1 at $(y, z)$ if and only if $(x, y, z)$ is a $\mathscr{P}$-position.

Stacking the loser sheets recovers the \(\mathscr{P}\)-set. The loser sheets can be obtained from another class of sheets that record instant winners.

\begin{defn} A position \((x, y, z)\) is an \textit{instant winner} if there is a \(\mathscr{P}\)-position \((x', y, z)\) with \(0 \le x' < x\). The \textit{instant-winner sheet} at level \(x\), denoted \(W^{x}\), is an infinite boolean matrix which is 1 at \((y, z)\) if and only if \((x, y, z)\) is an instant winner. \end{defn}

While 1 in an instant-winner sheet indicates a \(\mathscr{N}\)-position, 0 can mean either \(\mathscr{P}\) or a \(\mathscr{N}\)-position that decrements \(y\) or \(z\) to reach a \(\mathscr{P}\)-position.

\begin{ex} The first \(3 \times 3\) entries of \(L^1\) and \(W^1\) are [ L^1 = \begin{bmatrix} 0 & 1 & 0 \ 1 & 0 & 0 \ 0 & 0 & 0 \end{bmatrix} \quad W^1 = \begin{bmatrix} 1 & 0 & 0 \ 0 & 1 & 0 \ 0 & 0 & 1 \end{bmatrix}. ] Note that while \((1, 0, 2)\) is an \(\mathscr{N}\)-position, the entry \(W^1_{0,2}\) is zero because the winning move is not to decrement 1 but rather to move in \(z\) from 2 to 1. \end{ex}

The Nim Attractor

The supermex operator \(\mathcal{M}\) acts on \(W^x\) as follows:

  1. Set \(\mathcal{M}W^x = \mathbf{0}\), \(T = W^x\), and \(y = 0\).
  2. Let \(z_s = \mathrm{mex}\{ z \mid T_{y,z} = 1 \}\). Set \((\mathcal{M}W^x)_{y, z_s} = 1\) and \(T_{y+t, z_s} = 1\) for all \(t \ge 0\).
  3. Set \(y \gets y + 1\) and repeat (2).