Glossary / Conditional probability
Meet an NBA player, and he is almost surely taller than everyone around. Meet a tall man, and he has almost surely never played in the NBA: there are millions of tall men and only a few hundred players. The two statements sound like one, but they answer different questions. Conditional probability is about whom we are counting among.
“In plain words” is hidden on all puzzles.
Here is the crowd of an imaginary town. Tall people are bars, the rest are dots. Basketball players are circled (to make them visible there are far more of them here than in real life). Choose whom to look among and compare the pictures.
“Rigorous” is hidden on all puzzles.
The conditional probability P(A | B) reads "the probability of A given B". We know that B has happened, throw away every case without B and look at what share of the rest A takes up.
P(A | B) = P(A і B) / P(B)
Take a 52-card deck. It has 12 face cards (jack, queen, king) and 4 kings. You drew a king. Is it a face card? Yes, always: P(face | king) = 4/4 = 1. Now the other way round: you drew a face card. Is it a king? Only one time in three:
P(king | face) = P(king and face) / P(face) = (4/52) / (12/52) = 4/12 = 1/3
The same cards, the same kings, yet the answers are 1 and 1/3. The condition decides what counts as "everything".
Conditional probabilities are easy to mix up when written as percentages. It gets much easier when you retell them as "out of 1,000 days…". Each cell below is a day. When it rains, it is always cloudy. But it can be cloudy without rain too. Move the sliders.
The costliest form of this mistake has its own name: the prosecutor's fallacy. Imagine a trace was found at a scene and it matched the defendant. An expert says: "If this person had nothing to do with it, such a match would happen to only one in a million." It is easy to hear "the chance he had nothing to do with it is one in a million". But the expert gave P(match | not involved), while the court needs P(not involved | match).
Let's count cases. A town has 5 million people. About 5 of them would match by chance, plus the culprit. If there is nothing but the match, a person who matches is guilty only one time in six. A match is important evidence, but its weight has to be combined with everything else, not read with the condition swapped.
“Deeper” is hidden on all puzzles.
P(A і B) = P(A | B) · P(B) = P(B | A) · P(A)
This is the same definition, just multiplied by P(B). The event "A and B" can be built in two ways: first B, then A given B, or first A, then B given A. For the deck: P(king | face) · P(face) = 1/3 · 12/52 = 4/52, and P(face | king) · P(king) = 1 · 4/52 = 4/52. Both routes lead to the same four kings.
P(B | A) = P(A | B) · P(B) / P(A), where P(A) = P(A | B) · P(B) + P(A | not B) · P(not B)
Set the two halves of the multiplication rule equal and divide by P(A). The formula says exactly what the pictures show: to flip a condition you also need the sizes of the groups, P(B) and P(A). In the crowd above 9 of 10 players are tall, there are 10 players among 2,000 people and 200 tall people among 2,000:
P(player | tall) = 0.9 · 0.005 / 0.1 = 0.045
For the days from the sliders: P(rain | clouds) = 1 · – / (1 · – + – · –) = –, the same number as in the simulation.
odds(B | A) = odds(B) · P(A | B) / P(A | not B)
Odds are "how many for against how many": odds(B) = P(B) / P(not B). Then Bayes' formula becomes a single multiplication. The starting odds are multiplied by the likelihood ratio: how many times more often A happens with B than without it. P(A) cancels and is no longer needed.
For the days from the sliders: before we look at the sky, the odds of rain are –, clouds are – times more common on a rainy day than on a dry one, so the odds of rain given clouds are –, a probability of –.
P(A | B) = P(A) ⇔ P(A and B) = P(A) · P(B)
This is how independence is defined. In a deck P(queen | red) = 2/26 = 1/13, and plain P(queen) = 4/52 = 1/13: knowing the colour says nothing about whether it's a queen. And the other way round, P(red | queen) = 2/4 = 1/2 = P(red). Independence always works both ways, but the "nearly always" from the first section doesn't: height and basketball are strongly dependent, which is why P(tall | player) and P(player | tall) are so different.
The middle value: line everyone up in order, and half are below it, half above.
A millionaire walks into a bar: the average income shoots up, the median barely moves.
The sum of all values divided by how many there are: what everyone would get if it were shared equally.
Almost everyone has more legs than average: the average is a little under two.
The average result you can expect if you repeat the same thing very many times.
A die's expected value is 3.5, yet no face shows 3.5.
A number from −1 to +1 showing how closely two quantities move together.
In summer both ice cream sales and drownings go up. Ice cream isn't to blame: the heat drives both.
A measure of spread: how far values typically stray from the mean. The standard deviation is its square root, in the same units.
Two towns with the same average temperature: one stays near +15 all year, the other swings from −20 to +50.
A bell-shaped distribution: most values sit near the mean, and the further away, the rarer.
Every ball on a Galton board falls at random, yet thousands of balls always build the same bell.
The more repetitions, the closer the share of an outcome gets to its true probability.
The share of heads creeps towards 50%, while the gap between heads and tails in coins usually grows.
Events are independent if knowing about one doesn't change the chances of the other.
After five heads in a row tails is no more likely: the coin remembers nothing.
How many times you multiply the base by itself to get a number: log₂ 8 = 3, because 2 · 2 · 2 = 8.
A sheet of paper folded in half 42 times would be thicker than the distance to the Moon.
A sample some people get into more easily than others, so it describes everyone badly.
In 1936 a magazine polled millions of Americans and still picked the wrong election winner.
How often chance alone would produce a gap at least as big as yours if there were really no difference.
When there is no effect at all, p below 0.05 turns up as often as p between 0.50 and 0.55.
A range around a measured number, built by a method that covers the true value in a chosen share of samples, such as 95%.
Of twenty honest 95% intervals, on average one misses the truth, and none of them knows whether it is the one.
The probability that a test notices a real effect of a given size. A power of 80% means the test misses one working effect in five.
A weak A/B test that does find an effect almost always exaggerates it: a real +10% shows up on the dashboard as +24%.
How far an average or a rate computed from a sample usually misses the truth: σ divided by the square root of the sample size.
Halving the error takes four times as much data.