Skip to content →

neverendingbooks Posts

How to play Nimbers?

Nimbers is a 2-person game, winnable only if you understand the arithmetic of the finite fields $\mathbb{F}_{2^{2^n}} $ associated to Fermat 2-powers.

It is played on a rectangular array (say a portion of a Go-board, for practical purposes) having a finite number of stones at distinct intersections. Here’s a typical position

The players alternate making a move, which is either

  • removing one stone, or
  • moving a stone to a spot on the same row (resp. the same column) strictly to the left (resp. strictly lower), and if there’s already a stone on this spot, both stones are removed, or
  • adding stones to the empty corners of a rectangle having as its top-right hand corner a chosen stone and removing stones at the occupied corners

Here we illustrate two possible moves from the above position, in the first we add two new stones and remove 2 existing stones, in the second we add three new stones and remove only the top right-hand stone.

As always, the last player able to move wins the game!

Note that Nimbers is equivalent to Lenstra’s ‘turning corners’-game (as introduced in his paper Nim-multiplication or mentioned in Winning Ways Chapter 14, page 473).

If all stones are placed on the left-most column (or on the bottom row) one quickly realizes that this game reduces to classical Nim with Nim-heap sizes corresponding to the stones (for example, the left-most stone corresponds to a heap of size 3).

Nim-addition $n \oplus m $ is defined inductively by

$n \oplus m = mex(n’ \oplus m,n \oplus m’) $

where $n’ $ is any element of ${ 0,1,\ldots,n-1 } $ and $m’ $ any element of ${ 0,1,\ldots,m-1 } $ and where ‘mex’ stands for Minimal EXcluded number, that is the smallest natural number which isn’t included in the set. Alternatively, one can compute $n \oplus m $ buy writing $n $ and $m $ in binary and add these binary numbers without carrying-over. It is well known that a winning strategy for Nim tries to shorten one Nim-heap such that the Nim-addition of the heap-sizes equals zero.

This allows us to play Nimber-endgames, that is, when all the stones have been moved to the left-column or the bottom row.

To evaluate general Nimber-positions it is best to add another row and column, the coordinate axes of the array

and so our stones lie at positions (1,3), (4,7), (6,4), (10,3) and (14,8). In this way all legal moves follow the rectangle-rule when we allow rectangles to contain corners on the added coordinate axes. For example, removing a stone is achieved by taking a rectangle with two sides on the added axes, and, moving a stone to the left (or the bottom) is done by taking a rectangle with one side at the x-axes (resp. the y-axes)

However, the added stones on the coordinate axes are considered dead and may be removed from the game. This observation allows us to compute the Grundy number of a stone at position (m,n) to be

$G(m,n)=mex(G(m’,n’) \oplus G(m’,n) \oplus G(m,n’)~:~0 \leq m’ < m, 0 \leq n’ < n) $

and so by induction these Grundy numbers are equal to the Nim-multiplication $G(m,n) = m \otimes n $ where

$m \otimes n = mex(m’ \otimes n’ \oplus m’ \otimes n \oplus m \otimes n’~:~0 \leq m’ < m, 0 \leq n’ < n) $

Thus, we can evaluate any Nimbers-position with stone-coordinates smaller than $2^{2^n} $ by calculating in a finite field using the identification (as for example in the odd Knights of the round table-post) $\mathbb{F}_{2^{2^n}} = \{ 0,1,2,\ldots,2^{2^n}-1 \} $

For example, when all stones lie in a 15×15 grid (as in the example above), all calculations can be performed using

Here, we’ve identified the non-zero elements of $\mathbb{F}_{16} $ with 15-th roots of unity, allowing us to multiply, and we’ve paired up couples $(n,n \oplus 1) $ allowing u to reduce nim-addition to nim-multiplication via

$n \oplus m = (n \otimes \frac{1}{m}) \otimes (m \oplus 1) $

In particular, the stone at position (14,8) is equivalent to a Nim-heap of size $14 \otimes 8=10 $. The nim-value of the original position is equal to 8

Suppose your opponent lets you add one extra stone along the diagonal if you allow her to start the game, where would you have to place it and be certain you will win the game?

One Comment

What is the knot associated to a prime?

Sometimes a MathOverflow question gets deleted before I can post a reply…

Yesterday (New-Year) PD1&2 were visiting, so I merely bookmarked the What is the knot associated to a prime?-topic, promising myself to reply to it this morning, only to find out that the page no longer exists.

