All Chapters

The Missing Chapter

The Mathematics of Inevitable Patterns

Why complete disorder is impossible — and the numbers that prove it

An extension of Jordan Ellenberg's "How Not to Be Wrong"

Chapter 84

The Party Problem

You're hosting a dinner party for six people. Some of them are friends with each other. Some are strangers. You might think you could arrange things so that no three people at the table are all mutual friends, and no three are all mutual strangers — a perfectly balanced social soup with no cliques of any kind. You can't. Mathematics forbids it.

This is one of those facts that sounds like it should depend on which six people you invite. Surely if you carefully curate the guest list, mixing social circles just right, you could avoid forming any trio of mutual friends or any trio of mutual strangers? But the answer is no, and the reason is no has nothing to do with social dynamics. It's pure combinatorics, as cold and certain as arithmetic.

Let me prove it to you. Pick any one of your six guests — call her Alice. Alice has five relationships with the other five people, and each relationship is one of two types: friend or stranger. Five pigeons, two holes. By the pigeonhole principle, at least three of those relationships must be the same type.1

Say Alice is friends with Bob, Carol, and Dave. (The stranger case is symmetric — just swap the words.) Now look at the relationships among Bob, Carol, and Dave. If any two of them — say Bob and Carol — are also friends, then Alice-Bob-Carol is a trio of mutual friends. We're done. But if none of them are friends with each other, then Bob, Carol, and Dave are all mutual strangers. We're done again.

There's no escape. Every possible arrangement of friendships among six people contains either three mutual friends or three mutual strangers. The proof is about six lines long and uses nothing fancier than counting to five.2

Complete disorder is impossible. Any sufficiently large structure must contain patterns.
A B F C D E
Six people, every pair connected. No matter how you color the edges red or blue, a monochromatic triangle is inevitable. Here: A-B-F forms a red triangle.

Try It Yourself

Don't take my word for it. Here are six people at a party. Click any edge to toggle it between red (friends) and blue (strangers). Your mission: color all 15 edges without creating any monochromatic triangle. Spoiler: you will fail.

The Party Problem

Color every edge red or blue. Try to avoid a monochromatic triangle.

Edges colored: 0 / 15
Click an edge to toggle its color.

Did you find a way? No. You didn't, because there isn't one. Every time you fix one monochromatic triangle, you create another. It's like trying to push down all the bumps in a carpet simultaneously — the structure of the problem guarantees at least one bump survives.

• • •
Chapter 84

Ramsey's Theorem

The party problem is the simplest case of a theorem proved in 1930 by Frank Ramsey, a British mathematician and philosopher who died at the absurd age of 26, leaving behind enough ideas to fill several careers.3 Ramsey's theorem says something that sounds almost mystical: complete disorder is impossible.

More precisely: for any positive integers r and s, there exists a number R(r,s) — the Ramsey number — such that if you take R(r,s) people and color every pair of them red or blue, you're guaranteed to find either r people who are all mutually red, or s people who are all mutually blue.4

In graph theory language: color the edges of the complete graph Kn with two colors, and if n is big enough, you must find a monochromatic clique of the size you want. Pattern is unavoidable. Disorder has a ceiling.

We showed R(3,3) = 6. The proof generalizes beautifully. To show R(r,s) exists, you prove the recursive bound:

Ramsey Bound
R(r,s) R(r−1,s) + R(r,s−1)

This looks like Pascal's triangle — and that's no coincidence.

The base cases are R(r,2) = r and R(2,s) = s (trivially). Since Pascal's triangle entries are finite, so is every Ramsey number. They exist. They're just very, very hard to compute.

And here's where things get delightfully insane. We know R(3,3) = 6. We know R(4,4) = 18. But R(5,5)? The best we can say, as of 2024, is that it's somewhere between 43 and 48.5 We've been working on this since the 1930s. Some of the most powerful minds in combinatorics, armed with supercomputers, have spent decades trying to narrow this gap. The number is probably around 43–45. But proving it? That's a different beast entirely.

