Five fields born in fifty years — testing claims, weighing chance, out-thinking opponents, counting bits, and hiding secrets. You used at least three of them before breakfast.
Cambridge, 1920s. A woman at a garden party claims she can taste whether the milk or the tea went into the cup first. Everyone laughs. One man at the table doesn't — Ronald Fisher gets up and starts pouring cups. What he does next becomes the operating system of every clinical trial, A/B test, and ML eval since.
Here's the move, and it's a sneaky one. Fisher does not try to prove she's right. He assumes she's wrong — that she's flat-out guessing, can't taste a thing. Then he asks: if she's really just guessing, how surprising would her actual run of correct calls be? Make her guess on eight cups, four-of-each. If she nails all eight by pure luck, that's a 1-in-70 fluke. Surprising enough that "she's guessing" starts to look like a bad explanation for what just happened.
That assume-the-boring-thing hypothesis has a name: the null hypothesis — the devil's-advocate position you set up specifically to knock down. And the number Fisher computes — the probability of seeing data at least this extreme if the boring explanation were true — is the p-value. Low p-value means "luck alone rarely does this," which is your cue to stop believing in luck alone.
The catch, and it's the single most misread number in all of science: the p-value is not the probability she's right. It's not the probability the null is true. It conditions the other way — it assumes the null and measures the data. P(data | null), never P(null | data). If you've ever confused a function's input with its output, you already know exactly how this bug feels. Run the experiment below and watch how often pure guessing manages to look like talent.
Probability had been doing useful work for 250 years — Pascal, Bernoulli, the whole gambling-and-insurance crowd from Chapter 3 — without anyone agreeing on what a probability actually is. And the paradoxes piled up. Pick a "random" chord on a circle and the odds change depending on how you set up the pick (Bertrand's paradox). Try to assign a fair probability to every possible subset of the real line and you can break it into pieces and reassemble two solid balls (the Banach–Tarski horror, Chapter 5's parting gift). The foundations were rotten.
In 1933, Andrey Kolmogorov fixed it with a move that should feel familiar by now: he stopped asking what probability means and just wrote down the rules it has to obey. Probability is a measure — a way of assigning a non-negative weight to sets of outcomes, where the whole space weighs exactly 1, and the weight of a bunch of non-overlapping events is just the sum of their weights. Three axioms. Everything else is theorems.
That's it. The paradoxes don't get solved so much as triaged — they were asking for weights on sets that simply aren't measurable, and the axioms quietly refuse to hand them one. This is the floor the rest of the chapter stands on: when an ML loss function takes an expectation, when a Monte Carlo run averages a million samples, when a diffusion model integrates over noise — they're all doing arithmetic on Kolmogorov's measure. The same measure theory that tamed the integral in Chapter 4 turns out to be the native language of chance.
Probability handles a world that's indifferent to you — dice don't care what you bet. But what about a world that's actively trying to beat you? When my best move depends on your move, which depends on mine, the whole thing threatens to spin in circles. In 1944 John von Neumann and Oskar Morgenstern wrote the book — literally, Theory of Games and Economic Behavior — that turned "strategy" into mathematics.
The key idea arrived in 1950 from a 22-year-old named John Nash. Stop chasing the move that wins; look instead for the stable point — a combination of strategies where nobody can improve their own payoff by changing strategy alone, given what everyone else is doing. Nobody has a unilateral reason to move. That's a Nash equilibrium, and Nash proved at least one always exists (once you allow mixed, randomized strategies). It's a fixed point, the same flavor of "apply the function, land back where you started" that runs through this whole book.
The famous, infuriating example is the prisoner's dilemma. Two players each choose: cooperate or defect. Mutual cooperation pays both well; mutual defection pays both badly; but whatever the other does, you personally score more by defecting. So both defect — and that's the equilibrium. It's stable, and it's collectively terrible. Stability is not optimality. The twist that saves civilization: play the game repeatedly and reputation enters. Robert Axelrod ran a famous tournament in 1980 to find out which strategy wins the long game. Run it yourself.
1948. One man, one paper — Claude Shannon's A Mathematical Theory of Communication — and the word "information" stops being vague and starts having units. Shannon's insight is almost a koan: information is surprise. A message that tells you something you already knew carries nothing. A message that resolves real uncertainty carries a lot. And surprise is measurable.
Measure it like this. A fair coin flip has two equally likely outcomes; learning the result kills exactly one yes/no question's worth of doubt. Call that one bit. A rigged coin that lands heads 90% of the time? You mostly know the answer already, so each flip carries less than a bit. The all-heads coin carries zero — no surprise, no information. The average surprise per symbol, weighted by how likely each symbol is, is the entropy: H = −Σ p·log₂ p bits. Maximum when everything's equally likely; zero when one outcome is certain.
And here's the payoff that turned a theory into the entire digital economy: entropy is the exact floor for lossless compression. You cannot, on average, squeeze a source below its entropy — and you can get arbitrarily close. ZIP, PNG, FLAC, the bytes streaming this page: all of them are chasing H and none of them can beat it. Sculpt a letter distribution below and watch the floor move.
Shannon's first act measured information. His second act, in the same 1948 paper, did something that sounded impossible. Every communication channel is noisy — static on the line, cosmic rays flipping bits, a scratch on the disc. The obvious fix is to shout: send each bit three times, vote on the majority. But noise scales with how much you send, so shouting buys you less than you'd hope, and never gets you to zero errors.
Shannon proved there's a magic number. Every noisy channel has a capacity — a maximum bits-per-second — and below that capacity you can transmit with as few errors as you like. Not by shouting. By coding: spreading your message across cleverly-chosen redundant patterns so that even after the noise mangles some of it, exactly one original message could have produced what arrived. This is the birth of error-correcting codes, and they are everywhere you don't look. Your SSD survives dying flash cells because of them. WiFi holds a signal through a wall because of them. The Voyager probes phoned home from interstellar space on a few watts because of them.
The deep, beautiful punchline — which this book pays off later — is that the best codes have geometry. The most efficient error-correcting codes turn out to live on expander graphs (Chapter 11: randomness with a rigid shape) and on dense sphere-packings like the E8 lattice (Chapter 10: the shapes at the frontier). Coding theory is where pure structure quietly runs your hardware.
For all of history, secret messages had one fatal flaw: to share a code, you first had to share the key — and sharing the key secretly is the very problem you were trying to solve. Then, between 1976 and 1978, three ideas broke the loop. Whitfield Diffie and Martin Hellman (1976) showed two strangers could agree on a shared secret over a public wire, in the open, where anyone could listen. Rivest, Shamir and Adleman (1978) turned that into RSA: a lock anyone can snap shut but only you can open.
The trick is a one-way function — easy to run forward, brutal to reverse. Multiplying two large primes is a snap; factoring the product back into those primes is, as far as anyone knows, hopeless at scale. So you publish the product as your public key. Anyone can use it to lock a box (encrypt). Only you, holding the two prime factors, can unlock it (decrypt). It's the asymmetry of effort doing all the work: the padlock is public, the key is math nobody can run backward in any reasonable lifetime. Step through a toy-sized version below.
Step back and these five fields are the same field wearing five coats. Each one takes a fuzzy human notion — something you'd argue about at a bar — and gives it units:
Once a notion has units, you can engineer with it — set thresholds, prove bounds, build the thing and ship it. That's the whole spirit of 20th-century applied math, and it's why this chapter's ideas live inside the device you're reading on, not in a museum. The fuzzy got measured, and the measured got built.
In fifty years, math learned to put numbers on confidence, chance, strategy, information, and secrecy — and the moment each got units, an industry grew on top of it. Statistics referees science; measure theory floors every model; game theory prices auctions and trains adversarial nets; information theory sets the compression and channel limits your hardware lives by; cryptography is the reason you can type a password at all.
But all of this was math going to work. Meanwhile, in the pure wing, something stranger was happening. Mathematicians were getting tired of studying things — numbers, shapes, functions — and starting to study the arrows between them. The rules a structure obeys, it turned out, matter more than what it's made of. That shift is where your typeclasses come from.