Knowing something shrinks the sample space
Roll two fair dice, red and blue. The red die shows 6 with probability . Now someone tells you that the sum is at least 9: what is the chance of a red 6 now?
Only the 10 outcomes with a sum of 9 or more are still possible, and they are still equally likely. Four of them have a red 6: , , and . So the chance is now .
Knowing , a sum of at least 9, leaves only its 10 shaded cells. The red 6 takes 6 of the 36 cells of the grid, but 4 of the 10 cells of .
News can also lower a chance, or leave it alone. If the sum is at most 6, a red 6 is impossible, since . If the sum is exactly 7, one of its 6 outcomes, , has a red 6: the chance stays .
The definition
Shrinking to keeps only the part of inside . Dividing by the size of makes the probabilities on add up to 1 again.
Rule: Conditional probability
Read "the probability of given ". It is defined only when : you cannot condition on something impossible. With equally likely outcomes it is .
For the dice, and , so . Conditional probabilities follow the rules of lesson 5.1.1, on the smaller sample space: .
The order matters. asks for a sum of at least 9 given a red 6. Then the blue die needs 3 or more, so , not 0.4.
The two share the top, , but divide by different events. Lesson 5.1.4 shows how costly a swap can be.
Try it
P counts outcomes over the 36, and cond(a, b) is : the count of both over the count of b. Events are written as tests on an outcome w, and Fraction reduces to .
The last line gives the chance of a red 6 given a sum of at most 6 and given a sum of 7.
In a simulation: keep only the runs where happened
Conditioning has a direct meaning in a simulation. Throw away every run in which did not happen, then count among the rest.
With the seed 4, a million rolls of two dice gave 278,491 with a sum of at least 9. Of those, a share 0.3991 had a red 6, close to 0.4. Among the rolls with a sum of 7, the share was 0.1674, close to .
Try it
rolls[keep, 0] takes the red die of the rows where keep is True, so .mean() of the test is the conditional share.
The multiplication rule
Multiply the definition through by and it gives the chance that both events happen.
Rule: Multiplication rule
The chance of , times the chance of once has happened. For three events, , and so on.
It suits draws without replacement, where each conditional chance can be read off. An urn holds 3 red and 2 blue balls, and two are drawn.
The first is red with probability . Then 2 of the 4 balls left are red, so , as lesson 5.1.2 found by counting.
The same works for cards. Two aces in two cards: . Three hearts in a row: .
Trees and the law of total probability
A tree draws an experiment in stages. Each branch carries a conditional probability, given the path so far. Multiply along a path to get the chance of its leaf; add the leaves that make up an event.
Two draws without replacement, with R for red and B for blue. Each leaf's probability is the product along its path. The second ball is red on two paths, .
The leaves add up to 1, and so do the branches out of each point: two checks worth making on every tree. The second ball is red with probability , the same as the first. Before you see the first ball, the second has no reason to differ.
That sum over the first draw is a rule of its own. A partition of is a list of disjoint events that together make up , like "first red" and "first blue".
Rule: Law of total probability
Split into the disjoint pieces , find the chance of within each, and weight by the size of the piece. Each term is the multiplication rule for .
A second example. A bag holds a fair coin and a coin that lands heads with probability 0.8. Pick one at random and toss it:
A table of counts tells the same story. In 1,000 repeats, about 500 pick the fair coin and 250 of those give heads. About 500 pick the biased coin and 400 give heads: 650 heads in all.
| coin | picked | heads |
|---|---|---|
| fair | 500 | 250 |
| biased | 500 | 400 |
| total | 1,000 | 650 |
Lesson 5.1.4 asks the reverse question: given heads, which coin was it? Case study 5.1.6 uses the law of total probability to turn one-year default probabilities into two-year ones.
Try it
The tree and the coin bag, exactly. Then 200,000 seeded draws of two balls: each row puts the 5 balls in a random order, and balls 0 to 2 are red.
The conditional shares, and , should be near and .
The seeded run gives 0.2992 for both red and 0.6019 for a red second ball, against 0.3 and 0.6. The conditional shares are 0.5002 and 0.7534.
Independence
Sometimes knowing changes nothing: . Then and are independent, and the multiplication rule becomes a plain product.
Rule: Independent events
and are independent when this holds. If it says the same as : knowing does not change the chance of , and the other way round.
Test it on two dice.
- Red 6 and blue 6: . Independent: the dice do not affect each other.
- Red 6 and a sum of 7: . Independent too, although the sum uses the red die: whatever red shows, exactly one blue face makes 7.
- Red 6 and a sum of at least 9: , but . Not independent: a high sum makes a red 6 more likely.
Draws with replacement are independent, because the urn is the same each time. Without replacement they are not: , but .
Several events are independent when every group of them multiplies in this way, as for repeated tosses or rolls. Ten heads in ten fair tosses has probability . At least one six in 4 rolls is , by the complement; a million seeded runs below give 0.5171.
Independence is a property of how the experiment runs: separate dice, a fresh shuffle, a ball put back. Do not assume it when one result can affect another.
Independent is not mutually exclusive
Disjoint events sound unrelated, but they are as dependent as events can be. If one happens, the other cannot.
Roll one die, with and . They are disjoint, so , but . Knowing drops the chance of from to 0.
Rule: Disjoint events are dependent
Mutually exclusive events with positive probabilities are never independent. "Mutually exclusive" is about sets that do not overlap; "independent" is about chances that do not change.
Try it
independent compares with on the 36 outcomes. The last pair is the disjoint one, on a single die.
The second part simulates 4 rolls a million times, with the seed 6, and counts the runs with at least one six.
Common mistakes
- is not . A red 6 given a high sum is 0.4; a high sum given a red 6 is .
- Divide by the condition. The event after the bar goes on the bottom: .
- Multiply plain probabilities only for independent events. In general . For a red 6 and a sum of at least 9, the product gives 0.0463 instead of .
- Draws without replacement are dependent. After a red ball, the chance of red falls from to .
- Disjoint is not independent. Disjoint events with positive probabilities always affect each other.
- Check the tree. Branches out of each point add up to 1, and so do the leaves.
- No conditioning on the impossible. needs .
Conditional probability and independence
0 of 13 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
How to type answers
- Powers with
^:x^7,2^(1/3),a^-2. - Multiply with
*or by writing side by side:3x^2,2(x+1). ln(x)is the natural log,log(x, 2)is log base 2,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for sin²x.- Your first answer to each question is saved: it counts towards your score and brings the question back for review.
- Exact answers like
ln(20)/ln(3)are best. Decimals need about 4 significant figures.
Summary card
- , for : shrink the sample space to . In a simulation, keep only the runs where happened.
- and share the top but have different bottoms.
- Multiplication rule: . On a tree, multiply along a path and add the leaves.
- Law of total probability: over a partition .
- Independent: , or . Disjoint events with positive probabilities are never independent.