Scroll to turn the page
Probability · Probability (college)
updating on what you learn
A car is behind one of three doors and goats are behind the other two. You pick a door. The host, who knows where the car is, opens another door and shows a goat. Should you switch?
Most people say it can’t matter: two doors are left, so it must be 50–50. When Marilyn vos Savant answered in a magazine column in 1990 that switching wins 2/3 of the time, thousands of readers wrote in to say she was wrong. She was right.
The figure plays the game over and over. Staying wins only when the first pick was right, which happens 1/3 of the time. In these 90 games, staying won 24 and switching won 66.
The host’s choice carries information, and conditional probability is how information changes probabilities. This chapter defines it, then builds its two great tools, the law of total probability and Bayes’ rule, and uses them on screening tests, the meaning of independence, and a gambler’s chance of going broke.
the probability of A, given B
If P(B) > 0, the conditional probability of A given B is
Learning that B happened rules out every outcome outside B. What is left of A is A ∩ B, and dividing by P(B) makes the probabilities in B add to 1 again. P(· | B) is a probability function in its own right: it satisfies all three axioms.
Two children. A family has two children, each a girl or a boy with probability 1/2, independently. The four outcomes (elder, younger) BB, BG, GB, GG are equally likely.
Given that at least one is a girl, three outcomes are left (BG, GB, GG), and
Given that the elder is a girl, only GB and GG are left, and the answer is 1/2. The two pieces of news sound alike but they condition on different events. The figure draws families at random and keeps both shares; they settle near 1/3 and 1/2.
The multiplication rule. Rearranged, the definition says P(A ∩ B) = P(B) P(A | B). For more events, P(A1 ∩ A2 ∩ A3) = P(A1) P(A2 | A1) P(A3 | A1 ∩ A2). Drawing two aces from a deck: (4/52)(3/51) = 1/221.
split the problem into cases
If B1, …, Bn partition S (they are disjoint and one of them must happen), then any probability can be found case by case:
Each term is P(A ∩ Bi), the part of A in the i-th case, and the cases don’t overlap.
Example. On a commuter’s mornings the weather is clear, rain or snow with probabilities 0.6, 0.3, 0.1. She is late with probability 0.05, 0.25, 0.5 in each.
| weather | clear | rain | snow |
|---|---|---|---|
| P(weather) | 0.6 | 0.3 | 0.1 |
| P(late | weather) | 0.05 | 0.25 | 0.5 |
| P(late ∩ weather) | 0.030 | 0.075 | 0.050 |
In the figure the unit square is split into strips as wide as each P(weather), and each red block is as tall as P(late | weather). Its area is the product, so the total red area is P(late). Days land in the square at random; the share that land in red approaches 0.155.
Conditioning is the main way hard probabilities get computed: find the right thing to condition on, and each case becomes easy.
turning P(B | A) into P(A | B)
P(A | B) and P(B | A) are different numbers. Bayes’ rule converts one into the other:
The denominator usually comes from the law of total probability. On the late commuter’s mornings, P(snow | late) = 0.050/0.155 = 0.323: snow comes on only 10% of mornings but on 32% of late ones.
A screening test. 1% of people have a disease. A test finds 95% of cases (its sensitivity) and correctly clears 95% of healthy people (its specificity). Someone tests positive. How likely is it they are sick?
Only about 1 in 6. In the figure’s 2,000 people, 20 are sick and 19 of them test positive; but 99 of the 1980 healthy people do too. The positives who are sick: 19/118. When a condition is rare, false positives outnumber true ones. Mixing up P(+ | D) = 0.95 with P(D | +) is called the prosecutor’s fallacy when it happens in court.
Odds form. Posterior odds = prior odds × likelihood ratio. The prior odds are 1 : 99; a positive has likelihood ratio 0.95/0.05 = 19, so the odds become 19 : 99, which is 0.161. A second positive on an independent test multiplies by 19 again: P(D) rises to 0.785.
when knowing B tells you nothing about A
Events A and B are independent if P(A ∩ B) = P(A) P(B). When P(B) > 0 this is the same as P(A | B) = P(A): learning B doesn’t change the chance of A.
Independence is not the same as being disjoint. Disjoint events with positive probabilities are as dependent as can be: if one happens, the other can’t.
If A and B are independent, so are A and Bc, Ac and B, and Ac and Bc.
Three events are independent only if every pair is and P(A ∩ B ∩ C) = P(A) P(B) P(C). Pairs are not enough. Toss a fair coin twice. Let A be “the first is heads”, B “the second is heads” and C “the two tosses agree”. Each has probability 1/2, and each pair meets only in HH, with probability 1/4 = (1/2)(1/2). So the events are pairwise independent. But all three happen only in HH:
Knowing A and B together settles C. The figure lights each event in turn.
Conditional independence. A and B can be independent given C but not unconditionally, or the reverse. Two screening tests on the same person are often modeled as independent given whether the person is sick (that was the second positive in 2.3). Without that condition they are dependent: a positive on one makes a positive on the other more likely, because it makes sickness more likely.
what the host’s choice tells you
Three doors, one car. You pick door 1. The host, who knows where the car is, always opens a door you didn’t pick with a goat behind it, choosing at random if he can open either. Should you switch?
By the law of total probability, conditioning on where the car is (each door 1/3):
| car behind | host opens | staying | switching |
|---|---|---|---|
| door 1 (your pick) | 2 or 3 | wins | loses |
| door 2 | 3 | loses | wins |
| door 3 | 2 | loses | wins |
By Bayes’ rule, say the host opens door 3. If the car is behind door 1 he opens 3 with probability 1/2; if it is behind door 2 he must open 3. So P(host opens 3) = (1/2)(1/3) + (1)(1/3) + 0 = 1/2, and
Your first pick was right with probability 1/3, and nothing the host does changes that, because he can always open a goat door. The other 2/3 is concentrated on the one door he left shut.
The answer depends on the rules. If the host opened a door at random and happened to show a goat, switching would win only 1/2 of the time. In the figure’s 90 games, switching won 66 (0.733).
condition on what happens first
A gambler with $i bets $1 at a time, winning each bet with probability p, and stops on reaching $N or $0. What is the chance of reaching $N?
Call it pi. Condition on the first bet: it is won (probability p) or lost (q = 1 − p), and after it the game starts over from $i + 1 or $i − 1:
This is a difference equation, and its solution is
Roulette. A bet on red wins with probability 18/38 on an American wheel (18 red pockets of 38). Starting with $10 and aiming for $20, the chance of reaching the goal is 0.259, against 0.50 for a fair coin. A small edge per bet becomes a large one over many bets. In the figure, 1 of the 5 gamblers reach $20.
Even a fair game takes a while: the expected number of bets is i(N − i) = 100. And against an opponent with unlimited money (N → ∞), a gambler in a fair game is ruined with probability 1.