Maison BeaulieuMAISON BEAULIEUAB ÉDITIONS · CULINARY ARTS & ARCHIVES
Iron Bonds · Games & Observation

In SET, Finding the Missing Card

A layout of cards poses three problems: verifying a candidate trio, finding all solutions present, and choosing among them. Our layouts are built to follow these operations step by step. We are studying a mathematical model; these situations do not recount an observed game.

The codes

Davis and Maclagan study 81 distinct cards combining four attributes with three values each. A trio is valid if each attribute displays either three identical values or three all-different values.

🎁 Free Heritage Gift · A4 Illustrated Booklet + 5 MP3s

Receive the “Pantheon of 28 Legendary Chefs” Dossier (Free A4 PDF) + 5 Audio Stories

Instant complimentary access to our illustrated gastronomic & historical dossier, plus 5 DRM-free MP3 audio chronicles.

Here is our encoding. The codes are labels; their numerical size ranks neither the colors nor the shapes.

CodeNumber of symbolsColorShapeShading
0oneredovalsolid
1twogreendiamondstriped
2threepurplesquiggleoutline

Let us read the columns in order. Thus (1, 2, 0, 2) designates two purple outlined ovals. The first coordinate does not count one symbol: it points to the row indicating two. Keeping the correspondence in mind prevents misreading calculation codes as symbol counts.

Take the cards (0, 0, 0, 0), (0, 1, 1, 1), and (0, 2, 2, 1). The first column gives 0, 0, 0. The next two each give 0, 1, 2. Yet the last gives 0, 1, 1: one shading is paired with two others identical to each other. The trio fails on that final check.

We can change our encoding by swapping the names of two colors everywhere. Equalities in that column remain equalities, and three distinct values stay distinct. The verdict is preserved. By contrast, changing the code of a single card without applying the same relabeling to the others alters the problem data. That difference explains both the freedom of the labels and the need to apply them consistently.

Computing C

Now consider A = (1, 2, 0, 2) and B = (0, 1, 1, 2). In the first column, codes 1 and 0 call for code 2. In the second, 2 and 1 call for 0. In the third, 0 and 1 call for 2. In the last, the two 2s call for 2 again. We obtain C = (2, 0, 2, 2): three red outlined squiggles.

Two equal codes force that same code; two different codes force the sole unused value. These independent choices fix C. Combining all four results therefore yields a single possible answer for the given pair.

An arithmetic formula sums up the construction: for coordinates a and b, take the remainder of −a − b upon division by three. With 1 and 0, that remainder is 2; with 2 and 1, it is 0; with 2 and 2, it is 2. No carry passes to the next coordinate. This is an operation on codes, not an addition of the symbols drawn on the cards.

Why does this shortcut work? The three all-equal cases sum to 0, 3, or 6. All six permutations of the three distinct codes sum to 3. Conversely, if two codes equal a and the third is b, their sum has the same remainder as b − a, since their difference is 3a. With distinct a and b drawn from 0, 1, and 2, that remainder can never be zero. These cases exhaust every possibility for a column.

Let us also verify that C differs from both inputs. If C equaled A, the relation would give B ≡ −2A ≡ A (mod 3), since −2 and 1 share the same remainder. That would contradict choosing distinct A and B. The case C equal to B leads to the same contradiction. This argument reads coordinate by coordinate using the same codes.

The formula would also accept three copies of the same quadruple. Our model excludes them because it uses distinct cards. Constructing C from two distinct inputs preserves that requirement thanks to the argument above. If someone prepares a computer list accidentally containing duplicate copies of one card, a sum check alone will not catch that list error.

Preparing twelve cards with no solution

Whether that complement appears in a given layout is a property we can test with a very simple family. Keep only cards whose every code is 0 or 1. Two choices for each of the four coordinates yield sixteen distinct cards.

Pick any two of those cards. Since they differ, at least one coordinate has a 0 on one card and a 1 on the other. The complementary code there is 2. Yet our family contains no card bearing a 2. The answer is therefore missing for every pair in the family. No valid trio can hide inside it: if one existed, any of its pairs would find its third card inside that same family, which we have just ruled out.

Twelve cards chosen from those sixteen preserve that absence. Here is the selection we will use, writing the four codes without commas to keep the list compact: 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011. Each differs from the other eleven. This is a constructed layout, with no random deal claimed.

This selection gives concrete form to the obstacle a player faces. None of the expected complements appear here. The argument does not claim that every twelve-card table lacks a solution. It supplies a table where absence is proved. Nor does it seek the maximum size of a set-free family: the sixteen-card example already gives everything we need.

We can spot the obstacle on a single pair. With 0000 and 1000, the complement is 2000. That entry does not appear in the chosen list. Searching for that card among the twelve therefore cannot succeed, even when the calculation was executed flawlessly. For that pair, we know both the expected answer and the reason it is missing.

Adding one card, then proving only a single trio appears

Let us add precisely 2000 to our list. We now have a constructed thirteen-card problem; this edit serves the explanation without announcing any official dealing rule. The trio 0000, 1000, 2000 becomes available. What remains is knowing whether the addition created any others as well.

