Lecture 2: Conditional Probability and Independence
EECS 126 (UC Berkeley) · Spring 2026 · January 22, 2026
In this lecture we introduce conditional probability, derive the multiplication (chain) rule, state the law of total probability and Bayes’ rule, work through the classic false-positive medical testing example, and then develop the theory of independence and conditional independence.
Conditional Probability
Let be events with . The conditional probability of given is
Intuitively, is the probability that occurs when we know that has occurred. Conditioning on restricts the sample space from to ; the event becomes the new “” for .
In a uniform sample space, . Conditioning on gives , which is simply the fraction of outcomes in that also lie in .
Roll two standard dice. Let , , and .
Computing : The outcomes in (sum = 7) are , so . The only outcome in is , so . Therefore
Computing : The outcomes in (sum = 11) are , so . The only outcome in is , so
Multiplication Rule (Chain Rule)
For any events with ,
By repeated application of the definition of conditional probability. Write , then , and continue inductively. Each factor is well-defined because implies , and we are given the intersection has positive probability up to terms.
Birthday paradox via the chain rule. The chain rule gives an alternative derivation of the birthday bound. Let . Then
recovering the same bound from Lecture 1.
Law of Total Probability
Let be a partition of (i.e. the are pairwise disjoint — mutually exclusive — and their union is — collectively exhaustive). Then for any event ,
Since partitions , we can decompose as , and these pieces are disjoint. By countable additivity, , where the last step uses the definition of conditional probability.
Bayes’ Rule
Let partition . Given an event with ,
The numerator uses the definition of conditional probability, and the denominator is expanded by the law of total probability.
A medical test for a rare disease has the following properties:
- If a person has the disease, the test is positive with probability (sensitivity).
- If a person does not have the disease, the test is negative with probability (specificity), i.e. false positive rate .
- The prior prevalence is (1 in 1000 people have the disease).
A person tests positive. What is ?
Define , . By Bayes’ rule:
Despite the test being 95% accurate, a positive result only indicates a chance of actually having the disease. This is because the disease is so rare that the false positives from healthy people vastly outnumber the true positives.
Sensitivity to the prior. If the prior were instead ( more common), then — still low, but dramatically higher. The base rate (prior) has an enormous effect on the posterior.
Independence
Two events and are independent if the occurrence of one provides no information about the occurrence of the other. Formally:
The second form says the joint probability equals the product of the marginals.
Key remarks on independence:
- Disjoint independent. disjoint means . For this to equal , we need or . So disjoint events with positive probability are dependent, not independent.
- Base outcomes are always dependent. Individual outcomes in any finite are always dependent (knowing one occurred rules out the others).
Roll two fair dice. Let , , .
Are and independent? , so yes, .
Are and independent? , so no, and are dependent. Intuitively, knowing the sum is 11 makes it more likely that the first die was a 6 (since is one of only two outcomes).
Conditional Independence
Events and are conditionally independent given if
Independence and conditional independence are distinct concepts:
- Dependent events can become conditionally independent.
- Independent events can become conditionally dependent.
You have two coins: one is double-headed, the other is double-tailed. You pick one at random and flip it twice. Let , .
Q1: Are (unconditionally) independent? No. . If the second flip is heads, you certainly picked the double-headed coin, so the first flip is heads with certainty.
Q2: Conditioning on the coin, are they independent? Let . Then , and . These are equal, so . Once we know which coin was picked, each flip is determined and independent.
Toss a fair coin twice. Let , , and .
Q1: ? Yes, by independence of fair coin flips.
Q2: ? No. . But , since both flips being heads contradicts (the flips must differ). Since , the events are conditionally dependent given .
Joint Independence vs. Pairwise Independence
Events are jointly (mutually) independent if for every subset ,
Pairwise independence only requires this for all pairs .
Pairwise independence joint independence. Consider the fair coin example: are pairwise independent (check all three pairs), but they are not jointly independent because .
Renewal: Rolling a 6 Before a 7
Roll two fair dice independently and repeatedly. Let .
The outcomes that sum to 6 are , so where . Similarly, where .
By the law of total probability, conditioning on the first roll:
We have , , and by the renewal/memoryless property (each roll is independent, so if neither 6 nor 7 appears, we restart). Thus
Solving: , so , giving