Kayavak / Information Theory / IT·03 The Probability You Need / Deeper
Deeper · Information Theory
The Probability You Need
The questions the chapter doesn't stop for: why this exists, the model to keep in your head, what changes when an assumption does, how sure we are of each claim, and what's still open. Read it after the chapter; back to the chapter.
Why does this exist?
Gamblers knew the odds of dice long before anyone wrote them down, and some got them wrong: the Chevalier de Méré reportedly lost money believing that betting on at least one double six in 24 throws of two dice was favourable (it isn't: ). His questions reached Blaise Pascal, whose letters with Pierre de Fermat in 1654 founded the mathematics of chance. Christiaan Huygens wrote it up (1657), Jakob Bernoulli proved that frequencies converge (1713), Abraham de Moivre found the bell-shaped curve that binomial counts approach (1733), Thomas Bayes and Pierre-Simon Laplace worked out how to reason from evidence back to causes, and Laplace's Théorie analytique (1812) made probability a tool for astronomy, demography and law.
What it lacked was a foundation. Paradoxes about "random" choices with infinitely many outcomes, and arguments over whether probability is a frequency or a belief, left the subject on uneven ground until Andrey Kolmogorov (1933) built it on measure theory: a probability is any assignment obeying a few axioms, whatever it means. That separation, rules first and interpretation second, is what let Shannon use probability for messages fifteen years later without having to say what the probabilities "really are".
The mental model
Try it yourself first: write your own model in the Mental Model Explorer, then compare.
A probability is a fraction of the possibilities, weighted: it obeys counting's rules (disjoint parts add, the whole is 1), multiplies for independent events, and is updated by conditioning on what you learn.
| Question | Answer |
|---|---|
| What is it? | Numbers from 0 to 1 attached to events, obeying additivity and normalisation |
| Problem it solves | Reasoning precisely about uncertain outcomes, and averaging over them |
| Parts | Outcomes, events, distributions, conditional probabilities, expectations |
| How it works | Count equally likely cases, or measure long-run frequencies; combine with the sum, product and Bayes rules |
| Assumptions | A fixed set of possible outcomes; for frequencies, repeatable independent trials |
| When they change | Dependence (text, weather) makes products wrong; changing conditions make frequencies drift |
| Where it fails | One-off events with no frequency (beliefs then stand in); probabilities estimated as zero from small samples |
| Related ideas | Counting (ch02), surprise (ch01), entropy as expected surprise (ch04), conditional information (ch07) |
What if?
What if probabilities didn't have to add up to 1?
Reason it through, then open
Then "the chance something happens" could be more or less than certain, and a bettor could exploit anyone whose odds broke the rule. If you price bets on "rain" and "no rain" so that the probabilities you'd accept add to 1.2, someone can sell you both bets and collect 1.2 while paying out exactly 1, whatever the weather: a "Dutch book". Frank Ramsey (1926) and Bruno de Finetti (1937) showed that the axioms are exactly what's needed to avoid such sure losses, which is one argument that degrees of belief should obey them even when there's no frequency to measure.
What if letters in text were independent?
Reason it through, then open
Then the plays' letters would carry their full 4.19 bits each (chapter 1), and no compressor could do better than a code built on letter frequencies alone. Every pair would occur in proportion to its letters' frequencies: "th" no commoner than "ht". Text would read like a scramble of letters in the right proportions, which is what Shannon showed in 1948 by generating "first-order" random text from letter frequencies. The dependence between neighbouring letters, words and ideas is what makes text compressible to under 2 bits per letter, and it's what language models learn.
What if identifiers had to be unique and couldn't coordinate?
Reason it through, then open
Random identifiers from values collide after about , so uniqueness without coordination costs twice the bits of a counter: a counter names things with bits, random names need about plus a margin. Systems that can't afford it coordinate a little instead: Twitter's Snowflake ids combine a timestamp, a machine number and a per-machine counter, so each machine only has to avoid collisions with itself, and UUID version 7 puts a timestamp in front of the random bits, so collisions can only happen within the same millisecond.
Where the boundary is
| Aspect | Independence | Disjointness |
|---|---|---|
| Meaning | Knowing one tells you nothing about the other | They can't both happen |
| Rule | ||
| , usually not 0 | 0 | |
| Two events with positive probability | Can be independent | If disjoint, they're dependent: one rules the other out |
| Example | Two different dice showing six | One die showing 1 and the same die showing 6 |
| In information terms | Surprises add | Knowing one happened gives full information about the other (it didn't) |
Derive it
Why a 50 % chance of a collision among random -bit values arrives after about values.
- With equally likely values, the chance that the th value avoids the before it is , so all are different with probability (the product rule).
- For small , , so the product is about , because a product of exponentials is the exponential of the sum.
- That's close to when is large, so .
- Setting it to : , so and .
- With , that's : about 77,000 for 32 bits and 5 billion for 64, as the chapter's lab computed. For it gives 22.5, so 23 people.
How sure are we?
| Claim | How it's known | Where from |
|---|---|---|
| Independent probabilities multiply | Theorem (given the definition of independence) | Counting for equally likely cases; Kolmogorov's axioms generally |
| Frequencies converge to probabilities | Theorem | Bernoulli's weak law (1713); Borel and Kolmogorov's strong law |
| English letters are far from independent | Measured | The chapter's lab: "th" at 5.8 times the independent rate in the plays |
| 23 people give a better than even chance of a shared birthday | Theorem (under uniform, independent birthdays) | The exact product; real birthdays are slightly non-uniform, which only raises the chance |
| Probabilities should obey the axioms even as beliefs | Model (a strong argument, not a proof about the world) | Ramsey (1926), de Finetti (1937): Dutch book arguments |
| Smoothing avoids failure on unseen symbols | Theorem (no zero probability means finite surprise) | Laplace; Krichevsky and Trofimov (1981) for its cost |
Still open
What probability is remains argued over: a long-run frequency, a degree of belief, a physical propensity, or just whatever obeys the axioms. Statisticians split between frequentist and Bayesian methods, though in practice many use both. For information theory the dispute matters little, since the theorems hold for any probabilities used consistently; it matters a great deal for how those probabilities are chosen.
What would change your mind? The chapter treats text as a source with probabilities that can be estimated from counts. If the statistics of text kept changing however much was read (no frequency ever settling), the law of large numbers wouldn't apply and probabilities estimated from one part of a text would mislead about the next. Real text does drift (topic, author, era), which is why adaptive compressors that keep updating their counts beat fixed ones.
Recall
Why do independent probabilities multiply?
Among the fraction P(A) of cases where A happens, B happens in the same fraction P(B), so both happen in P(A) × P(B).
What is P(B | A)?
P(A and B) / P(A): the fraction of A's cases in which B also happens.
State Bayes' theorem.
P(A | B) = P(B | A) P(A) / P(B).
Why must estimated probabilities never be zero in a compressor?
A symbol with zero probability has infinite surprise and no codeword, so the compressor fails when it appears.
When do collisions among random values from M become likely?
Around √M values (about 1.18 √M for a 50 % chance).
What does the law of large numbers say?
Averages of many independent repetitions approach the expected value, with error shrinking like 1/√n.
Reflect
Be honest with yourself; this stays in your browser. Anything you can't tick yet is what to revisit.