Danonymous

Teaching Reasoning with Games

I've written before about teaching math using mathemagic tricks. Here's another strategy I like: two-player strategy games.

In particular, I use solved games. These are toy examples simple enough that motivated students can usually work out the optimal strategy. I can't give much advice on using them effectively, except to say that I'm always pushing the students for their reasoning. It's OK if someone figures out the strategy quickly because their next challenge is to convince others it will always work.

This isn't a treatise on how to teach with these games. Think of it as more of a starter pack.


NIM

This game is a classic. In the '60s, there was a commercial single-player version where the opponent was a sort of mechanical calculator built from a marble run. Standup-Maths has a fun video on it.

Rules

Lay out 20 tokens, which can be anything small and countable. The two players take turns removing tokens from the middle. On your turn, you may take 1, 2, or 3 tokens. Whoever gets the final token is the winner.

Pedagogy

Students quickly notice there's something special about leaving 4 tokens. If there are 4 tokens at the end of your turn, you're guaranteed the win. Then we can work inductively: the whole game is 5 groups of 4. Can you use that to win every time? (Yes, as long as you go second.)

When everybody understands the strategy well enough, we generalize. I have lots of variations on NIM, in the what-if/what-if-not style of Brown & Walter (2005). Students often pose some. What if there were a different number of tokens? What if we could take 4 tokens every turn? And my favorite variant, because it's easier than it seems: what if you lose by taking the last token as a "poison piece"?

Have the students generalize and formalize as appropriate for their abilities. I often use colorful counting blocks to let students illustrate their thinking in a tactile way.


Fortress

I found this one as a puzzle in The Price of Cake by Clément and Guillaume Deslandes. There, it was framed as a game with coins or tokens. I use playing cards in the classroom. This is the only one of the three games to involve randomness.

Rules

Use playing cards numbered Ace through 10. Shuffle them, then deal the cards face-up in a line. The two players take turns removing exactly one card from either end of the line. At the end, each player will have 5 cards. Add up your points (Aces count as 1). Whoever has more points is the winner.

Pedagogy

First, I have students play a few rounds to get a feel for the strategy. They quickly notice that you shouldn't always choose the higher available card, because sometimes it will reveal an even better one for your opponent to take. At this point, I make sure they consider that there are 55 points on the board and it's impossible to tie (i.e. if you get to 28 you win).

Next, I ask the students whether they think it's generally better to go first or second. Their answer is typically that it depends on the order of the cards. I ask, "If you have to choose before you see the order of the cards, would you rather go first or second?" Having played a few rounds, they hopefully observe that player 1 wins most of the time.

So I challenge them: arrange the cards favorably for player 2. I'll be player 1; that's my advantage. And for their advantage, they get to arrange the cards in any order they want. It's surprisingly difficult to beat me under these conditions. After several tries, some will claim it's impossible to beat me when I can go first. At that point, I expand my challenge: if you think it's possible, arrange the cards so player 2 can win. Otherwise, describe a strategy player 1 can always use to win.


Takeaway

This one is also sometimes called Nim, but the rules are different enough that the strategy is almost completely unrelated. I learned it from Mathematical Wizardry. The book is written by Harry Lorayne, a favorite magician of mine, and I couldn't not buy it. It's written for performers; YMMV.

Rules

Have some distinguishable tokens. Let's say we have pennies, nickels, and dimes. Lay out one penny, three nickels, and five dimes. The two players take turns removing coins from the table. On your turn, you choose a type of coin and remove as many as you want of that denomination. You have to take at least one. Whoever takes the last coin loses.

The original game uses indistinguishable tokens in rows, and on each turn you can only take from one row. It's equivalent, just better for tricking people. I want to make the game easier to figure out, so I use visually distinct tokens in the classroom.

Pedagogy

As with NIM, there are winning states. I help students focus on finding these winning states by working backwards. Clearly, if you leave just one coin on the table then your opponent has to take it and you win. What other "checkpoints" can we build from that, working backwards?

If your students find all possible checkpoints, they will have a complete strategy. The different types of coins are interchangable in that one penny, one nickel, and three dimes isn't meaninfully different from one penny, one dime, and three nickels.

What about with different starting states? Add quarters into the mix, or change how many of each coin you start with.


Spoilers Ahead: Optimal Strategies

I'm not going to explain these strategies in detail. I'll give the strategy, but why it works is an exercise for the reader.

Nim

For the original variant, collect every 4th token. This is always possible if you go second. If you go first, there is still hope: if your opponent collects any token which is not a multiple of 4, you'll be able to get the next multiple.

When playing with a different number of tokens, think in groups of 4. If you don't have a round number of tokens, put your parital group at the start so that the winning token still completes a group of 4.

When you are allowed to take up to n tokens per turn, adjust your groups to be of size n+1.

When playing with the "poison piece," simply play as usual but aim for the second-to-last token.

Fortress

Imagine the cards alternate colors: red, black, red, black, et cetera. Add up the red ones. Is it 28 or greater? On your turn, always take a red one. Try it, and you'll quickly see it's possible. If your sum is less than or equal to 27, collect the black cards instead.

Takeaway

The winning turn-end states on the standard game are (1,0,0),(1,1,1),(2,2,0),(3,3,0),(1,2,3), and all of their permutations. Player 1 can always win by taking 3 coins from the group of 5 to make (1,3,2).

In general, those winning states hold no matter how the board starts. There are just additional winning states with more tokens. I haven't found a complete strategy for arbitrary setups yet, but there are lots of patterns in the winning and losing states.

#math #puzzles #teaching