High School Mathematics · Grades 10–12
32Conditional Probability and Independence
Probability quantifies uncertainty; conditional probability quantifies how information changes it. Learning that an event occurred reshapes the probabilities of all other events — a mechanism formalized by Bayes and misused daily in courtrooms and newspapers. This chapter sets up the rules of conditioning and the exact meaning of independence.
32.1 Probability spaces (reminder)
An experiment with finitely many outcomes is modeled by a sample space (the set of outcomes) and a probability assigning to each event a number , additive over disjoint unions and with . Recall the basic rules:
When all outcomes are equally likely, — and computing probabilities reduces to the counting techniques of Chapter 27.
32.2 Conditional probability
Definition 32.1 (Conditional probability)
Let be an event with . The probability of given is
The map is itself a probability (all rules apply); it represents the new state of knowledge of someone who has learned that occurred.
Proposition 32.2 (Multiplication rule)
For events with nonzero probabilities:
and more generally , etc.
Proof. Rearrange the definition; the chain formula follows by iterating. ∎
Theorem 32.3 (Law of total probability)
Let be a partition of into events of nonzero probability. For every event :
Proof. The sets are pairwise disjoint with union , so by the multiplication rule. ∎
Method 32.4 (Probability trees)
A tree diagram organizes conditional probabilities: each branch carries the probability of the next event given the path so far.
- The probability of a leaf (a complete path) is the product of the probabilities along its branches (multiplication rule).
- The probability of an event is the sum of the probabilities of the leaves realizing it (total probability).
- Probabilities on branches leaving one node add up to .
Theorem 32.5 (Bayes’ formula)
Let be a partition of as above and an event with . Then
Proof. ; expand the numerator by the multiplication rule and the denominator by total probability. ∎
Example 32.6 (Screening test)
A disease affects of a population. A test detects it with probability (sensitivity) and gives a false positive with probability . Given a positive test, the probability of actually having the disease is
Despite the accurate test, five positives out of six are false — because the disease is rare. Confusing with is the prosecutor’s fallacy.
32.3 Independence
Definition 32.7 (Independent events)
Two events and are independent if
When , this is equivalent to : knowing does not change the probability of .
Proposition 32.8
If and are independent, so are and (and and ).
Proof. . ∎
Remark 32.9
Do not confuse independent () with incompatible (). Two incompatible events of nonzero probability are never independent: knowing one occurred guarantees the other did not.
Definition 32.10 (Independent repetitions)
When an experiment is repeated times so that the outcome of each trial does not influence the others, the probability of a specified sequence of outcomes is the product of the individual probabilities. This is the model underlying the binomial distribution (Chapter 33).
32.4 Exercises
Exercise 32.1 ★
A card is drawn from a standard 52-card deck. Compute the probability that it is a king, given that it is a face card (jack, queen or king). Are the events “king” and “heart” independent?
Solution
Solution of Exercise 32.1.
There are face cards, of which are kings: .
Independence: (the king of hearts), and . Equal: the events are independent.
Exercise 32.2 ★
An urn contains 5 red and 3 blue balls. Two balls are drawn in succession without replacement.
- Draw the probability tree.
- Compute the probability that both are red, and the probability that the second is red.
Solution
Solution of Exercise 32.2.
1. First branch: red , blue ; second branches (without replacement): after red, red / blue ; after blue, red / blue .
2. . By total probability,
(The same as the first draw — by symmetry, the second ball is a uniformly random ball of the urn.)
Exercise 32.3 ★
Two fair dice are rolled. Let = “the sum is ”, = “the first die shows ”, = “the sum is ”. Determine whether and are independent, then whether and are.
Solution
Solution of Exercise 32.3.
(six pairs sum to ), , and has probability : and are independent. (The sum is special: whatever the first die, exactly one value of the second gives it.)
and : . Not independent.
Exercise 32.4 ★★
A factory has three machines producing respectively , and of total output, with defect rates , and .
- What proportion of the production is defective?
- A randomly chosen item is defective. What is the probability it came from the third machine?
Solution
Solution of Exercise 32.4.
1. Total probability with the partition by machine:
2. Bayes: . The machine producing only a fifth of the output accounts for over of the defects.
Exercise 32.5 ★★
In Example 32.6, at what disease prevalence (instead of ) would a positive test mean at least a chance of disease? Solve the inequality and comment.
Solution
Solution of Exercise 32.5.
The condition is
The denominator is positive, so this reads , i.e. , i.e.
The test alone reaches certainty only if the disease already affects more than of the tested population — which is why mass screening of rare diseases requires confirmation tests.
Exercise 32.6 ★★
A biased coin lands heads with probability . It is tossed three times, tosses being independent.
- Compute the probability of the event = “exactly two heads”.
- For which is maximal?
Solution
Solution of Exercise 32.6.
1. Three sequences realize (HHT, HTH, THH), each of probability by independence: .
2. has , positive then negative on : maximum at , where .
Exercise 32.7 ★★★
(Monty Hall.) A prize hides behind one of three doors. You pick a door; the host, who knows where the prize is, opens one of the two remaining doors, always revealing an empty one (choosing at random if both are empty), and offers you to switch to the other closed door. Using Bayes’ formula, compute the probability of winning if you switch, and if you do not.
Solution
Solution of Exercise 32.7.
Say you picked door 1 and the host opened door 3 (event ). With = “prize behind door ”, and
(if the prize is behind your door, the host chooses between doors 2 and 3 at random; if it is behind door 2, he is forced to open 3). Bayes:
Staying wins with probability , switching with probability .
Exercise 32.8 ★★★
An information channel transmits bits. Each bit is flipped by noise with probability , independently. To protect a bit, it is sent three times and decoded by majority.
- Compute the probability that the decoded bit is wrong.
- The received word is . What is the probability that the sent bit was ? (Assume and are sent with equal probability.)
Solution
Solution of Exercise 32.8.
1. The majority is wrong when at least two of the three copies are flipped:
much smaller than : repetition coding works.
2. If was sent (as ), receiving requires exactly one flip: probability . If was sent (), two flips are needed: . Bayes with equal priors:
The majority decoding () is indeed the more probable guess.
32.5 Problem: The doctor, the judge and the spam filter
Problem 32.1
Weekend problem — Bayes’ formula against the base-rate fallacy: why a test can mean , why a one-in-a-million match convicts nobody, and how your mailbox thinks
A test that catches of cases comes back positive — and the true probability of disease is below . A DNA profile matching one person in a million is found — and the suspect is probably innocent. Both statements are correct, both have been misjudged by doctors and courts, and both are settled by one line of this chapter: Bayes’ formula (Theorem 32.5). This problem trains it on urns, then in the clinic, the courtroom and the inbox.
Part I — Fluency.
- A fair coin chooses urn I ( red, blue) or urn II ( red, blue), then one ball is drawn. Compute with the law of total probability (Theorem 32.3).
- The ball is red: compute .
- One die roll: are the events “even” and “” independent (Definition 32.7)? And “even” and “”?
- Two independent smoke alarms each trigger with probability in a fire. Using Proposition 32.8, compute the probability that at least one triggers.
- Two cards without replacement: compute with the multiplication rule (Proposition 32.2).
Part II — The doctor. A disease affects person in . The test detects of the sick (sensitivity) but also fires on of the healthy (false positives).
- Natural frequencies: imagine people. How many are sick, how many healthy? How many positives does each group produce, and how many positives in all?
- From the counts, compute . Absorb the shock.
- Recompute it with Bayes’ formula and check the agreement.
- In surveys, most physicians answer “about ”. Name the two conditional probabilities being confused, and explain why the tiny base rate drives the true answer.
- A second, independent test also comes back positive. Update: taking as the new prior, compute . What is evidence accumulation doing?
- Compute if the same test is used only on a high-risk group with prevalence . Deduce the public-health moral about mass screening of rare conditions.
Part III — The judge.
- A crime-scene DNA profile matches one person in a million. The suspect, found by searching a database of the city’s million inhabitants, matches. Expected number of innocent matches in the city? Given only the match, what is , roughly?
- Name the fallacy — which probability did the prosecutor quote, which one did the court need? — and its exact parallel with question 9.
- The independence trap: two rare tragedies in one family were once squared into “one in million” by treating them as independent, convicting an innocent mother (the Sally Clark case). If the events share family risk factors so that the second, given the first, is times likelier than the base rate, recompute the order of magnitude — and state the lesson about multiplying probabilities.
- The defense can cheat too: “ten innocents match, so the match proves nothing” ignores everything else. What does Bayes’ formula do with several pieces of evidence, and what single sentence should every juror know?
Part IV — The spam filter.
- Your mail is spam. The word “lottery” appears in of spam and of honest mail. A message contains it: compute .
- Error-correcting repetition (Exercise 32.8 continued): with flip probability , majority decoding of five copies fails with what probability? Compare with the three-copy code.
- A bit crosses independent noisy relays, each flipping it with probability : it arrives correct exactly when the number of flips is even. Compute that probability twice: by summing the binomial terms, and by the elegant formula .
- Real spam filters multiply the evidence of many words as if independent (“naive” Bayes). Why is that assumption false for words like “win” and “lottery” — and why does the filter work well anyway? (One or two sentences.)
- Finale — Bayes as the arithmetic of belief: prior likelihood, renormalize, posterior. Replay the three verdicts (clinic, courtroom, inbox) in one sentence each, then list the three traps this problem exposed: forgotten base rates, fake independence, and evidence read one piece at a time.
Solution
Solution of Problem 32.1.
1. .
2. .
3. and : independent (unexpectedly!). For : against : dependent.
4. The complements of independent events are themselves independent, so
5. .
6. Sick: ; healthy: . Positives: true (99 % of ) and false (5 % of ): positives in all.
7. : of the people the test flags, fewer than one in fifty is actually sick.
8. : the counts and the formula agree.
9. Confused: (the test’s advertised quality) with (the patient’s actual question). With a base rate of , the sick are so rare that even a leak from the huge healthy majority swamps the true positives fifty to one.
10. . Each independent positive multiplies the odds by the same factor: evidence accumulates, and a third positive would push past — which is why confirmatory tests exist.
11. : on a high-risk group the same test is informative. Moral: screen where the base rate is substantial; mass-screening a rare condition manufactures false alarms by the thousand.
12. Expected innocent matches: . Among the roughly matching people ( innocent, guilty — if the culprit is in the city), the suspect found by the match alone is innocent with probability about .
13. The prosecutor quoted ; the court needed — question 9’s confusion under oath. (And in the real case that popularized these errors, a second blunder compounded it: see question 14.)
14. Naive squaring: . With the second tragedy five times likelier given the first: — five times larger, and still ignoring that the alternative hypothesis must be weighed by Bayes too. Lesson: multiplying probabilities requires independence, and shared causes (genetics, environment) destroy it.
15. Bayes multiplies the likelihood ratios of all the evidence into one posterior: the match, the alibi, the fibers, each shifting the odds. The juror’s sentence: ask how probable the evidence is under both hypotheses, and never mistake the one conditional for its reverse.
16. spam: one word nearly settles it.
17. Five copies fail when , or flip: — against for three copies: repetition buys reliability at the price of bandwidth.
18. Even flips: ; and : the trick formula tracks the bias through each relay.
19. Spammy words travel in packs — a message with “lottery” very likely contains “win”, so their joint evidence is weaker than the product pretends. The filter still works because the exaggeration usually pushes in the right direction: classification needs the correct side of , not the correct posterior.
20. Clinic: a rare condition turns a strong test into a weak verdict — update from the base rate, then accumulate. Courtroom: a rare match in a large city indicts the city, not the man — likelihoods are not verdicts. Inbox: many weak clues, multiplied, sort the mail — even naively. The three traps: forget the prior and be fooled; fake independence and be very fooled; read evidence piecemeal and never know what you know.