Salem witches – a math puzzle

[update 7-1]: I’m on vacation…will be back with posts the week of the 12th!

I came across a fun math puzzle that’s relates to the game theory of guessing.

The puzzle was posted by James Grime, a mathematician who has posted some nice videos under the name singingbanana.

Let’s get right into it.

The puzzle

I’ve transcribed the puzzle from the original video:

It’s the Salem witch trials and two villagers are accused of being witches.

Now the witch-finder general says “There is a very simple test to tell whether you are witches. Each pick a card from a deck, and you can look at it if you want. But what I want you to do is predict the color of the other person’s card.

I’m going to put you in separate rooms so there is no communication between you. And if you’re both wrong, or one of you is wrong, then you are free to go. But if you both correctly predict the color of the other person’s card, then you are in league with the devil and will be burned at the stake.”

….

You have one minute to discuss strategy before the game begins. What is the strategy to survive?

What do you think? Give it a try before reading the solution below.

The solution

James describes the answer and demonstrates it in detail in this six-minute Youtube video

I came up with the solution when I thought about the possible strategies.

Each witch can either base a guess on the card or perhaps make a random guess. A few ideas that came to mind were:

–each could guess the same color as the card
–each could guess randomly
–one could guess the same color, and the other the opposite

Guessing the same color is not a good idea and they will lose if they are both given the same color cards.

Guessing randomly fares poorly too. There is a 1/2 chance either person guesses correctly, so there is a 1/4 chance both will guess correctly and they will lose.

So the last one to check is the third strategy, and simple deduction shows this is a guaranteed winning strategy.

Imagine the first person guesses the same color and the other guesses the opposite. Then we can see that always one guess of the other person’s card will be wrong:

1 gets red, 2 gets red –> 1 guesses red, 2 guesses blue –> 2 is wrong and they win

1 gets red, 2 gets blue –>1 guesses red, 2 guesses red –> 1 is wrong and they win

1 gets blue, 2 gets red –>1 guesses blue, 2 guesses blue–> 1 is wrong and they win

1 gets blue, 2 gets blue –> 1 guesses blue, 2 guesses red –> 2 is wrong and they win

This proves the strategy works every time, but what exactly is the reason? Why should the cards lead them to a better answer than random guesses?

The trick is based on the logic of the strategies. The cards allow the players to coordinate because they have common knowledge about the structure of the game.

The first player is guessing the same color as the card she gets. In other words, the first player is correct if and only if the two cards are the same color.

The second player does the opposite. The second player’s guess is only right if the two cards are the opposite color.

Obviously the cards are the same color or opposite colors, and therefore only one of the guesses will be right.

This  means no matter which cards are given, the two players will be able to coordinate so that one player guesses wrong and they can both live.



Share this post:

| More

Previous post:

Next post:

Other posts you may enjoy reading:



  1. 9 Responses to “Salem witches – a math puzzle”

  2. And how do the witches know which one is player 1 and which one is player 2? After all, there is no communication between the two…

    By Jörn Martin Hajek on Jun 24, 2010

  3. Jorn makes a good point. I think some tacit focal point would have to be the solution: which witch looks more like a red witch, and who looks more like a black witch?
    Play your identities.

    Good game, though.

    By michael webster on Jun 24, 2010

  4. sorry i read it wrong please delete my first post
    “1 gets blue, 2 gets red –>1 guesses blue, 2 guesses blue–> 1 is wrong and they win”.
    Is it not 2 who is wrong ?

    By Ari on Jun 24, 2010

  5. Same question as Jorn. Wouldn’t they have to have communicated about this before hand?

    By Adnan on Jun 24, 2010

  6. I agree with Jörn.

    Obviously, it should be arranged that the higher member in the coven should always pick a particular choice and the other member should pick the opposite. This gives villagers an incentive to join the coven so that they will be able to arrange to be able to prove they are not witches! (jk)

    There is a potential opening in that the rules of the game are apparently read while both villagers are together. They might not be able to communicate after, but may be able to send a signal then, even if only passively, such as orientation with regard to each other.

    By anomdebus on Jun 24, 2010

  7. Thanks all for the comments. I added a sentence that the witches can discuss strategy before the game which will allow them to designate who is player 1 and 2.

    Second, the players are guessing the other person’s card. So in the scenario “1 gets blue, 2 gets red –>1 guesses blue, 2 guesses blue–> 1 is wrong and they win” player 1 is guessing that player 2 is holding a blue card which is wrong. That’s why player 1 is wrong and they win. Sorry it is convoluted–I will think of a better way to present it.

    By Presh Talwalkar on Jun 24, 2010

  8. I still have to disagree with Presh.

    But this is a fundamental disagreement – it focuses on what we can expect from a calculation versus a recommendation for action.

    The previous commentators, quite smartly I thought, pointed out that the problem was underdescribed.

    Presh then added to the problem description the ability of the participants to talk for a minute to discuss strategy.

    But if they can talk for a minute, they can simply agree on how to coordinate their guesses. Which makes the problem trivial.

    What makes this interesting as a problem is to find the conditions which would make Presh’s calculations a focal point and not my idiosyncratic observations the focal point – that is who looks like a red/blue witch.

    We are all better of with markets that allow calculations rather than stories for coordination, but it is not at all obvious how we manage to do achieve this.

    By michael webster on Jun 24, 2010

  9. Hy,
    Very interesting problem for sure.
    But it can be generalized to more than two people and more than to colors…

    As long as there is the same number of people and colors there is a strategy to pass the test.

    ;-)

    By Jouvent on Jun 25, 2010

  1. 1 Trackback(s)

  2. Jul 2, 2010: Travels in a Mathematical World

Leave a Comment



Previous post:

Next post:

Other posts you may enjoy reading: