Conditional independence
A building has a smoke detector and a sprinkler system. Over the past year, the smoke detector and sprinklers activated on many of the same days. Are they dependent?
Dependence from a hidden cause
The smoke detector and sprinklers don't directly trigger each other. They both respond to a hidden common cause: fire.
- When there's a fire, both are likely to activate (independently of each other)
- When there's no fire, both are unlikely to activate (independently of each other)
Overall, they appear dependent. But within each "slice" — fire or no fire — they're independent.
Events A and B are conditionally independent given C if:
Equivalently: . Once you know C, learning B tells you nothing new about A.
See it in the numbers
Toggle between "Everyone," "Given Fire," and "Given No Fire." Watch how the independence test changes.
The frequency table tells the same story with counts instead of probabilities.
| B (sprinklers) | ¬B | Total | |
|---|---|---|---|
| A (smoke) | 37 | 56 | 93 |
| ¬A | 22 | 885 | 907 |
| Total | 59 | 941 | 1000 |
Independence does not imply conditional independence
This is where intuition breaks.
A student is admitted to a university if they have either high test scores (A) or strong extracurriculars (B). A and B are independent in the population. But among admitted students (given C = admitted), they become negatively dependent: if an admitted student has low test scores, they probably have strong extracurriculars. Learning A tells you about B.
Four possible combinations
| Marginally Independent | Marginally Dependent | |
|---|---|---|
| Cond. Independent given C | A and B ind.; also ind. given C | Smoke/sprinkler: dependent overall, ind. given fire |
| Cond. Dependent given C | Admission: ind. overall, dep. given admitted | A and B dep.; still dep. given C |
All four boxes are possible. Independence and conditional independence are logically separate properties.
Why it matters
Conditional independence shows up constantly:
- Naive Bayes classifiers assume features are conditionally independent given the class label
- Markov chains assume future is conditionally independent of the past given the present
- Bayesian networks encode which variables are conditionally independent of which
Getting conditional independence wrong leads to false confidence. A spam filter that assumes word occurrences are conditionally independent (given "spam" or "not spam") is wrong — "Nigerian" and "prince" are not conditionally independent in spam. But the approximation works surprisingly well.
Test your understanding
What's next
You now have the full toolkit: conditional probability, the multiplication rule, LOTP, Bayes' Rule, independence, and conditional independence.
Time to deploy all of it on one of the most famous probability puzzles ever posed. The Monty Hall problem divided PhD mathematicians — and the answer hinges on exactly the conditional reasoning you've just learned.