The Amazing Dr. Nim

Invented by John Thomas Godfrey, copyright E.S.R. Inc., 1966.
(12" x 14.5" x 1.75" cardboard box, 11.5" high x 12.5" wide plastic board, 15 5/8" marbles)

The first page of the booklet describes how to play the basic game (as well as information about the game and variations such as starting with a different numbers of marbles):
Position the top three flippers right, right, left, and position the middle flipper (the "equalizer") to the right.

If you want to go first, position the lowest flipper to the right, and push the trigger in the lower right corner 1, 2, or 3 times to play 1, 2, or 3 marbles.

Then perform these steps for each round of play:
  1. Position the lowest flipper to the left.

  2. Push the trigger on the lower right once to make Dr. Play, who will then drop 1, 2, or 3 marbles (after done he will leave the lower flipper positioned right.)

  3. Push the trigger on the lower right 1, 2, or 3 times to play 1,2, or 3 marbles.
The loser is the one who drops the last marble.
Winning Strategy: Let n denote the current number of marbles waiting to be played, and define:
state = (n MOD 4) = the remainder when n is divided by 4
If Dr. Nim plays when the state = 1, you respond by playing the number of marbles to return the state to 1, and in the final round when only 1 marble is left, he loses. The initial state of 15 marbles is 15 MOD 4 = 3. If Dr. Nim goes first, the position of the center flipper to the right forces him to drop only one marble on the first turn, giving you a chance to play only one marble. Or if you go first, insted of playing just one marble, you can play 2 marbles. Either way, from 13 marbles, continue with a winning strategy that leaves him 9 marbles, then 5, and finally just 1.

Dr. Nim Directions (first page from the booklet)

Example Game Where Dr. Nim Wins
0. Starting position with 15 marbles (state = 3).
1. Drop 1 marble, leaving 14 (state = 2).
2. Dr. Nim drops 1 marble, leaving 13 (state = 1).
3. Drop 1 marble, leaving 12 (state = 0).
4. Dr. Nim drops 3 marbles, leaving 9 (state = 1).

(Example Game Where Dr. Nim Wins, continued)
5. Drop 3 marbles, leaving 6 (state = 2).
6. Dr. Nim drops 1 marble, leaving 5 (state = 1).
7. Drop 2 marbles, leaving 3 (state = 3).
8. Dr. Nim drops 2 marbles, leaving 1 (state = 1).
9. Drop 1 marble (and lose).

How Dr. Nim Works
The lowest flipper when positioned to the right routes the marble directly to the bottom, but when positioned to the left, routes the marble to the bottom by first rolling over the release lever, which causes another marble to drop.

The booklet calls the center flipper the "equalizer"; once flipped left it stays left. It prevents Dr. Nim from making the correct move of 2 marbles when he goes first (but you can do that if you go first). The booklet says that this is just Dr. Nim being a "true gentleman":


The row of three flippers on the top records the current state of the machine; that is, the current number of marbles MOD 4, which is one of 0, 1, 2, or 3 (the position of the equalizer does not affect state). In the example on the preceding two pages, each step notes the state that remains after that step has completed. For example:


State 0

State 1

State 2

State 3

When the bottom flipper is to the left, and with n marbles waiting to drop, when a marble drops, the state changes from n MOD 4 to (n – 1) MOD 4, and if the resulting state is not 1, the marble is shunted to the right center channel to cause another marble to drop (except when Dr. Nim moves first and the equalizer flipper prevents the marble from making a second marble drop).

Dr. Nim's state transition rule is simple: Each time a marble drops, state 3 goes to state 2, state 2 goes to state 1, state 1 goes to state 0, and state 0 goes to state 3 because:
(-1) MOD 4 = (-1 + 0) MOD 4 = (-1 + 4) MOD 4 = (3) MOD 4 = 3
When it is his turn, Dr. Nim does not know the current number of marbles. But assuming that the flippers were set correctly at the start (and there have been no mechanical problems like a flipper sticking or two balls dropping at the same time), he always knows the number MOD 4.
If it is his turn and state is not 1, he drops the number of marbles to leave a state of 1 (and continue with a winning strategy to win the game).

If it is his turn and state is 1, he drops just one marble, in the hope that you don't know the strategy and make an incorrect decision next round.

Dr. Nim Box Top and Bottom


Dr. Nim Board Front and Back
Here is the starting position when Dr. Nim goes first:
Here is the back of the board. A metal piece folds out so the board will be positioned on a slant, and a long plastic piece along the edge connects the push lever to the ball release:

Dr. Nim Booklet Pages
  

  

  

(Dr. Nim Booklet Pages, continued)
  

  

  

Further Reading


Wikipedia Page, from: http://en.wikipedia.org/wiki/Dr._Nim
Mad Scientist Page, from: http://www.evilmadscientist.com/2013/dr-nim
Rougetet Article, from: http://hal.archives-ouvertes.fr/hal-01349260/document
Playback Article, from: http://pbgames.wordpress.com/2012/07/08/1940-nimatron
History Computers Article, from: http://history-computer.com/ModernComputer/Relays/Condon.html
Condon Patent, from: www.uspto.gov - patent no. 2,215,54