search
Get Started
search
Nim - Number Game
zoom_in Click to enlarge

Nim

description Nim Overview

Several piles of objects are enough to play Nim, a two-player mathematical strategy game with fully visible information. On each turn, a player removes one or more objects from a single pile. Under normal play, taking the final object wins. The rules are brief, but choosing how many objects to remove can require reasoning about the entire position rather than concentrating on the largest pile.

Optimal play can be determined using the nim-sum, the binary exclusive-or of the pile sizes. This calculation identifies an important structure beneath the apparent simplicity of the game. Charles L. Bouton published a complete analysis in 1901, making Nim a foundational example in combinatorial game theory.

It suits players interested in exact strategy and educators introducing mathematical games, since the connection between a move and a provable outcome can be explored with ordinary counters.

help Nim FAQ

How do you win the mathematical game of Nim?

Under the standard normal-play rule, the player who takes the final object from the piles wins the game. To guarantee a win, a player must leave the opponent in a losing position by calculating the binary XOR (exclusive OR) sum of the objects in all piles.

What is the binary XOR strategy used in Nim?

Optimal play requires converting the number of objects in each pile into binary numbers and calculating their exclusive OR (XOR) sum. If the resulting Nim-sum is not zero, the player whose turn it is can always make a move that leaves a Nim-sum of zero for their opponent.

What are the basic rules for playing Nim?

Nim is played with several piles of objects where two players take turns removing items. On a single turn, a player must remove one or more objects from exactly one single pile.

Can the first player always win a game of Nim?

In the standard setup where the initial Nim-sum is not zero, the first player can mathematically force a win. However, if the initial Nim-sum is exactly zero, the second player holds the winning advantage.

Reviews & Comments

Write a Review

rate_review

Be the first to review

Share your thoughts with the community and help others make better decisions.

Save to your list

Save your favorites and follow how their scores change over time.

Save favorites
Track changes
Compare scores

Already have an account? Sign in

Compare Items

See how they stack up against each other

Comparing
VS
Select 1 more item to compare