6. Independence of events
Two events are independent when knowing one happened tells you absolutely nothing new about the other.
It's a simple idea — and one of the most commonly confused in all of probability, because it gets mixed up with a completely different idea that sounds similar.
The definition
Flip two separate coins. Let A be "the first coin is heads" and B be "the second is heads". Coin two has no idea what coin one did; there's no physical connection between them.
That intuition becomes a clean rule:
P(A \cap B) = P(A)\,P(B)
\tfrac{1}{2} \times \tfrac{1}{2} = \tfrac{1}{4} \quad\checkmark
Equivalently — and this is the version that shows what independence means — whenever P(B) > 0:
P(A \mid B) = P(A)
Learning that B happened moved the needle not at all. That the two forms agree is immediate from the definition of conditional probability:
P(A \mid B) = \frac{P(A \cap B)}{P(B)} = \frac{P(A)P(B)}{P(B)} = P(A)
The product form is the official definition, because it stays meaningful when P(B) = 0 and it's visibly symmetric in A and B. Independence is a two-way street: if B tells you nothing about A, then A tells you nothing about B.
The trap: independent is not disjoint
Here is the mistake almost everyone makes.
Roll a single die. Let A be "the roll is even" and B be "the roll is odd".
These two events never overlap — they are disjoint. So are they independent?
Absolutely not. They're about as dependent as two events can be. If you know the roll came up odd, you know for certain it was not even:
P(A \mid B) = 0, \qquad P(A) = \tfrac{1}{2}
Nowhere near equal. Check the product form too: $P(A \cap B) = P(\varnothing) = 0$, but P(A)P(B) = \tfrac{1}{2} \times \tfrac{1}{2} = \tfrac{1}{4} \ne 0.
Disjoint events with nonzero probability are the exact opposite of independent — knowing one happened tells you the other definitely didn't.
| Disjoint | Independent | |
|---|---|---|
| Definition | P(A \cap B) = 0 | P(A \cap B) = P(A)P(B) |
| Knowing B happened | rules A out entirely | tells you nothing |
| Picture | non-overlapping regions | overlap in exact proportion |
| For P(A), P(B) > 0 | can't be independent | can't be disjoint |
They are not opposites of each other in the sense of a dichotomy — they are just different, and mostly incompatible.
Three or more events: pairwise isn't enough
One last subtlety. With three events, checking every pair is not sufficient.
Take two fair coins. Let
- A: the first is heads
- B: the second is heads
- C: the two coins match
Each has probability 1/2. Check the pairs:
- A \cap B is HH only: P = 1/4, and \tfrac12 \times \tfrac12 = \tfrac14. ✓
- A \cap C is HH only: P = 1/4 = \tfrac12 \times \tfrac12. ✓
- B \cap C is HH only: P = 1/4 = \tfrac12 \times \tfrac12. ✓
Every single pair is independent. Now look at all three at once. $A \cap B \cap C$ holds only for HH, so P = 1/4. But
P(A)P(B)P(C) = \tfrac{1}{2} \times \tfrac{1}{2} \times \tfrac{1}{2} = \tfrac{1}{8}
And \tfrac14 \ne \tfrac18. The three events are pairwise independent but not mutually independent.
The reason is easy to see: any two of these events determine the third. Knowing the first coin is heads and the coins match tells you the second is heads with certainty.
So the real definition, for events A_1, \dots, A_n, requires the product rule to hold for every subset:
P\!\left(\bigcap_{i \in S} A_i\right) = \prod_{i \in S} P(A_i) \quad \text{for every } S \subseteq \{1, \dots, n\}
That's 2^n - n - 1 conditions, not just the \binom{n}{2} pairwise ones.
Worked example
A system has three components that fail independently, with failure probabilities 0.1, 0.2 and 0.05. The system works only if all three work. What's the probability it works? What if instead it works when any one of them works?
All three working (independence lets us multiply):
P = (0.9)(0.8)(0.95) = 0.684
For the second part, "at least one works" is awkward directly — use the complement. All three fail:
P(\text{all fail}) = (0.1)(0.2)(0.05) = 0.001
P(\text{at least one works}) = 1 - 0.001 = 0.999
Note the enormous difference: 68.4% versus 99.9%, from the same components. This is the whole engineering argument for redundancy — components in series multiply their reliabilities, components in parallel multiply their failure rates.
Doing it in Python
Independence is a claim you can test rather than assume, by comparing the joint probability against the product:
from itertools import product
omega = list(product(["H", "T"], repeat=2)) # 4 equally likely outcomes
def P(event):
return sum(1 for w in omega if event(w)) / len(omega)
A = lambda w: w[0] == "H" # first is heads
B = lambda w: w[1] == "H" # second is heads
C = lambda w: w[0] == w[1] # the coins match
def independent(X, Y):
joint = P(lambda w: X(w) and Y(w))
return joint, P(X) * P(Y), joint == P(X) * P(Y)
print("A,B:", independent(A, B))
print("A,C:", independent(A, C))
print("B,C:", independent(B, C))
triple = P(lambda w: A(w) and B(w) and C(w))
print("triple joint:", triple, " product:", P(A) * P(B) * P(C))
print("mutually independent:", triple == P(A) * P(B) * P(C))
Every pair reports True; the triple reports False. That's the pairwise trap
made concrete in eight lines.
Your turn
1. A fair coin is flipped 10 times. What's the probability of at least one head?
2. P(A) = 0.5, P(B) = 0.4, P(A \cap B) = 0.2. Independent? Disjoint?
3. Two events are disjoint and independent. What must be true of them?
Solutions
1. Flips are independent, so use the complement. All ten tails:
P(\text{no heads}) = (0.5)^{10} = \frac{1}{1024}
P(\text{at least one head}) = 1 - \frac{1}{1024} = \frac{1023}{1024} \approx 0.999
The "complement plus independence" combination is the standard tool for any "at least one" question, and it's why such problems are usually easier than they look.
2. Independent: check the product. P(A)P(B) = 0.5 \times 0.4 = 0.2, and P(A \cap B) = 0.2. Yes, independent.
Disjoint: P(A \cap B) = 0.2 \ne 0, so no — they overlap.
This is the normal state of affairs: independent events with positive probability must overlap, and by exactly the right amount.
3. Suppose A and B are both disjoint and independent. Disjointness gives P(A \cap B) = 0; independence gives P(A \cap B) = P(A)P(B). So
P(A)P(B) = 0
which forces P(A) = 0 or P(B) = 0. At least one of them must be impossible (probability zero).
So the two conditions are compatible only in the degenerate case. For any two events that can actually both happen, being disjoint and being independent are mutually exclusive.
Check yourself in code
Test all three pairs from the two-coin example plus the triple, and report how many of the pairs are independent and whether the three are mutually independent.
Print exactly this:
independent pairs: 3 of 3
mutually independent: False
from itertools import product, combinations
omega = list(product(["H", "T"], repeat=2))
def P(event):
return sum(1 for w in omega if event(w)) / len(omega)
A = lambda w: w[0] == "H"
B = lambda w: w[1] == "H"
C = lambda w: w[0] == w[1]
events = [A, B, C]
# Count how many of the three pairs satisfy P(X and Y) == P(X) * P(Y),
# then check whether the triple product holds too.
from itertools import product, combinations
omega = list(product(["H", "T"], repeat=2))
def P(event):
return sum(1 for w in omega if event(w)) / len(omega)
A = lambda w: w[0] == "H"
B = lambda w: w[1] == "H"
C = lambda w: w[0] == w[1]
events = [A, B, C]
pairs = list(combinations(events, 2))
good = sum(
1 for X, Y in pairs
if P(lambda w, X=X, Y=Y: X(w) and Y(w)) == P(X) * P(Y)
)
print(f"independent pairs: {good} of {len(pairs)}")
triple = P(lambda w: A(w) and B(w) and C(w))
print("mutually independent:", triple == P(A) * P(B) * P(C))
Independent means: multiply the probabilities. Disjoint means: knowing one rules out the other completely. Those are opposite ideas — keep them straight.
Next: how to break a hard probability into easy cases and add them back up.