The Odds of Finding a Set in The Card Game SET

SET is a card game in which unique cards are dealt face-up into a shared array of 12 cards, like this:

Players simultaneously try to find a set of three cards. A set is defined as three cards in which each of the four features of the card (color, shape of symbols, number of symbols, and shading) have either all the same value or all different values.

For example, this is a set:

All three cards have different colors; all have different symbols; all have different numbers of symbols; and all have the same shading.

This is not a set:

All three cards have different colors; all are diamonds; all have one symbol; however, two have open shading and one does not.

Set is a fun game, whether or not you have kids in middle school math class. (You can buy it here if you want; note it gets 205 5-star reviews out of 238.)

The rules say that when a set is found, the three cards are removed and replaced by three more from the deck. If at any point there is no set of three cards in the array, then 3 more cards are added. The instruction booklet says that the odds against there being no set in 12 cards is 33:1, and the odds against no set in 15 cards is a whopping 2500:1. However, in playing the game, we were stymied more often than that with 12 cards, and even once with 15 cards (as shown in this crappy cell-phone-photo):

So one of the following must be happening:

  1. We were incredibly unlucky to get a one-in-2500 array of 15 in our first day of playing.
  2. We're too stupid to recognize a set when it is staring us in the face.
  3. The instruction book is completely wrong.
  4. The instruction book correctly gives the odds for an initial deal of 12 (or 15) cards, but in playing the game the odds worsen because an array formed by removing a set and then adding new cards is not the same as an array formed by a random deal.

I hoped that the answer was 4, and I did a quick simulation to check. Here's the code. And here are the results: First, when dealing 12 (or 15) cards and checking whether there is a set, I get:

Size |  Set  | NoSet | Set:NoSet for first deal
  12 |967906 | 32094 | 30:1
  15 |999622 |   378 | 2645:1
This agrees reasonably well with the ratios stated in the instructions (33:1 and 2500:1). But now if we simulate playing a game, removing sets and replacing them with new cards, we get:
Size |  Set  | NoSet | Set:NoSet for playing a game
  12 |1123475| 72281 | 16:1
  15 |  72252|   740 | 98:1
These ratios are quite different. The chances for finding no set among 12 cards has doubled. And the odds of finding no set with 15 cards has jumped 25-fold. Thus, my choice 4 above is indeed the answer. (My program verified that 2 is not the answer, but in fact there is a little bit of 1: we were slightly unlucky (not incredibly unlucky) since we encountered a NoSet after only a dozen or two 15-card arrays, which is 2 to 4 times faster than we should expect.)

Two problems remain. The first is to update the odds in the instruction booklet. I've let the good folks at know, and hope they can fix it in the next printing. But more interesting is the problem of why the odds change so dramatically. Intuitively, the idea is that players are picking up the "good" cards to make sets, leaving the "poor" cards, which are less likely to make a set. But what makes a card good or poor? As Gregory Quenell points out in this presentation, each of the 81 cards participates in exactly 40 sets (Note: at first I double-counted and said 80; Andrew and Trevor Baine set me straight), and each pair of cards participates in exactly one set. But not all sets are created equal. There are only 108 sets in which 3 of the 4 attributes are the same, twice as many (216) in which 0 are the same, three times as many (324) in which 2 are the same, and four times as many (432) in which 1 is the same. That provides a hint about what happens in the course of a game: at first the most likely set to form is one where only one of the attributes has values that are all the same and three attributes have values that are different; when the set is removed we start to get a shortage of possibilities for finding different values---too many cards with the same value on one of the attributes remain. (For example, in the photo above there are 8 cards that have 2 symbols.) This makes it harder to find a set. Another important factor (also pointed out by Quenell) is that we never even get a 15 card array unless there are no sets in the 12 card array. Similarly, with the exception of the initial deal, we never get a 12-card array unless there are no sets in the previous 9-card array (under the assumption that the players picking up sets are faster than the dealer). That helps explain why the probabilities are lower, but I still can't completely explain the mechanism, or find an analytic expression for the probability of finding a set over time ... can you?

Peter Norvig