Paul Erdős, the legendary itinerant mathematician who co-authored more papers than anyone in history, put it this way:

Imagine an alien force, vastly more powerful than us, landing on Earth and demanding the value of R(5,5) or they will destroy our planet. In that case, we should marshal all our computers and all our mathematicians and attempt to find the value. But suppose, instead, that they ask for R(6,6). In that case, we should attempt to destroy the aliens.6

This wasn't Erdős being playful (well, it was — he was always playful). He was making a serious mathematical point. The computational complexity of Ramsey numbers grows so explosively that each step up feels less like climbing a staircase and more like jumping to a different universe.

Known Ramsey Numbers: The Cliff 6 R(3,3) 18 R(4,4) 43–48 R(5,5) unknown! 102–165 R(6,6) destroy aliens
Each step up in Ramsey numbers represents an explosion in difficulty. R(3,3) is a homework problem. R(5,5) is a research frontier. R(6,6) is science fiction.

Explore the Numbers

The interactive below lets you see Ramsey theory in action. Pick a graph size, color edges randomly or manually, and watch the algorithm hunt for monochromatic cliques. The table shows what we know about small Ramsey numbers — and how quickly our knowledge runs out.

Ramsey Number Explorer

Choose a challenge: can you 2-color the edges of Kn and avoid monochromatic cliques?

Click edges to color them. Can you avoid monochromatic cliques?
Known Ramsey Numbers R(r,s)
s=2s=3s=4s=5s=6s=7s=8s=9
r=223456789
r=33691418232836
r=449182536–4149–6156–8473–115
r=55142543–4858–8780–143101–216126–316
• • •
Chapter 84

Why Disorder Has Limits

The philosophical punch of Ramsey theory goes far beyond party tricks. It tells us something profound about the nature of mathematical structure: you cannot have a large system without regularity. Try as you might to make something completely random, completely patternless, completely chaotic — if the system is big enough, patterns will emerge whether you want them to or not.

This is not a statement about probability. We're not saying patterns are likely. We're saying they are certain. Guaranteed by the pitiless logic of combinatorics. A monkey banging on a typewriter might eventually produce Shakespeare by chance, but Ramsey theory says something stronger: certain structural patterns aren't left to chance at all. They're forced into existence by sheer size.

The Ramsey Guarantee

Ramsey theory doesn't say "patterns probably appear in large structures." It says patterns must appear. This isn't statistics — it's logic. No probability distribution, no expected values, no confidence intervals. Just cold, deductive certainty.

Think about what this means for the real world. Social networks are vast — billions of nodes, trillions of edges. Ramsey theory guarantees that within any sufficiently large social network, you will find cliques: groups of people who all know each other, or groups who are all mutual strangers. You can't design a social graph that avoids this. Facebook, with its billions of users, isn't just likely to contain tightly connected clusters — it must.

Graham's Number: When Big Isn't Big Enough

If Ramsey numbers grow fast, some of their cousins make Ramsey numbers look tame. In 1971, Ronald Graham and Bruce Rothschild were working on a problem in Ramsey theory involving hypercubes.7 They needed to find a number N such that if you color the edges of an N-dimensional hypercube with two colors, you're guaranteed to find a certain monochromatic structure.

The number they came up with — Graham's number — is so large that the observable universe doesn't contain enough matter to write it down in ordinary notation. It's so large that even writing the number of digits would require more space than the universe provides. It's so large that the number of times you'd need to say "it's so large that" to adequately convey its magnitude is itself incomprehensibly large.

Graham's number was, for a time, the largest number ever used in a mathematical proof.8 And it comes from Ramsey theory — from the simple idea that if you color things, patterns must emerge.

There's something wonderfully absurd about this. You start with a dinner party and the observation that six people must contain a friend-triangle or a stranger-triangle. You generalize. You push the logic further. And before you know it, you've arrived at numbers so large they mock the physical universe. The leap from "six friends at dinner" to "a number that dwarfs the cosmos" is one of the great vertical ascents in all of mathematics.

