# Set (card game)

Set (stylized as SET or SET!) is a real-time card game designed by Marsha Falco in 1974 and published by Set Enterprises in 1991. The deck consists of 81 unique cards that vary in four features across three possibilities for each kind of feature: number of shapes (one, two, or three), shape (diamond, squiggle, oval), shading (solid, striped, or open), and color (red, green, or purple). Each possible combination of features (e.g. a card with three striped green diamonds) appears as a card precisely once in the deck.

## Gameplay

In the game, certain combinations of three cards are said to make up a "set". For each one of the four categories of features—color, number, shape, and shading—the three cards must display that feature as either a) all the same, or b) all different. Put another way: For each feature the three cards must avoid having two cards showing one version of the feature and the remaining card showing a different version.
For example, 3 solid red diamonds, 2 solid green squiggles, and 1 solid purple oval form a set, because the shadings of the three cards are all the same, while the numbers, the colors, and the shapes among the three cards are all different.
For any set, the number of features that are constant (the same on all three cards) and the number of features that differ (different on all three cards) may break down as: all 4 features differing; or 1 feature being constant and 3 differing; or 2 constant and 2 differing; or 3 constant and 1 differing. (All 4 features being constant would imply that the three cards in the set are identical, which is impossible since no cards in the Set deck are identical.)

## History

The game evolved out of a coding system that the designer used in her job as a geneticist. The shapes are based on those in ISO 5807. Set won American Mensa's Mensa Select award in 1991 and placed 9th in the 1995 Deutscher Spiele Preis.

## Games

Several games can be played with these cards, all involving the concept of a set. A set consists of three cards satisfying all of these conditions:
* They all have the same number or have three different numbers.
* They all have the same shape or have three different shapes.
* They all have the same shading or have three different shadings.
* They all have the same color or have three different colors.
The rules of Set are summarized by: If you can sort a group of three cards into "two of ____ and one of ____", then it is not a set.
For example, these three cards form a set:
* One red striped diamond
* Two red solid diamonds
* Three red open diamonds
Given any two cards from the deck, there is one and only one other card that forms a set with them.
In the standard Set game, the dealer lays out cards on the table until either twelve are laid down or someone sees a set and calls "Set!". The player who called "Set" takes the cards in the set, and the dealer continues to deal out cards until twelve are on the table. A player who sees a set among the twelve cards calls "Set" and takes the three cards, and the dealer lays three more cards on the table. (To call out "set" and not pick one up quickly enough results in a penalty.) There may be no set among the twelve cards; in this case, the dealer deals out three more cards to make fifteen dealt cards, or eighteen or more, as necessary. This process of dealing by threes and finding sets continues until the deck is exhausted and there are no more sets on the table. At this point, whoever has collected the most sets wins.
Variants were included with the Set game that involve different mechanics to find sets, as well as different player interaction. Additional variants continue to be created by avid players of the game.

## Basic combinatorics of Set

* Given any two cards, there is exactly one card that forms a set with those two cards. Therefore, the probability of producing a Set from 3 randomly drawn cards from a complete deck is 1/79.
* A cap set is a mathematical structure describing a Set layout in which no set may be taken. The largest group of cards that can be put together without creating a set is 20, proven in 1971 (cap sets were studied before the game). Such a group is called a maximal cap set (sequence A090245 in the OEIS). Donald Knuth found in 2001 that there are 682344 such cap sets of size 20 for the 81-card version of Set; under affine transformations on 4-dimensional finite space, they all reduce to essentially one cap set.
* There are $\textstyle {\frac {81 \choose 2}{3}}={\frac {81\times 80}{2\times 3}}=1080$ unique sets.
* The probability that a set will have $d$ features different and $4-d$ features the same is $\textstyle {\frac {{4 \choose d}2^{d}}{80}}$. (Note: The case where d = 0 is impossible, since no two cards are identical.) Thus, 10% of possible sets differ in one feature, 30% in two features, 40% in three features, and 20% in all four features.
* The number of different 12-card deals is $\textstyle {81 \choose 12}={\frac {81!}{12!69!}}=70\,724\,320\,184\,700\approx 7.07\times 10^{13}$.
* The odds against there being no Set in 12 cards when playing a game of Set start off at 30:1 for the first round. Then they quickly fall, and after about the 4th round they are 14:1 and for the next 20 rounds, they slowly fall towards 13:1. So for most of the rounds played, the odds are between 14:1 and 13:1.
* The odds against there being no Set in 15 cards when playing a game are 88:1. (This is different from the odds against there being no Set in any 15 cards (which is 2700:1) since during play, 15 cards are only shown when a group of 12 cards has no Set.)
* Around 30% of all games always have a Set among the 12 cards, and thus never need to go to 15 cards.
* The maximum number of Sets for 12 cards is 14.
* The average number of available Sets among 12 cards is $\textstyle {12 \choose 3}\cdot {\frac {1}{79}}\approx 2.78$ and among 15 cards $\textstyle {15 \choose 3}\cdot {\frac {1}{79}}\approx 5.76$. However, in play the numbers are smaller.
* If there were 26 sets picked from the deck, the last three cards would necessarily form another 27th set.

## Complexity

Using a natural generalization of Set, where the number of properties and values vary, it was shown that determining whether a set exists from a collection of dealt cards is NP-complete.

## Reviews

* Games #107
* 1992 Games 100 in Games #112
* Family Games: The 100 Best