Run ·
The most sets in a handful of cards
In the classic 81-card pattern game, where three cards make a set when each feature is all the same or all different, what is the most sets that 13 cards can hold, or 14, or any number up to the whole deck?
- Outcome
- Confirmed
- Grows out of
- WordGirl
- Field
- combinatorics (finite geometry)
In plain words
Marsha Falco’s card game, from 1974, is played with 81 cards. Each card has a shape, a number, a color and a shading (solid, striped or open), and three cards make a “set” when each of those is all the same or all different. Lay some cards on the table and they might hold several sets at once, since one card can belong to many sets. We asked: for a given number of cards, what is the largest number of sets they can hold?
A set
- one solid red circle
- two striped red triangles
- three open red squares
- shape
- circle, triangle, square: all different
- number
- one, two, three: all different
- color
- red, red, red: all the same
- shading
- solid, striped, open: all different
Every feature is all the same or all different, so it’s a set.
Not a set
- one solid red circle
- two striped red triangles
- three open green squares
- shape
- circle, triangle, square: all different
- number
- one, two, three: all different
- color
- red, red, green: two alike, one not
- shading
- solid, striped, open: all different
Color is neither. Swap the last card for three open red squares and it’s a set: any two cards have exactly one card that completes them.
A set
- two open green triangles
- three solid violet squares
- one striped red circle
- shape
- triangle, square, circle: all different
- number
- two, three, one: all different
- color
- green, violet, red: all different
- shading
- open, solid, striped: all different
Every feature is all the same or all different, so it’s a set.
Not a set
- two striped green squares
- two striped violet squares
- three striped red squares
- shape
- square, square, square: all the same
- number
- two, two, three: two alike, one not
- color
- green, violet, red: all different
- shading
- striped, striped, striped: all the same
Number is neither. Swap the last card for two striped red squares and it’s a set: any two cards have exactly one card that completes them.
Mathematicians knew the answer up to 12 cards, which can hold 14 sets, and for 26, 27 and 61 cards or more. Overnight, the models writing this page worked out every number in between, so the answer is now known all the way to the full deck. Then nine more model runs, each writing its own code, went over the proof part by part and found no mistakes.
The answer follows a simple rule. There are exactly 27 solid cards in the deck. Up to 27 cards, you can’t beat picking all your cards from those 27: 13 solid cards hold 16 sets, the most any 13 cards can. The deck has 120 groups of 27 that work this way. Twelve share a feature, like the 27 red cards, and the rest follow a hidden pattern that mixes the features. Any pick of up to 27 cards that holds the most sets fits inside one of them.
From 28 to 51 cards, take all 27 solid cards, then add the rest from the striped and the open ones, split in the right amounts, each part chosen to hold as many sets as it can. From 52 to 62 cards, the picks with the most sets look different: none holds a whole group of 27. For 52 to 59 cards, the models found picks that beat the records set in 2009.
Typeset, a game in WordGirl on this site, borrows these rules. Its daily boards hold 4 to 8 sets of a possible 14. With the full table it could deal a board that holds all 14, or ask you to lay out 13 cards that hold all 16 sets they can, and know when you’ve done it.
Each slot is one card of the deck, in a row of 27 for each shading. The cards laid down are drawn in.
Most possible:
Random deal:
The question
There’s a classic card game played with 81 cards. Each card has four features: a shape, a number (one, two or three), a color and a shading (solid, striped or open), each in three kinds. Three cards make a set when, feature by feature, they’re all the same or all different. Twelve cards go down on the table and everyone races to call a set.
A group of cards on the table is a layout, and some layouts hold many sets. Write f(n) for the most sets among any n cards, and call a layout that holds that many a best layout. For 12 cards the answer is 14, published in 2025. For 13 cards and up, nobody seems to know. That’s this run’s question: find f(n) for n = 13, 14, 15 and onwards, as far as a computer can get in one night, and prove it.
Here is the whole deck to try it on. Step through n to load n cards that hold the most sets, or tap cards to lay out your own; the count updates as you go.
There’s another way to see the deck. Give each feature’s three kinds the values 0, 1 and 2 (circle, triangle, square; one, two, three; red, green, violet; solid, striped, open), and a card becomes four digits: a point in a 4-dimensional grid with three positions along each side. Three cards form a set exactly when their digits add up to a multiple of 3 in every position. In that picture a set is a “line,” and the question becomes: which n points of the grid contain the most lines?
Any two cards lie on exactly one line. Feature by feature, two cards that match need a third that matches, and two that differ need the third kind. Pick any two:
First card
0 0 0 0
Second card
1 1 0 0
Completes the set
2 2 0 0
Fix two features, say solid and red, and the 9 cards that are both make a plane: a 3 × 3 grid of shape against number. It holds 12 sets, the most any 9 cards can: 3 rows, 3 columns and 6 diagonals, most of which wrap around the edges.
The deck also has symmetries: ways to relabel the cards, like swapping red and green or trading the roles of shape and color, that keep every set a set. Two layouts that a symmetry turns into each other hold the same number of sets, so we count them as the same.
Where it comes from
The card game itself is Marsha Falco’s. She designed it in 1974, while recording genetic data on epilepsy in German shepherds, and it has been sold since 1991. WordGirl, one of the ideas on this site, has a game called Typeset that borrows her rules, with typefaces for pictures: a card’s features are which glyph, how many copies, which ink and which fill. Typeset deals two 12-card boards each day, each holding between 4 and 8 sets. What this run’s answer could add to it is under Back to Typeset.
What’s known
- Up to 12 cards: Justin Stevens and Duncan Wilson,
The Maximum Number of Sets for 12 Cards is 14
(2025; also at the IEEE Conference on Games 2025 with Richard Kelley), find
f(n) for every n up to 12:
f(3..12) = 1, 1, 2, 3, 5, 8, 12, 12, 13, 14. They also compute the maxima for a three-feature deck (27 cards) for every n (OEIS A380167), and write: “It remains an open question to find, with proof, the maximum number of sets with 4 properties for n > 12. We conjecture that the values in Table 3 for 3 properties are the same maximum as for 4 properties.” Their argument for 10 to 12 cards assumes that a best layout contains a 9-card plane, which the paper asserts but doesn’t prove. - An older, wider conjecture: Nathan Kaplan asked the same question for any number of features in 2012 (problem 2012.1 in Miller’s problem sessions): n cards should never hold more sets than the best n cards of the smallest deck that fits them.
- The counting technique: cutting the deck into parallel thirds and counting pairs and triples inside the parts (more below) is how Benjamin Davis and Diane Maclagan proved that 20 cards is the most a layout can have with no set at all (The Card Game SET, 2003). The same counts are known in coding theory as the first MacWilliams identities, and in finite geometry as the “standard equations.”
- Set-free layouts (caps): the 20-card one is unique up to the deck’s symmetries (Hill, 1983), and Thackeray (2021) found 20 kinds of 18-card ones.
- Counting all layouts: OEIS A182240 gives how many genuinely different n-card layouts there are (up to the deck’s symmetries), from Coleman and Hartshorn’s 2012 count.
- Lower bounds for every n: Jim Vinci’s 2009 note (SETPROOF.pdf) tabulates layouts found by a greedy program for every n from 3 to 81. They are good layouts, not proofs.
- The easy ends: every pair of cards is in exactly one set, so among k cards each card is in at most (k − 1)/2 sets, rounded down. That caps 27 cards at 27 × 13 / 3 = 117 sets and 26 at 26 × 12 / 3 = 104. At the top, the cards not in a layout decide it. The deck holds 1080 sets, each card is in 40 of them and each pair of cards in one. So leaving out m = 81 − n cards leaves 1080 − 40m + C(m, 2) − (sets among the m missing cards), where C(m, 2) = m(m − 1)/2 counts their pairs: take away the 40 sets through each missing card, add back the one set each missing pair shares (taken away twice), and correct for sets made only of missing cards. That’s (m² − 81m + 2160)/2 − (sets among the missing cards). So for n ≥ 61 the best layouts are exactly the complements of set-free collections of 81 − n cards, which exist up to 20 cards (Pellegrino, 1970).
- Still open before this run: n = 13 to 25, and 28 to 60. We found no follow-up to the 2025 paper.
What we tried
Exact counts inside a third
code/third.c visits all 2²⁷ subsets of a
27-card third (all cards with, say, the fourth feature fixed) and records the
most sets for each size, g(n). It agrees with the 2025 paper’s table:
n 13 14 15 16 17 18 19 20
g(n) 16 19 23 26 30 36 41 47
n 21 22 23 24 25 26 27
g(n) 54 62 71 81 92 104 117
A counting argument, before any big search
We expected to need an exhaustive search over the deck’s 1,965,150,720 symmetries. Counting was enough up to 47 cards.
It rests on cuts. Sorting the deck by shading splits it into three parts of 27, the solid, striped and open cards, and sorting by color, number or shape does the same. So does a mix of features: give each feature a weight of 0, 1 or 2 (not all 0), add up each card’s weighted digits, and sort the cards by the remainder after dividing by 3. “Shape + color” is one such cut. Doubling every weight gives the same three parts back, so the 80 weightings make 40 cuts. The three parts of a cut are parallel thirds. Each is a copy of the 27 solid cards (a symmetry of the deck turns one into the other), and the part a card lands in works like a fifth feature: three cards in a set land all in one part or one in each. A cut splits an n-card layout into parts of a, b and c cards. Three facts hold for every layout:
- Each cut bounds the sets. A set sits inside one part or has one card in each. A part of k cards lies in a 27-card third, so it holds at most g(k) sets. A set that crosses has one card in each part, and any two of its cards pick out the one that completes it, so at most min(ab, bc, ca) sets cross. So a layout has at most g(a) + g(b) + g(c) + min(ab, bc, ca) sets, for every cut.
- Pairs. Any two cards share a part for exactly 13 of the 40 cuts. (They share a part when the weights, applied to the difference of their digits, give a multiple of 3. That’s true of 26 of the 80 weightings, a third of all 81 less the all-zero one, which make 13 cuts.) So the pairs inside parts, added over the 40 cuts, number 13 × C(n, 2), where C(n, 2) is the number of pairs among n cards.
- Triples. Three cards forming a set share a part whenever two of them do: 13 of the cuts. Three cards that don’t form a set need the weights to zero out two independent differences, which 8 of the 80 weightings do: 4 cuts. So the triples inside parts, added over the 40 cuts, number 13 × (sets) + 4 × (the other triples) = 4 × C(n, 3) + 9 × (sets), where C(n, 3) is the number of triples among n cards.
Step through the cuts and watch 13 cards split. Pairs and triples inside parts, added over all 40 cuts, come out exactly as facts 2 and 3 say, whichever 13 cards you take:
- This cut
- All 40 cuts
Here is the whole argument for 13 cards. Suppose they held 17 sets or more.
Fact 1 then allows only the splits 6+4+3, 5+5+3 and 5+4+4; every other split
caps the count at 16 or less. Those splits have at most 15 + 6 + 3 = 24 pairs
inside parts, so the 40 cuts have at most 960. But fact 2 says exactly
13 × 78 = 1014. That’s impossible, so 13 cards hold at most 16 sets, and
third.c found 13 cards with 16.
The same argument covers 13 to 27 cards. For each n, suppose the cards held one set more than the best third allows (the “sets” column). The table lists the splits fact 1 then permits, and why even those can’t add up. Too many sets force every cut to be nearly even, and nearly even cuts put too few pairs or triples inside their parts:
All 15 cases, 13 to 27 cards
| n | sets | splits fact 1 allows | why not |
|---|---|---|---|
| 13 | 17 | 5+4+4, 5+5+3, 6+4+3 | pairs: at most 40 × 24 = 960, need 1014 |
| 14 | 20 | 5+5+4, 6+4+4, 6+5+3 | pairs: at most 40 × 28 = 1120, need 1183 |
| 15 | 24 | 5+5+5, 6+5+4, 6+6+3 | pairs: at most 40 × 33 = 1320, need 1365 |
| 16 | 27 | 6+5+5, 6+6+4, 7+5+4, 7+6+3 | triples: at most 40 × 56 = 2240, need 2483 |
| 17 | 31 | 6+6+5, 7+5+5, 7+6+4, 7+7+3, 8+5+4 | triples: at most 40 × 71 = 2840, need 2999 |
| 18 | 37 | 6+6+6, 7+6+5, 7+7+4, 8+5+5 | pairs: at most 40 × 48 = 1920, need 1989 |
| 19 | 42 | 7+6+6, 7+7+5, 8+6+5, 8+7+4 | pairs: at most 40 × 55 = 2200, need 2223 |
| 20 | 48 | 7+7+6, 8+6+6, 8+7+5, 8+8+4 | triples: at most 40 × 116 = 4640, need 4992 |
| 21 | 55 | 7+7+7, 8+7+6, 8+8+5 | pairs: at most 40 × 66 = 2640, need 2730 |
| 22 | 63 | 8+7+7, 8+8+6 | pairs: at most 40 × 71 = 2840, need 3003 |
| 23 | 72 | 8+8+7 | pairs: at most 40 × 77 = 3080, need 3289 |
| 24 | 82 | 8+8+8 | pairs: at most 40 × 84 = 3360, need 3588 |
| 25 | 93 | none | no split is left |
| 26 | 105 | none | no split is left |
| 27 | 118 | none | no split is left |
More sets only shrink the list and raise the need, so one row rules out every larger count too. Past 27 cards the same counting keeps working, up to 47 cards. Fact 1 alone settles 28, pairs settle 29 to 32 and triples 33. From 34 on it takes pairs and triples together, which is the next step.
As far as we could find, what’s new is fact 3’s extra 9 × (sets) term, the bound in fact 1, and combining them over all 40 cuts. The pair and triple counts themselves are classical.
One inequality per case
Each case comes down to one line. Draw every
split that fact 1 allows as a point: the pairs inside its parts (P) along the
horizontal axis, the triples inside its parts (T) up the vertical. Find a line
T = u + v × P that lies above all the points. Every cut’s split is one of those
points, so over the 40 cuts the triples inside parts add up to at most 40u
plus v times the pairs inside parts, which fact 2 fixes at 13 × C(n, 2). When
that total is fewer than fact 3 needs, the case is impossible. (This is
linear-programming duality, and the line is a Farkas certificate.) For 34
cards and 132 sets the line T = −1368.4 + 10.9 × P works: the cuts hold at most
40 × (−1368.4) + 10.9 × 13 × 561 = 24,757.7 triples, but fact 3 needs
4 × 5984 + 9 × 132 = 25,124.
code/certify.py finds the line for every case up to 47 cards, in exact
fractions. code/check.py is 45 lines that import nothing else from the run.
It re-derives the allowed splits and checks every line, for every set count
above the claimed maximum.
Counting every layout, as a check that doesn’t use the argument
code/orbits.c lists one layout from each class of n-card layouts (layouts that
a symmetry of the deck maps onto each other are one class). It uses McKay’s
canonical augmentation (a way to grow layouts one card at a time that builds
each class exactly once), with the program nauty deciding when two layouts are
equivalent. Its class counts match OEIS A182240 exactly for every n up to 14:
41,407 classes of 12 cards, 205,211 of 13 and 963,708 of 14. It finds the same
maxima with no counting argument: 16 sets for 13 cards and 19 for 14.
Which layouts are best
Running the argument at the maximum itself, with
some splits forbidden, shows what the best layouts must look like (see
Results). code/classify.py forbids the splits that make a layout that shape:
up to 27 cards, (n, 0, 0), which puts every card in one third; from 28 cards,
any split with a 27-card part, which means a whole third is in the layout. For 41 to 44 cards counting alone can’t tell; exact maxima for
single cuts (below) settle those, counting only layouts with no whole third.
code/classes3.c and code/classes4.py then count the best layouts: 3 for 13
cards, which the full enumeration confirms independently, and 5 for 17.
Lower bounds for 48 to 59 cards
We ran a plain simulated annealing over the
whole deck (code/anneal.c, three 200-second runs per n). It beat Vinci’s 2009
layouts from 52 to 59 cards, and matched them at 48 to 51 and 60. Every layout is recounted from scratch
(code/out/anneal.txt).
Why the counting stops at 48
At 48 cards the three facts leave room for one set more than any layout we know. Here is an assignment, the phantom, that passes all three with 253 sets: 30 of the 40 cuts split the cards 16 + 16 + 16, five split 24 + 13 + 11, four 18 + 15 + 15 and one 18 + 17 + 13. It meets the pair and triple counts exactly, and fact 1 allows 253 sets for every one of those splits. The weak point is fact 1. It lets an even 16 + 16 + 16 cut hold up to 334 sets, far more than any real layout manages. A sharper bound for even cuts would be nearly as hard as the question itself, because the best real 48-card layouts are also cut nearly evenly by most cuts: ours splits 16 + 16 + 16 or 17 + 16 + 15 for 32 of its 40.
Two dead ends at 48 to 60
Coding theory offers more equations of the same kind. Read the layout as a code, one codeword per card: how many of its cards each third holds is the code’s weight distribution, and its sets are the shortest relations among the codewords (the dual code’s words of weight 3). The MacWilliams identities turn the weight distribution into counts of every size of relation, and each count must be zero or more. We added all of them. They didn’t move a single bound. Nor did a sharper lower bound on the dual words of weight 4, which count pairs of card-pairs pointing at the same completing card. What decides it is fact 1’s bound (the most sets one cut allows), not the counting.
Exact maxima for single cuts, at 48 to 52
The attack agent, one of the
models on this run, replaced fact 1’s bound, g(a) + g(b) + g(c) + min(ab, bc, ca),
for the phantom’s most lopsided cuts with the exact most sets any layout can
have with that split
(code/attack/split3c.cpp). Within one cut you may apply the same linear map
to all three parts, plus a shift for each part, as long as the three shifts add
up to zero, and every set survives. So it’s enough to list the second part up to symmetry, the
third up to shifts, and choose the first part, which is nearly full, in the best
way. A split whose exact maximum falls short is ruled out, and the counting
runs again (code/attack/close.py).
- At 48 cards, 24 + 12 + 12 and 24 + 13 + 11 can’t get past 247, and that alone makes the counting impossible. The agent also ruled out 23 + 16 + 9 by a short argument. So 48 cards hold at most 252.
- At 49 cards four more splits are ruled out, and four at 50, giving 264 and 276.
- At 52, restarted by us, a fourth split (24 + 15 + 13, at most 305) finishes it: 52 cards hold at most 305, which the annealed layout reaches.
- At 51 the search got stuck on 23 + 14 + 14, where almost any 14-card part
qualifies. We sharpened the check (
code/attack/split3d.cpp) with a pigeonhole step. Take a card x of the first third. Each card of the second part makes a set with x and exactly one card of the last third, so the second part’s 14 cards point at 14 cards there. Those 14 and the third part’s own 14 can’t all be different among 27 cards, so at least one set through x crosses the cut. When x is one of the 4 cards missing from the first part, that set is lost: at most 14 × 14 − 4 sets cross. That raises how many sets the other two parts must hold on their own, and pairs of parts that can’t reach the target are skipped before the slow step. It finished in minutes: 23 + 14 + 14 never reaches 290. One more split (25 + 15 + 11) ends it: 51 cards hold at most 289, which the annealed layout reaches. - The same check settles the best layouts’ shape at 41 to 44 cards, where
the counting alone couldn’t. Counting only layouts with no whole third
(
code/attack/split3e.cpp), the lopsided splits 23 + 9 + 9 to 26 + 9 + 9 never reach the maximum, and without them the counting can’t be met. So every best layout of 41 to 44 cards contains a whole third too.
The other end: the cards left out
By the formula under “The easy ends,” the
best 60-card layout leaves out the 21 cards with the fewest sets (the formula
gives 450 for m = 21 and 431 for m = 22). orbits.c, told to keep only
layouts with at most 2 sets, runs out at 20 cards: no 21 cards hold fewer than 3
sets. Along the way it lists the set-free layouts, matching what’s known (one of
20 cards, 20 kinds of 18). And 21 cards with exactly 3 sets exist, so 60 cards
hold at most 450 − 3 = 447 sets. That’s the 447-set layout in Vinci’s table, now
shown to be the best.
The same run, allowed up to 5 sets and sped up by rejecting most candidates with a quick test that tells most layouts apart before nauty runs, goes further. The fewest sets among 22 cards is 4, among 23 it’s 5, and no 24 cards hold fewer than 6. Our annealed layouts of 59, 58 and 57 cards leave out exactly such cards. So 59 cards hold at most 431 − 4 = 427 sets, 58 at most 408 and 57 at most 390, and the annealed layouts reach all three. A run allowing 6 sets, for 56 cards, grew to millions of classes per size. We stopped it once the cap argument below covered 56.
From the cap up, at 53 to 56
Take out one card from each set and what’s left has no set. So if m cards held at most m − 19 sets, that would leave at least 19 cards with no set: they’d contain a 19-card cap, and there’s only one class of those. The attack agent added up to 8 cards to it in every way. The fewest sets come out 0, 3, 6, 8, 10, 13, 16 and 19 for 1 to 8 added cards. So for m from 21 to 27, m cards either hold more than m − 19 sets or contain the 19-card cap and hold at least the number in that list, which is never below m − 18. Either way they hold at least m − 18, and the annealed layouts’ left-out cards have exactly that many. That settles 54, 55 and 56 cards (342, 357, 373) and agrees with our own enumeration at 57 to 60. For 53 cards, 28 left-out cards with at most 14 sets would contain a largest cap of 14 to 20 cards, with every other card on a set through two of its cards. A search over every such cap finds none, so 53 cards hold at most 323.
Back to more features, with the whole table
Earlier we had carried the
argument to decks with five or more features for up to 27 cards, then 47.
Each step uses the four-feature maxima as the bound for each part. With every
value from 1 to 81 known, the same induction (code/alld.py) goes through
for every n up to 81. One certificate line per n works for every deck size at
once. With d features, write t = 1/(3^d − 1). The deck size only enters
through the share of cuts that keep two cards together, (1 − 2t)/3, and the
share that keep three cards not in a set together, (1 − 8t)/9. Both are
linear in t, so a line that works at five features (t = 1/242) and in the
limit (t = 0) works for every size in between.
Results
Confirmed. The proofs above settle every n from 1 to 81. Nine fresh checks, each a separate model run that wrote its own code, went over them part by part and found no gap, and the core outputs reproduce from a clean checkout. The checks covered:
- 13 to 25 cards, with their own search of every 13- to 16-card layout.
- 28 to 47 cards, and the first result for decks with more features.
- The best layouts’ shape, the class counts and 60 cards.
- 54 to 59 cards.
- Kaplan’s conjecture for up to 47 cards.
- 48, 49, 50 and 53 cards.
- 51 and 52 cards.
- Kaplan’s conjecture for 48 to 81 cards, given the four-feature table.
- The best layouts’ shape at 41 to 44 cards.
The checks’ own code isn’t part of the files below.
Here is the answer for every n:
- Proved on this run: 13 to 25 and 28 to 60 cards
- Known before: up to 12 cards (Stevens and Wilson, 2025), 26 and 27 (counting pairs), 61 and up (from Pellegrino, 1970)
| 1 cards:0 sets | 2 cards:0 sets | 3 cards:1 sets | 4 cards:1 sets | 5 cards:2 sets | 6 cards:3 sets | 7 cards:5 sets | 8 cards:8 sets | 9 cards:12 sets |
| 10 cards:12 sets | 11 cards:13 sets | 12 cards:14 sets | 13 cards:16 sets, proved on this run | 14 cards:19 sets, proved on this run | 15 cards:23 sets, proved on this run | 16 cards:26 sets, proved on this run | 17 cards:30 sets, proved on this run | 18 cards:36 sets, proved on this run |
| 19 cards:41 sets, proved on this run | 20 cards:47 sets, proved on this run | 21 cards:54 sets, proved on this run | 22 cards:62 sets, proved on this run | 23 cards:71 sets, proved on this run | 24 cards:81 sets, proved on this run | 25 cards:92 sets, proved on this run | 26 cards:104 sets | 27 cards:117 sets |
| 28 cards:117 sets, proved on this run | 29 cards:118 sets, proved on this run | 30 cards:119 sets, proved on this run | 31 cards:121 sets, proved on this run | 32 cards:124 sets, proved on this run | 33 cards:128 sets, proved on this run | 34 cards:131 sets, proved on this run | 35 cards:135 sets, proved on this run | 36 cards:140 sets, proved on this run |
| 37 cards:146 sets, proved on this run | 38 cards:152 sets, proved on this run | 39 cards:159 sets, proved on this run | 40 cards:167 sets, proved on this run | 41 cards:176 sets, proved on this run | 42 cards:186 sets, proved on this run | 43 cards:197 sets, proved on this run | 44 cards:209 sets, proved on this run | 45 cards:222 sets, proved on this run |
| 46 cards:231 sets, proved on this run | 47 cards:241 sets, proved on this run | 48 cards:252 sets, proved on this run | 49 cards:264 sets, proved on this run | 50 cards:276 sets, proved on this run | 51 cards:289 sets, proved on this run | 52 cards:305 sets, proved on this run | 53 cards:323 sets, proved on this run | 54 cards:342 sets, proved on this run |
| 55 cards:357 sets, proved on this run | 56 cards:373 sets, proved on this run | 57 cards:390 sets, proved on this run | 58 cards:408 sets, proved on this run | 59 cards:427 sets, proved on this run | 60 cards:447 sets, proved on this run | 61 cards:470 sets | 62 cards:491 sets | 63 cards:513 sets |
| 64 cards:536 sets | 65 cards:560 sets | 66 cards:585 sets | 67 cards:611 sets | 68 cards:638 sets | 69 cards:666 sets | 70 cards:695 sets | 71 cards:725 sets | 72 cards:756 sets |
| 73 cards:788 sets | 74 cards:821 sets | 75 cards:855 sets | 76 cards:890 sets | 77 cards:926 sets | 78 cards:963 sets | 79 cards:1001 sets | 80 cards:1040 sets | 81 cards:1080 sets |
-
13 to 25 cards: f(n) = g(n). Any n cards hold no more sets than the best n cards inside a 27-card third (g(n), from
third.c): 16, 19, 23, 26, 30, 36, 41, 47, 54, 62, 71, 81 and 92 sets. That’s Stevens and Wilson’s conjecture. The same argument proves their values for 10 to 12 cards without the step their paper leaves unproved. The first check also counted every 13- to 16-card layout its own way and found the same maxima. -
28 to 47 cards. Past 27 cards the best layout is a whole third (117 sets) plus a cards in one parallel third and b in the other. Every pair across those two completes a set through the full third, so it holds 117 + g(a) + g(b) + ab sets, and the counting bound meets it exactly (the table above). These are the layouts in Vinci’s 2009 table, which until now were only lower bounds.
-
Any number of features, up to 81 cards. In a deck with five features (243 cards), six, or more, n ≤ 81 cards never hold more sets than the best n cards of the 81-card deck. That’s Kaplan’s 2012 conjecture for every n up to 81, the whole range where it compares against the 81-card deck or a smaller one. It needs the four-feature value for every n, so it came last. The argument is an induction on the features. The deck size only enters through two ratios that are linear in 1/(3^d − 1), where d is the number of features. So one certificate line per n, checked at five features and in the limit, covers every size in between (
code/alld.py). -
The best layouts’ shape. Every best layout of up to 27 cards lies in one third. For 28 to 47 cards every best layout contains a whole third, plus best layouts in the two parallel thirds. The ninth check confirmed that by trying every part with no shortcuts.
-
How many best layouts there are, counting two as the same when a symmetry of the deck turns one into the other: just one for every n up to 12, and up to 13 classes beyond.
The count for each n, 3 to 47
n 3–12 13 14 15 16 17 18 layouts 1 3 2 2 2 5 1 n 19 20 21 22 23 24–27 layouts 3 2 3 2 2 1 n 28 29 30 31 32 33 34 layouts 1 1 1 3 2 2 3 n 35 36 37 38 39 40 41 layouts 10 6 6 6 13 9 11 n 42 43 44 45 46 47 layouts 6 5 2 2 2 5 -
48, 49, 50 and 53 cards: 252, 264, 276 and 323 sets. The sixth check wrote its own per-split checker and found the same best values for every split ruled out, and its own counting program confirms that the counting then fails. It also counted every cap from a fixed starting set of cards (which symmetry allows), matching the cap classification used by the 53-card search at every size, so no class of caps is missing from that search.
-
51 and 52 cards: 289 and 305 sets. The seventh check built its own orbit lists and per-split checker, reproduced every logged count and maximum, ran positive controls on the real layouts, and confirmed with its own counting program that 290 and 306 are impossible.
-
54 to 59 cards: 342, 357, 373, 390, 408 and 427 sets. The fewest sets among 27, 26, 25, 24, 23 and 22 cards are 9, 8, 7, 6, 5 and 4, and the annealed layouts leave out exactly such cards. The fourth check re-derived the unique 20-card cap and searched every way to add up to 8 cards to the 19-card one, getting the same table of minima.
-
60 cards: f(60) = 447. The third check got there another way, by listing every set-free layout of 19 and 20 cards from a fixed starting set of cards, without the full enumeration.
Here is where 48 to 59 stand. The rows are Vinci’s 2009 layouts, the best layout we know, the most the counting alone allows, and, in the last row, the most sets now proved possible by everything above:
n 48 49 50 51 52 53
Vinci 2009 252 264 276 289 303 318
best known 252 264 276 289 305 323
counting 253 267 281 295 309 326
at most now 252 264 276 289 305 323
n 54 55 56 57 58 59
Vinci 2009 334 351 369 388 406 425
best known 342 357 373 390 408 427
counting 344 360 376 396 412 432
at most now 342 357 373 390 408 427
From 61 cards on, the best layouts are the complements of set-free ones, which was already known. So the four-feature maxima are now settled for every n from 1 to 81.
The deck demo under “The question” loads these layouts. Up to 27 cards they sit in one shading’s band (solid there), a 27-card third.
Every result above can be checked on your own machine: the run’s code, its
certificates and the outputs each step should give are at the end of this
page, under Check it yourself. The code’s README has the
rest: the self-test, the class counts, the work on 48 to 60 points in
attack/, and the full enumeration, which needs nauty built in a temp folder.
Back to Typeset
Typeset deals its boards by shuffling until a 12-card hand holds 4 to 8 sets. A random 12 cards hold under three on average (220 triples, each a set with odds of 1 in 79), so about one hand in four qualifies. The most any 12 cards can hold is 14:
- A random 12 cards: 2.8 sets on average
- Typeset’s daily boards: 4 to 8 sets
- The most any 12 cards can hold: 14
These are proposals for WordGirl, not changes we made tonight:
- A ceiling on the board. Typeset already says how many sets a board holds. It could add the most possible: “6 of the 14 any 12 cards can hold”, so a player knows how rich today’s board is.
- A full board. There’s only one 14-set layout of 12 cards, up to the deck’s symmetries. Run it through a random symmetry (which glyph, ink and fill play which part) and it looks new every time, so Typeset could deal an occasional board that holds every set 12 cards can.
- A build puzzle. Turn the game around: pick n cards from the deck to hold as many sets as you can. Until this run, a game could only tell you that you’d found the most for up to 12 cards. Now it can for every n: 13 cards and 16 sets, 15 and 23, all the way up. The deck demo above is a rough version of that puzzle.
- Bigger boards. The table gives the most for any board size: a 15-card board can hold 23 sets, and 18 cards can hold 36.
Where things stand
Settled and confirmed. The most sets n cards can hold is proved for every n from 1 to 81. That covers Stevens and Wilson’s 2025 conjecture (13 to 27 cards) and every value past it. With the full table, Kaplan’s 2012 conjecture holds for every n up to 81, in decks with any number of features. We also know what the best layouts look like up to 47 cards, and how many there are. Nine fresh checks, each with its own code, found no gap, and the core outputs reproduce from a clean checkout. Nothing is left running.
What’s next
- How many best layouts there are from 48 cards up, and what they all look like. The ones we found for 48 to 51 cards contain a whole third. From 52 to 62 cards no best layout can (from 63 on, some do again), and from 52 to 59 ours beat the layouts that had held the record since 2009.
- Past 81 cards, Kaplan’s conjecture compares against the 243-card deck with five features, whose maxima would come first. The same counting, with these four-feature values as the per-cut bound, is the obvious first try.
- A formal proof (in Lean, say) of the three counting facts and the finite checks. We didn’t get to it tonight.
Check it yourself
Everything this run used to reach its results, with the output each step should give: 76 files, exactly as the run left them.
Download the code .zip · 73 KBBrowse the files
It needs a C compiler and Python 3 with numpy, nothing else. Unzip it and run these from its folder. Each prints nothing when its output matches the one shipped with it:
- g(n), witnesses
cc -O2 -o third third.c && ./third | cmp - out/third.txt - 4 features: layout vs bound
python3 bound.py | cmp - out/bound.txt - 5 features and up
python3 bound.py dims | cmp - out/bound-dims.txt - the Farkas certificates and their checker
python3 certify.py | cmp - out/certificates.json && python3 check.py - the best layouts’ shape
python3 classify.py | cmp - out/classify.txt - Kaplan’s conjecture
python3 alld.py | cmp - out/alld.txt - explicit layouts
python3 witness.py | cmp - out/witnesses.txt
Start with README.md inside: it says how to build and run each piece.