No trio can consist solely of the twelve original cards, since their lack of a solution has already been proved. Every new trio must therefore contain 2000. Look at the last three coordinates of its two partners. In each of them, the new card carries 0, and the original cards can supply only 0 or 1.

If both partners carry 0, that column passes. If both carry 1, we get 1, 1, 0, which fails. If they split 0 and 1, we again get only two values, with repetition. Their last three coordinates must therefore all be zero. Among our original cards, only 0000 and 1000 remain.

Their first coordinates do complete that of 2000. Both required partners exist, and checking the remaining coordinates ruled out every other choice. We have thus proved both the existence and the uniqueness of the trio. The first demand was met the moment we spotted it; the second required justifying why no other could appear.

Searching by pairs and counting each trio only once

In his programming article, Sander Evers organizes the search around pairs and their complement. Let us examine the counts and lookup order on our layouts.

With twelve cards, the number of trios to inspect directly is 12 × 11 × 10 ÷ 6, or 220. We divide by six because the same three cards can be named in six orders. The number of pairs is 12 × 11 ÷ 2, or 66. Computing the complement then turns each pair into a membership lookup in the table. These figures count combinations and queries; they do not say how many seconds a human player will take to spot a pattern.

Number the slots on the table. For each pair of slots i and j with i less than j, keep the result only if the complement sits in a slot k greater than j. The three cards of any trio necessarily occupy a first, a second, and a third slot. Only the pair of the first two accepts the last; the other two pairs look up a card sitting too early to pass the check.

In our thirteen-card layout, 0000 sits in slot 1, 1000 in slot 9, and 2000 in slot 13. The pair of slots 1 and 9 accepts the card in slot 13. Pairs 1–13 and 9–13 look up slots 9 and 1 respectively, neither of which comes after 13. The trio is therefore recorded only once. These numbers are lookup positions; they alter neither the codes nor the validity of the trio.

Choosing two removals rather than the first trio spotted

Now set a different goal on a fixed list: remove the largest possible number of disjoint trios, without adding cards between removals. This small selection problem does not claim to supply the rules of a commercial game. It shows what a complete list of solutions still leaves undecided.

Give our seven cards names: A = 0000, B = 1000, C = 2000, D = 0100, E = 0110, F = 0120, G = 0200. The available trios are ABC, ADG, and DEF. Here is how to verify that the list is complete, rather than merely spotting those three answers.

The trios in the seven-card caseABC, ADG, and DEF, with the entry codes.A 0000B 1000C 2000A 0000D 0100G 0200D 0100E 0110F 0120
The trios in the seven-card case. Each letter designates a single entry.

If B is paired with D, E, F, or G, its complement begins with 21 or 22. Yet the only card starting with 2 in our list is C, whose second code is 0. Those pairs therefore fail. B with A or C, on the other hand, recovers the trio ABC. For C paired with D, E, F, or G, the complement begins with 11 or 12; the only card starting with 1 is B, which begins with 10. Thus every trio using B or C must be ABC.

That leaves A, D, E, F, and G. In the second coordinate, A supplies 0, the three cards D, E, and F supply 1, and G supplies 2. Any trio from this sublist therefore takes either D, E, and F, or A, G, and one of the three middle cards. In the latter choice, the third coordinate of A and G is already 0, so only D completes the trio—giving ADG. In the other choice, the third coordinates of D, E, and F are 0, 1, and 2, giving DEF. The first and last coordinates are zero in both cases.

Remove ABC. The list becomes D, E, F, G; we can still remove DEF. Two removals are therefore achievable. They are also the maximum: with seven cards, three disjoint removals would require nine cards. After the two chosen removals, only G remains.

If instead you start with ADG, the remaining cards are B, C, E, and F. They contain none of the three trios on our exhaustive list. The problem halts after a single removal. Starting with DEF, by contrast, still lets you remove ABC afterward, leaving G alone at the end.

All three initial answers were valid. Yet they did not have the same effect on the goal we just set. ADG borrows one card from each of the two disjoint trios ABC and DEF, blocking the two subsequent removals. Enumerating the solutions made that trade-off analyzable; blindly taking the first line on the list would not have met the maximum-removal goal.

Changing the condition also changes the number of answers

In the abstract of his research on related games, Jonathan Schneider introduces STUN: the target trio displays exactly two distinct values in each attribute. We borrow this predicate alone for a mathematical comparison, without reconstructing the other procedures of that variant.

Take 0000 and 1111. In every column, the third card must pick 0 or 1. A 2 would introduce three values and fail the new rule. Four independent binary choices yield sixteen quadruples. Two of them, however, match the cards already used: 0000 and 1111. Keeping three distinct cards leaves fourteen possible complements.

With 0000 and 1000, the count shifts. The first coordinate of the answer must still be 0 or 1. In each of the other three columns, both cards already hold 0, so the answer must take 1 or 2 there. We have two choices in each of the four positions, or sixteen answers. None of them matches either initial card, since those end in three zeros. All sixteen therefore qualify, without the two exclusions from the first example.

The outcomes differ even though we started from the exact same deck of possible cards. Changing the selection rule is enough to transform the problem: a pair can now call for multiple answers, and their count depends on which coordinates the pair shares. The unique-complement formula does not carry over as-is to this new rule. It is precisely by tracing the possible answers, column by column, that you see which rule gives the method its power.