I presented my talk “Jim and Nim” yesterday at the Bard Math Seminar, and managed to fill the house.

My introduction actually extended over two days, as I visited math and CS classes on Wednesday and Thursday and personally invited students to my talk. This was really fun, and I got to meet some of Bard’s amazing undergraduates. I teased them with the **Magic Birthday Trick**:

Have you seen this?

- Identify the boxes that contain the day of the month that you were born. (For example, I was born on the 18th, and the number 18 appears only in the two boxes on the right.)
- Add up the numbers in the top left of each box that includes your birthdate. (For me, that’s 2 + 16.)
- The sum is mathemagically your birthdate.
- Share in the amazement!

Here’s a picture that I used to explain why this trick works. I’ll leave it to you to puzzle it out!

Another teaser I shared is the game I call **21-Nim**. Start with 21, and on your turn you subtract 1, 2 or 3. The first person to reach 0 is the winner. (My MAT student Kristen used this at our Pi Day Celebration for the students at 345 Brook Avenue in the Bronx.) What’s interesting here is the set of *losing* numbers, and I challenged the Bard students to find them. In a *losing* position, the next player will lose, if her opponent plays correctly. Can you find the losing positions?

We didn’t play 21-Nim during my talk, but we did play the classic game of Nim, with Teddy Bears:

**The Game of Nim**

**Strategy**

*Winning*and

*Losing*positions (the standard notation from Winning Ways is N and P positions), which brings up a natural opportunity to use quantifiers:

- If you are in a
*Losing*position, then**EVERY**move you make leads to a*Winning*position for your opponent. - If you are in a
*Winning*position, then there**EXISTS**a move that leaves your opponent in a*Losing*position.

**Jim**

*Jim*for short? One day in February 2011, I was running around Prospect Park in Brooklyn and thinking about how to motivate the strategy for Nim. Halfway around the park, I realized that a visual representation of the binary number strategy could be described independently of its connection to binary numbers and exclusive OR. I used the rest of my run to figure out just how to describe a Nim move visually in binary, which resulted in the game of Jim.

Can you explain why this is a *Losing* position?

One of the most exciting parts of the talk was at the end, when I revealed the connection between Jim and Nim with this slide:

Well, you might have had to be at my talk for this to make sense. Please leave a comment below to describe how Nim and Jim are related!

Great presentation Japheth! Math IS fun and makes sense! 🙂

If I'm understanding the rules of Jim right, then they are actually isomorphic games, yes?

@ben – That's right, Jim is the binary representation of Nim. Each Jim row, when read in binary (yellow = 1, red = 0) is the number of teddy bears in the corresponding NIm pile.

The Jim strategy is easy (easier?) to understand – it's just a parity argument on the number of yellow chips in each column. I decided that understanding that strategy first, before linking Nim to its binary representation, was the way to go.

This still begs the question – why does Nim have this binary strategy? So, while I don't feel like I've shed much light on this question, I'm happy with the sequencing of explaining Nim strategy.