Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Nim
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== The subtraction game === <imagemap> File:Subtraction_game_SMIL.svg|thumb|Interactive subtraction game: Players take turns removing 1, 2 or 3 objects from an initial pool of 21 objects. The player taking the last object wins. default [http://upload.wikimedia.org/wikipedia/commons/4/4d/Subtraction_game_SMIL.svg] </imagemap> In another game which is commonly known as nim (but is better called the [[subtraction game]]), an upper bound is imposed on the number of objects that can be removed in a turn. Instead of removing arbitrarily many objects, a player can only remove 1 or 2 or ... or ''k'' at a time. This game is commonly played in practice with only one heap. Bouton's analysis carries over easily to the general multiple-heap version of this game. The only difference is that as a first step, before computing the nim-sums we must reduce the sizes of the heaps [[modular arithmetic|modulo]] ''k'' + 1. If this makes all the heaps of size zero (in misère play), the winning move is to take ''k'' objects from one of the heaps. In particular, in ideal play from a single heap of ''n'' objects, the second player can win [[if and only if]] * ''0'' = n (mod ''k'' + 1) (in normal play), or * ''1'' = n (mod ''k'' + 1) (in misère play). This follows from calculating the [[nim-sequence]] of ''S''(1, 2, ..., ''k''), <math display="block">0.123\ldots k0123\ldots k0123\ldots = \dot0.123\ldots\dot{k}, </math> from which the strategy above follows by the [[Sprague–Grundy theorem]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)