Foundations to Frontier
Tests
A. Mathematical Foundations › A4 Probability Theory › Basics

Conditional Probability and Independence

Conditioning is updating probabilities after learning something: restrict to the outcomes still possible and renormalize. Independence means that information doesn't change anything. This page covers the chain rule, the law of total probability, why P(A|B) ≠ P(B|A), why pairwise independence isn't enough, Simpson's paradox, and how common-cause failures destroy the benefit of redundant hardware.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Updating on new information

You roll two dice but can’t see them. The chance the total is at least 10 is 6 out of 36, or 1/6. Then a friend peeks and says “the first die is a 6”. Now only 6 outcomes are possible, and 3 of them (6+4, 6+5, 6+6) reach 10. The chance jumped to 3/6 = 1/2. That’s conditional probability: throw away the outcomes that can’t happen anymore, and recount.

Sometimes new information changes nothing. Learning that a coin landed heads tells you nothing about a separate coin. Those events are independent.

Conditional probability as area
Bnot BA
joint: P(A ∩ B) = 0.30 × 0.80 = 0.2400 (orange area)
total probability: P(A) = P(A|B)P(B) + P(A|not B)P(not B) = 0.3800
reverse: P(B | A) = P(A ∩ B)/P(A) = 0.6316 vs P(A | B) = 0.80
dependent: knowing B changes the chance of A (0.20 → 0.80)
Try P(B) = 0.01, P(A|B) = 0.99, P(A|not B) = 0.05, a rare condition with a good test. P(B | A) is still small. That's the base-rate effect, which Bayes' theorem (A4.1-3) makes precise.
Why engineers care

Spacecraft carry three of the same computer so one failure isn’t fatal. That only works if failures are independent. A shared power supply or a shared software bug makes all three fail together. Conditional probability is how engineers model this.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A bag has 3 red and 2 blue balls. P(draw red) = ?
  2. 2. Given the first die is 6, P(sum = 12) = ?
  3. 3. Two fair coins: P(both heads) = ?

Level 1: Beginner

★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.

Definitions

P(A∣B)=P(A∩B)P(B)(P(B)>0)P(A\mid B) = \frac{P(A\cap B)}{P(B)}\quad(P(B) > 0)
  • Chain (multiplication) rule: P(A∩B)=P(B) P(A∣B)P(A\cap B) = P(B)\,P(A\mid B). More generally, P(A1∩⋯∩An)=P(A1)P(A2∣A1)⋯P(An∣A1…An−1)P(A_1\cap\dots\cap A_n) = P(A_1)P(A_2\mid A_1)\cdots P(A_n\mid A_1\dots A_{n-1}).
  • Independence: P(A∩B)=P(A)P(B)P(A\cap B) = P(A)P(B), equivalently P(A∣B)=P(A)P(A\mid B) = P(A).

Examples:

  • Two aces in a row without replacement: 452⋅351=1221\frac4{52}\cdot\frac3{51} = \frac1{221}.
  • With two dice, “first die is 6” and “sum is 7” turn out to be independent: P=136=16⋅16P = \frac1{36} = \frac16\cdot\frac16.
  • “First die is 6” and “sum ≥ 10” are not independent.

Warning: P(A∣B)≠P(B∣A)P(A\mid B)\ne P(B\mid A) in general. P(fever | flu) is high. P(flu | fever) may be low. Confusing them is the “prosecutor’s fallacy”.

📝 Quick check (Level 1)
0/3 answered
  1. 1. P(B) = 0.4 and P(A | B) = 0.5. P(A ∩ B) = ?
  2. 2. Independent, P(A) = 0.3, P(B) = 0.6. P(A ∩ B) = ?
  3. 3. Is P(A | B) always equal to P(B | A)?

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Law of total probability

If B1,…,BkB_1,\dots,B_k partition Ω\Omega, then

P(A)=∑iP(A∣Bi)P(Bi)P(A) = \sum_iP(A\mid B_i)P(B_i)

Break a hard probability into cases. In the demo, P(A)=P(A∣B)P(B)+P(A∣Bc)P(Bc)P(A) = P(A\mid B)P(B) + P(A\mid B^c)P(B^c).

Independence of many events

A1,…,AnA_1,\dots,A_n are mutually independent if P(⋂i∈SAi)=∏i∈SP(Ai)P(\bigcap_{i\in S}A_i) = \prod_{i\in S}P(A_i) for every subset SS. Pairwise independence is weaker. Take two fair bits and their XOR: each pair is independent, but any two determine the third (Practice Code 4).

Conditional independence

AA and BB are independent given CC if P(A∩B∣C)=P(A∣C)P(B∣C)P(A\cap B\mid C) = P(A\mid C)P(B\mid C). Two smoke detectors are conditionally independent given “fire” or “no fire”. They’re not independent unconditionally: one alarming makes fire likelier, so the other is likelier to alarm too. Conditional independence is the basic assumption of Bayesian networks, hidden Markov models, Kalman filters and naïve Bayes.

Simpson’s paradox

A treatment can win in every subgroup and still lose overall. In a kidney-stone study, treatment A had higher success rates for both small and large stones, yet a lower overall rate. A was given mostly to the harder, large-stone cases (Charig et al., 1986; Practice Code 5). The overall rate mixes different P(group∣treatment)P(\text{group}\mid\text{treatment}). Which conditioning is right is a causal question, not a statistical one (Pearl, 2009).

