Tuesday, May 5, 2009

Nim

Nim is a very famous mathematical game (bear with me) that can be played just about anywhere with anything. It’s extremely simple, and has spawned a number of variations -- I will be presenting three here -- all based upon the simple principle of removing tokens from stacks. Sounds thrilling, right? The game is perhaps more interesting from a mathematical standpoint than a, you know, playing one, but it is still fun, and will provide an excellent challenge for fans of logical strategy. It’s just about as pure as you can get in that regard.

Equipment

Nim requires no board, only tokens. Any number of tokens will do, although you’ll probably want at least 15 or so for an interesting game. You can use pennies or checkers or buttons or matches or whatever. They don’t have to match in any way; you just need objects.

I can also be played as a pen and paper game -- just draw lines or circles or whatever and cross them out as they’re removed.

Rules

The general idea behind Nim is that you have “heaps” (rows, for our purposes) of tokens that players take turns removing. Whoever removes the last token loses (it is very occasionally played where whoever removes the last token wins, but this creates shorter games with the same number of tokens, so I will be disregarding it -- the strategy and gameplay is essentially the same either way).

In standard Nim, you arrange your tokens in rows -- the number of rows doesn’t matter, nor does the number of tokens in the rows. There are usually a different number of tokens in each row, though.

Nim Setup Rows of length 5, 4, 3, and 4

Each turn, you take as many tokens as you want from a single row. You can take all the tokens in a row if you want, but you can’t take from multiple rows in the same turn. And that’s it -- as I said before, whoever takes the last token loses.

Circular Nim

I much prefer this variant of Nim -- first of all, once you know the secret to standard Nim, you can win every time, which kind of defeats the purpose. There’s surely a similar secret to Circular Nim, but I don’t know it and chances are neither does anyone I might happen to play against, making the game more fair. Also, it’s just prettier, and I think it’s a neat idea.

Circular Nim Setup

Instead of arranging tokens in rows, they are arranged in a circle. Each turn, you can remove 1, 2, or 3 adjacent tokens from the circle -- that is, they must be right next to each other. As tokens are removed, gaps form, and you cannot remove tokens across the gaps -- so if every other token has been taken (token, space, token, space, etc.) you could only take one token at a time, as none are adjacent to any others. As before, whoever takes the last token loses.

Circular Nim In Progress

The game can also be extended with multiple circles, where you take out 1-3 adjacent objects from just one of the circles. This would provide a longer game and add variety to the strategy once you figured out how to win at standard Circlular Nim.

Multiple Circles

21

This is technically a Nim variant, although it’s probably the most different. For one, it uses absolutely no equipment. You can play this anywhere, provided you have two people who can communicate numbers to one another.

The game begins with someone saying a number between 1 and 3. The next person adds a number between 1 and 3 to it and calls out the sum. Whoever is forced to say a number 21 or higher loses. So, for example, a possible game could be:

2 (5) 6 (7) 9 (10) 13 (16) 17 (20) 21

And the first player would lose.