From what I recall, the OP interpreted one of my slides of the April 1st-Alumni talk

as indicating that there might be a procedure to assign to a prime number a specific knot. Here’s the little I know about this :

Artin-Verdier duality in etale cohomology suggests that $Spec(\mathbb{Z}) $ is a 3-dimensional manifold, as Barry Mazur pointed out in this paper

The theory of discriminants shows that there are no non-trivial global etale extensions of $Spec(\mathbb{Z}) $, whence its (algebraic) fundamental group should be trivial. By Poincare-Perelman this then implies that one should view $Spec(\mathbb{Z}) $ as the three-sphere $S^3 $. Note that there is no ambiguity in this direction. However, as there are other rings of integers in number fields having trivial fundamental group, the correspondence is not perfect.

Okay, but then primes should correspond to certain submanifolds of $S^3 $ and as the algebraic fundamental group of $Spec(\mathbb{F}_p) $ is the profinite completion of $\mathbb{Z} $, the first option that comes to mind are circles

Hence, primes might be viewed as circles embedded in $S^3 $, that is, as knots! But which knots? Well, as far as I know, nobody has a procedure to assign a knot to a prime number, let alone one having p crossings. What is known, however, is that different primes must correspond to different knots

because the algebraic fundamental groups of $Spec(\mathbb{Z})- { p } $ differ for distinct primes. This was the statement I wanted to illustrate in the first slide.

But, the story goes a lot further. Knots may be linked and one can detect this by calculating the link-number, which is symmetric in the two knots. In number theory, the Legendre symbol, plays a similar role thanks to quadratic reciprocity

and hence we can view the Legendre symbol as indicating whether the knots corresponding to different primes are linked or not. Whereas it is natural in knot theory to investigate whether collections of 3, 4 or 27 knots are intricately linked (or not), few people would consider the problem whether one collection of 27 primes differs from another set of 27 primes worthy of investigation.

There’s one noteworthy exception, the Redei symbol which we can now view as giving information about the link-behavior of the knots associated to three different primes. For example, one can hunt for prime-triples whose knots link as the Borromean rings

(note that the knots corresponding to the three primes are not the unknot but more complicated). Here’s where the story gets interesting : in number-theory one would like to discover ‘higher reciprocity laws’ (for collections of n prime numbers) by imitating higher-link invariants in knot-theory. This should be done by trying to correspond filtrations on the fundamental group of the knot-complement to that of the algebraic fundamental group of $Spec(\mathbb{Z})-{ p } $ This project is called arithmetic topology

Perhaps I should make a pod- or vod-cast of that 20 minute talk, one day…

6 Comments

NeB : 7 years and now an iPad App

Exactly 7 years ago I wrote my first post. This blog wasn’t called NeB yet and it used pMachine, a then free blogging tool (later transformed into expression engine), rather than WordPress.

Over the years NeB survived three hardware-upgrades of ‘the Matrix’ (the webserver hosting it), more themes than I care to remember, and a couple of dramatic closure announcements…

But then we’re still here, soldiering on, still uncertain whether there’s a point to it, but grateful for tiny tokens of appreciation.

Such as this morning’s story: Chandan deemed it necessary to correct two spelling mistakes in a 2 year old Fun-math post on Weil and the Riemann hypothesis (also reposted on Neb here). Often there’s a story behind such sudden comments, and a quick check of MathOverflow revealed this answer and the comments following it.

I thank Ed Dean for linking to the Fun-post, Chandan for correcting the misspellings and Georges for the kind words. I agree with Georges that a cut&copy of a blogpost-quoted text does not require a link to that post (though it is always much appreciated). It is rewarding to see such old posts getting a second chance…

Above the Google Analytics graph of the visitors coming here via a mobile device (at most 5 on a good day…). Anticipating much more iPads around after tonights presents-session I’ve made NeB more accessible for iPods, iPhones, iPads and other mobile devices.

The first time you get here via your Mac-device of choice you’ll be given the option of saving NeB as an App. It has its own icon (lowest row middle, also the favicon of NeB) and flashy start-up screen.

Of course, the whole point trying to make NeB more readable for Mobile users you get an overview of the latest posts together with links to categories and tags and the number of comments. Sliding through you can read the post, optimized for the device.

I do hope you will use the two buttons at the end of each post, the first to share or save it and the second to leave a comment.

I wish you all a lot of mathematical (and other) fun in 2011 :: lieven.

3 Comments