🐍 Exercise 1: conditioning and independence on the dice space
Implement P(A | B) by restricting and renormalizing, and an independence test. Verify the surprising independence of 'first die 6' and 'sum 7', the asymmetry P(A | B) ≠ P(B | A), and the law of total probability.
📝 Quick check (Level 2)
0/3 answered
  1. 1. P(B) = 0.3, P(A|B) = 0.8, P(A|not B) = 0.2. P(A) = ?
  2. 2. Two bits and their XOR are…
  3. 3. Simpson's paradox is resolved by…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Proofs

  • Total probability. A=⨆i(A∩Bi)A = \bigsqcup_i(A\cap B_i), so P(A)=∑P(A∩Bi)=∑P(A∣Bi)P(Bi)P(A) = \sum P(A\cap B_i) = \sum P(A\mid B_i)P(B_i). ∎
  • Independence passes to complements. P(A∩Bc)=P(A)−P(A∩B)=P(A)−P(A)P(B)=P(A)P(Bc)P(A\cap B^c) = P(A) - P(A\cap B) = P(A) - P(A)P(B) = P(A)P(B^c). ∎
  • P(⋅∣B)P(\cdot\mid B) is a probability measure. It’s non-negative, P(Ω∣B)=1P(\Omega\mid B) = 1, and countably additive. So every theorem from A4.1-1 holds conditionally.

Independence is not disjointness

Disjoint events with positive probabilities are maximally dependent: if AA happens, BB can’t, so P(B∣A)=0≠P(B)P(B\mid A) = 0\ne P(B).

Why redundancy works, and when it doesn’t

A 2-of-3 voting system of independent units, each failing with probability pp, fails with probability 3p2(1−p)+p3≈3p23p^2(1-p) + p^3\approx3p^2. For p=10−2p = 10^{-2} that’s about 30× better than one unit. But suppose a fraction β\beta of failures is a common cause that takes out all units at once (the beta-factor model). Then failure is at least βp\beta p, and with β=0.1\beta = 0.1 this dominates (Exercise 2).

Exercise 3.1: If A and B are independent, are A and B^c independent?

Yes: P(A∩Bc)=P(A)−P(A)P(B)=P(A)(1−P(B))P(A\cap B^c) = P(A) - P(A)P(B) = P(A)(1 - P(B)).

📝 Quick check (Level 3)
0/3 answered
  1. 1. Disjoint events with positive probability are…
  2. 2. P(· | B) satisfies the probability axioms?
  3. 3. A 2-of-3 independent system with p = 0.01 fails with probability about…

Level 4: Expert

★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.

Redundancy and common-cause failures

Spacecraft and aircraft rely on redundancy: triple-redundant flight computers, dual-string avionics, voting IMUs. Probabilistic risk assessment explicitly models dependent failures, because shared power buses, environments, radiation and especially identical software can fail redundant units together. The β-factor and multiple-Greek-letter models are standard (Mosleh et al., NUREG/CR-5485; Stamatelatos et al., 2011). The 1996 Ariane 5 failure is the classic warning: both inertial reference systems ran the same software and failed identically (Lions, 1996).

🐍 Exercise 2 (research): redundancy vs common-cause failures
Compute the failure probability of a k-of-n redundant system with independent units and under a β-factor common-cause model, then verify by Monte Carlo. Find how small β must be for triple redundancy to pay off.

Conditional independence in AI and robotics

  • Markov property. A robot’s next state is independent of the past given the present state and action. That’s the assumption behind MDPs (A3.5-1), Kalman and particle filters, and SLAM’s factor graphs.
  • Sensor fusion. Combining several sensors by multiplying likelihoods assumes their noises are conditionally independent given the true state. Correlated errors, like two cameras sharing a lighting artifact, make fused estimates overconfident. Covariance intersection exists for unknown correlations (Julier and Uhlmann, 1997).
  • Graphical models encode conditional independences in a graph, so a huge joint distribution factorizes into small pieces (Koller and Friedman, 2009).
  • Fairness and causality. Simpson-style reversals appear in real ML audits. Causal graphs decide which conditional comparison answers the question (Pearl, 2009).

References

  1. D. Bertsekas, J. Tsitsiklis (2008). Introduction to Probability, 2nd ed., Ch. 1. Athena Scientific.
  2. C. R. Charig, D. R. Webb, S. R. Payne, J. E. Wickham (1986). “Comparison of treatment of renal calculi by open surgery, percutaneous nephrolithotomy, and extracorporeal shockwave lithotripsy.” BMJ, 292.
  3. J. Pearl (2009). Causality, 2nd ed. Cambridge.
  4. A. Mosleh et al. (1998). Guidelines on Modeling Common-Cause Failures in Probabilistic Risk Assessment. NUREG/CR-5485. US NRC.
  5. M. Stamatelatos et al. (2011). Probabilistic Risk Assessment Procedures Guide for NASA Managers and Practitioners. NASA/SP-2011-3421.
  6. J.-L. Lions et al. (1996). Ariane 5 Flight 501 Failure: Report by the Inquiry Board. ESA.
  7. S. Julier, J. Uhlmann (1997). “A non-divergent estimation algorithm in the presence of unknown correlations.” American Control Conference.
  8. D. Koller, N. Friedman (2009). Probabilistic Graphical Models. MIT Press.