Math paradoxes

Glossary / Conditional probability

Glossary · conditional probability

Nearly every NBA player is tall. Is every tall man an NBA player?

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 wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

The basketball paradox

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.

–
Another crowd

  • "Nearly all A are B" doesn't mean "nearly all B are A"Nearly all players are tall, yet among tall people there is only a handful of players. The gap appears when one group is much bigger than the other.
  • First ask: among whom?Every share has an "among whom". Change that group and the number can change tenfold or more, though the people are the same.
Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

Probability given a condition

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".

Count cases, not percentages

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.

rain (and clouds) cloudy, no rain clear
Cloudy, given rain–
Rain, given clouds–

The swapped condition

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.

How not to get lost

  • Say the condition out loud"Among rainy days 100% are cloudy" and "among cloudy days 22% are rainy" are different sentences. Who comes after "among"?
  • Turn it into a number of people"Out of 1,000 people…" is almost always clearer than a chain of percentages. Count how many land in the group after the condition, and how many of those have the feature.
  • Remember which group is biggerIf B is common and A is rare, P(A | B) will be small even when P(B | A) is almost one.
  • New information changes "everyone"Once you learn something, some cases have to be thrown away. Carrying on counting among the old "everyone" means answering a different question.
Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

The multiplication rule

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.

Bayes' formula: how to flip the condition

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.

The same in odds

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 –.

When the condition changes nothing

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.

Where it shows up

Other terms