The Ramsey Principle Small: can dodge grow Large: pattern forced! inevitability
Small structures can dodge monochromatic patterns. Large ones can't. Size forces order.
• • •
Chapter 84

The Lesson

Ramsey theory is, at its heart, a theory of inevitability. And inevitability is something humans are notoriously bad at reasoning about. We see patterns everywhere, even in noise — that's apophenia. But Ramsey theory says sometimes the patterns we see aren't illusions. Sometimes they're structurally guaranteed.

When someone tells you they found a "pattern" in stock prices, or in the digits of π, or in the arrangement of galaxies, the first question to ask is: would this pattern appear in any dataset of this size? If the answer is yes, the pattern is not a discovery. It's a mathematical certainty wearing a disguise.

This is Ellenberg's big theme in How Not to Be Wrong: mathematics isn't just about computing answers. It's about understanding which questions are meaningful and which are vacuous. Finding three mutual friends at a party of six hundred isn't evidence of anything about those particular people. It's a property of the number six hundred.

And here's the twist that makes Ramsey theory so beautiful: the very thing that makes patterns inevitable also makes them hard to find efficiently. We know that R(5,5) exists. We know it's between 43 and 48. But actually finding the right coloring that certifies the lower bound, or proving that every coloring of K43 contains the required monochromatic clique — these are tasks of staggering computational complexity.

The universe guarantees the existence of patterns while making their exact identification fiendishly difficult. Order exists, but it hides. Regularity is assured, but specifics are elusive. If that's not a metaphor for the human condition, I don't know what is.

The Ellenberg Test

Before you're impressed by a pattern someone found in data, ask: "In a random dataset this size, would a pattern like this be guaranteed by Ramsey-type arguments?" If yes, the pattern tells you nothing about the world — only about the size of your dataset. Not all patterns are created equal. Some are discoveries. Some are tautologies.

Frank Ramsey died in 1930, at twenty-six, of complications from a liver infection. He left behind a theorem that, nearly a century later, continues to generate open problems, inspire new mathematics, and produce numbers that dwarf the universe. Not bad for a theorem you can prove at a dinner party.

Notes & References

  1. The pigeonhole principle: if you put n+1 pigeons into n holes, at least one hole contains at least two pigeons. Attributed to Dirichlet (1834), though the idea is ancient.
  2. This proof appears in virtually every combinatorics textbook. A clean version is in Graham, Rothschild, and Spencer, Ramsey Theory, 2nd ed. (Wiley, 1990), Chapter 1.
  3. Frank Plumpton Ramsey (1903–1930) made foundational contributions to mathematical logic, probability theory, economics (the Ramsey model of economic growth, the Ramsey pricing rule), and philosophy. His paper "On a Problem of Formal Logic" (1930) introduced what we now call Ramsey theory.
  4. Ramsey, F. P. "On a Problem of Formal Logic." Proceedings of the London Mathematical Society, 30(1), 264–286, 1930.
  5. The lower bound R(5,5) ≥ 43 was established by Exoo (1989). The upper bound R(5,5) ≤ 48 was proved by Angeltveit and McKay (2017). In 2024, Vigleik Angeltveit announced a tighter upper bound of 46, but this remains under verification.
  6. Attributed to Paul Erdős in various forms. A common citation is Spencer, J., "Ten Lectures on the Probabilistic Method," SIAM (1987). The exact wording varies across sources.
  7. Graham, R. L. and Rothschild, B. L., "Ramsey's theorem for n-parameter sets," Transactions of the American Mathematical Society, 159, 257–292, 1971.
  8. Graham's number held the record in the Guinness Book of World Records as the largest number ever used in a mathematical proof. It has since been surpassed by even larger numbers, such as TREE(3), though Graham's number remains far more famous.