Nim
is a strategy game that may go back centuries: two players take turns removing 1, 2 or 3 coins from a pile, and whoever takes the last coin wins. It looks like guesswork, but one simple rule lets you win every game from 15 coins when you go first. Learn the rule in 5 minutes with whatever small things are on the table.
What you'll do
Lay out 15 coins, play a quick game of Nim (take 1, 2 or 3 each turn; taking the last coin wins), then learn the winning rule, always leave a multiple of 4, and use it to win from the first move.
At a glance
- Time
- 5 minutes for your first session
- Cost
- Nothing to buy. It uses things you already have at home.
- You need
- 15 small objects of the same kind, A table or any flat surface
- Members
What you need
Required
- 15 small objects of the same kind × 15 · $0 · household
Coins, paperclips, dried beans, buttons, toothpicks or unlit matches. Matches are traditional, but use something else when kids are playing.
Alternatives: Paperclips, Dried beans, Toothpicks
- A table or any flat surface × 1 · $0 · household
Nice to have
- A second player × 1 · $0 · household
Anyone at home, any age who can count to 15. Alone, you play both sides, which is the fastest way to see why the rule works.
How to do it
Pick up where you left off
Step ·
Count 15 coins into a single row on the table. The rules: players take turns; on your turn you must take 1, 2 or 3 coins from the row, never 0 and never more than 3; whoever takes the last coin wins. Decide who goes first. Playing alone, call the two sides Left and Right and play both, making each move honestly for that side. It worked if you can say the rules back: 1 to 3 coins a turn, last coin wins.
Show helpHide help
Tip: Common mistake: trying to plan from the start of the game. You only need the remainder rule: divide what's left by 4 and take the leftover.
Play a whole game without any plan, just taking whatever feels right. Watch the very end closely. Notice what happens when 4 coins are left and it is your turn: if you take 1, 2 or 3, you leave 3, 2 or 1, and the other player takes them all and wins. It worked if you spot that being left with 4 coins on your turn is a trap with no way out.
Show helpHide help
Tip: Common mistake: trying to plan from the start of the game. You only need the remainder rule: divide what's left by 4 and take the leftover.
If 4 is a trap, so is 8: whatever your opponent takes from 8 (1, 2 or 3), you take the rest of 4 (3, 2 or 1) and hand them 4 again. The same goes for 12. So the winning rule is: after your move, always leave a coins: 12, 8, 4, then 0. To find your move, divide the coins left by 4 and take the . With 15, 15 divided by 4 is 3 remainder 3, so take 3. After that, answer every move so the two of you take 4 together: they take 1, you take 3; they take 2, you take 2; they take 3, you take 1. It worked if you can say what to take from 15 (3), from 10 (2) and from 9 (1).
Show helpHide help
multiple of 4: A number you get by counting in fours: 4, 8, 12, 16 and so on.
remainder: What's left over after dividing into equal groups. 15 coins make 3 groups of 4 with 3 left over, so the remainder is 3.
subtraction game: The one-pile version of Nim, where each turn you may take only up to a fixed number, here 3.
Tip: Common mistake: trying to plan from the start of the game. You only need the remainder rule: divide what's left by 4 and take the leftover.
Put all 15 coins back. Go first and take 3, leaving 12. Then after each of your opponent's moves, take 4 minus what they took. Count the row after each of your turns: it should read 12, then 8, then 4, then 0, and you take the last coin. Play 2 games. If you go second, you can't force a win from 15, but the first time your opponent leaves a number that isn't a , take the and you are back in control. You did it: you know the rule that wins every time you go first. Next time, flip it to the version, where whoever takes the last coin loses: leave 1 more than a multiple of 4 (13, 9, 5, 1), so from 15 you open by taking 2.
Show helpHide help
misère: The version where taking the last object makes you lose instead of win. The word is French for misery.
Tip: Common mistake: trying to plan from the start of the game. You only need the remainder rule: divide what's left by 4 and take the leftover.
Tips
Common mistake: trying to plan from the start of the game. You only need the rule: divide what's left by 4 and take the leftover.
Group the coins in fours on the table, like 4-4-4-3. It makes the multiple-of-4 rule easy to see while you learn it.
When you teach a friend, let them win a couple of games first, then show them the trap at 4. Working out 8 and 12 themselves is the fun part.
Against someone who knows the rule, take turns going first. From 15, whoever starts and plays perfectly always wins.
Glossary
- Nim
- A two-player game where players take turns removing objects, and the player who takes the last one wins (or, in some versions, loses).
- multiple of 4
- A number you get by counting in fours: 4, 8, 12, 16 and so on.
- remainder
- What's left over after dividing into equal groups. 15 coins make 3 groups of 4 with 3 left over, so the remainder is 3.
- misère
- The version where taking the last object makes you lose instead of win. The word is French for misery.
- subtraction game
- The one-pile version of Nim, where each turn you may take only up to a fixed number, here 3.
Communities
Resources
- Nim (Wikipedia)The game's history, the multi-pile version, and the subtraction game you play here, including the game of 21 built on the same rule.
- Play Nim online (Archimedes Lab)Play a four-row version (1, 3, 5 and 7 matches) against the computer: take any number from one row, and whoever takes the last match loses. It uses a different winning rule from the one-pile game here.
Frequently asked questions
How long does it take to learn Nim?
The rules take a minute and the winning rule about five. After 2 or 3 games you can play the strategy without thinking.
What can I play with if I don't have coins?
Anything you have 15 of: paperclips, beans, buttons, toothpicks, pencils or marks on paper you cross out. Unlit matches are the classic choice for adults.
Can I play Nim alone?
Yes. Play both sides, honestly, and you learn the strategy faster because you see both players' choices. Once you know it, teach someone at home.
I went second and lost every time. What went wrong?
Nothing: from 15 coins, a first player who knows the rule always wins. Go second only against someone new, and as soon as they leave a number that isn't a multiple of 4, take the remainder.
Does the rule work with other numbers?
Yes. With any pile, if you may take 1 to 3, leave a multiple of 4. If you may take 1 to 5, leave a multiple of 6. The magic number is always one more than the most you can take.
Something off in this guide?