Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Sprague–Grundy theorem
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
=== {{anchor|firstExample}}Example Nim Game === {{Pre| Sizes of heaps Moves A B C 1 2 2 Alice takes 1 from A 0 2 2 Bob takes 1 from B 0 1 2 Alice takes 1 from C 0 1 1 Bob takes 1 from B 0 0 1 Alice takes 1 from C 0 0 0 Bob has no moves, so Alice wins }} * At step 6 of the game (when all of the heaps are empty) the position is <math>\{\}</math>, because Bob has no valid moves to make. We name this position <math>*0</math>. * At step 5, Alice had exactly one option: to remove one object from heap C, leaving Bob with no moves. Since her ''move'' leaves Bob in position <math>*0</math>, her ''position'' is written <math>\{ *0 \}</math>. We name this position <math>*1</math>. * At step 4, Bob had two options: remove one from B or remove one from C. Note, however, that it didn't really matter which heap Bob removed the object from: Either way, Alice would be left with exactly one object in exactly one pile. So, using our recursive definition, Bob really only has one move: <math>*1</math>. Thus, Bob's position is <math>\{*1\}</math>. * At step 3, Alice had 3 options: remove two from C, remove one from C, or remove one from B. Removing two from C leaves Bob in position <math>*1</math>. Removing one from C leaves Bob with two piles, each of size one, i.e., position <math>\{*1\}</math>, as described in step 4. However, removing 1 from B would leave Bob with two objects in a single pile. ''His'' moves would then be <math>*0</math> and <math>*1</math>, so ''her'' move would result in the position <math>\{*0, *1\}</math>. We call this position <math>*2</math>. Alice's position is then the set of all her moves: <math>\big\{*1, \{*1\}, *2\big\}</math>. * Following the same recursive logic, at step 2, Bob's position is <math display="block">\big\{ \{*1, \{*1\}, *2\}, *2\big\}.</math> * Finally, at step 1, Alice's position is <math display="block">\Big\{ \big\{*1, \{*1\}, *2\big\}, \big\{*2, \{*1, \{*1\},*2\} \big\}, \big\{\{*1\}, \{\{*1\}\}, \{*1, \{*1\}, *2\}\big\} \Big\}.</math>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Sprague–Grundy theorem
(section)
Add topic