TOPICS
Search

Exact Nim


Exact Nim is an impartial game played with n piles of counters, in which each move removes a positive number of counters from each of exactly k piles, where n and k are integers with 1<=k<=n. The positive numbers removed from the selected piles may differ. Under normal play, a player who cannot move loses. For k=1 this is ordinary nim. Boros et al. (2018) determined the nim-value for n<=2k.

For 2k<=n<=3k, let x=(x_1,...,x_n) record the pile sizes and set r=n-2k. Define the rank b(x) to be the smallest integer obtained by taking the bitwise OR of any r+1 distinct piles' sizes. Define the capacity A(x) to be the greatest number of piles whose sizes can be strictly decreased at once while preserving the rank and leaving the other sizes unchanged. The reduction is allowed to leave every pile unchanged.

Gurvich et al. (2026) proved that a position x is losing precisely when A(x)<k. They obtained the Smith remoteness

 R(x)=2b(x)+{1   amp; if A(x)>=k; 0   amp; otherwise.
(1)

This is the number of moves remaining when the winner minimizes the duration and the loser maximizes it. The formula includes the previously open classification of losing positions for n=5 and k=2. The authors give a polynomial time algorithm to compute the rank and capacity, and report that AI-assisted experiments helped identify patterns used in their analysis.


See also

Impartial Game, Nim, Nim-Value

Explore with Wolfram|Alpha

References

Boros, E.; Gurvich, V.; Ho, N. B.; Makino, K.; and Muršič, P. "On the Sprague-Grundy Function of Exact k-Nim." Disc. Appl. Math. 239, 1-14, 2018. https://doi.org/10.1016/j.dam.2017.08.007.Gurvich, V.; Naumova, M.; Parfenov, A.; and Vyalyi, M. "Computing the Remoteness Function of Exact NIM(n,k) with n<=3k." 30 Nov 2026. https://arxiv.org/abs/2611.40648.

Cite this as:

Weisstein, Eric W. "Exact Nim." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/ExactNim.html

Subject classifications