Law of Total Probability
Statement
Let F1,F2,…,Fn be a partition of Ω: mutually exclusive events that cover all possibilities. For any event E:
P(E)=∑i=1nP(E∣Fi)⋅P(Fi)
Intuition
To find the probability of E, condition on which scenario Fi occurs and sum over all scenarios, weighting by the probability of each scenario.

Proof
E=E∩Ω=E∩⋃i=1nFi=⋃i=1n(E∩Fi)
Since Fi are disjoint, E∩Fi are also disjoint. By additivity:
P(E)=∑i=1nP(E∩Fi)=∑i=1nP(E∣Fi)P(Fi)
Example: Two Dice
Roll two dice. Let E = “sum is even”. Partition by first die being odd (F1) or even (F2).
- P(F1)=P(F2)=21
- P(E∣F1) = first die odd, sum even ⇒ second die odd: 21
- P(E∣F2) = first die even, sum even ⇒ second die even: 21
P(E)=P(E∣F1)P(F1)+P(E∣F2)P(F2)=21⋅21+21⋅21=21
Bayes’ Theorem
Statement
P(F∣E)=P(E)P(E∣F)⋅P(F)
Or, using the law of total probability for P(E):
P(F∣E)=∑iP(E∣Fi)⋅P(Fi)P(E∣F)⋅P(F)
Terminology
- Prior P(F): probability before observing evidence E
- Posterior P(F∣E): updated probability after observing evidence E
- Likelihood P(E∣F): how likely is the evidence under hypothesis F
- Marginal likelihood P(E): normalising constant

Proof
By definition of conditional probability:
P(F∣E)=P(E)P(F∩E)=P(E)P(E∩F)=P(E)P(E∣F)⋅P(F)
Example: Medical Diagnosis
A disease affects 1% of the population. A test has:
- 99% sensitivity: P(positive∣disease)=0.99
- 95% specificity: P(negative∣no disease)=0.95
What is P(disease∣positive)?
Let D = disease, T = positive test.
P(D∣T)=P(T∣D)P(D)+P(T∣Dc)P(Dc)P(T∣D)P(D)=0.99×0.01+0.05×0.990.99×0.01=0.05940.0099≈16.7%
Interpretation: Even with a positive test, there’s only a 17% chance of having the disease (for rare diseases, most positives are false positives).
Example: Monty Hall Problem
You’re on a game show with 3 doors. One hides a prize. You pick door 1. The host opens door 2, revealing no prize. Should you switch to door 3?
Let Fi = prize behind door i. Initially P(F1)=P(F2)=P(F3)=31.
Let E = host opens door 2.
Compute P(F1∣E) and P(F3∣E):
- If F1 (prize behind door 1), host randomly opens door 2 or 3: P(E∣F1)=21
- If F2 (prize behind door 2), host cannot open door 2: P(E∣F2)=0
- If F3 (prize behind door 3), host must open door 2: P(E∣F3)=1
P(F1∣E)=21×31+0+1×3121×31=61+3161=31
P(F3∣E)=211×31=32
Conclusion: Switch to door 3 for a 32 chance of winning.
Example: Quality Control
Two factories produce light bulbs. Factory A supplies 60% of the market with 2% defect rate. Factory B supplies 40% with 5% defect rate. A bulb is defective. What is the probability it came from A?
Let A = from factory A, B = from factory B, D = defective.
P(A∣D)=0.02×0.60+0.05×0.400.02×0.60=0.012+0.0200.012=0.0320.012=83
Sequential Bayesian Updating
As more evidence arrives, today’s posterior becomes tomorrow’s prior. This is the foundation of Bayesian inference.
Example: Disease Testing Repeat
If we get two independent positive tests:
P(D∣T1∩T2)∝P(T1∩T2∣D)P(D)=P(T1∣D)P(T2∣D)P(D)
Starting from prior P(D)=0.01, after one positive test the posterior is ≈0.167. This becomes the new prior for the second test.
Summary
| Concept | Formula |
|---|
| Total probability | P(E)=∑iP(E∣Fi)P(Fi) |
| Bayes’ theorem | P(F∣E)=P(E)P(E∣F)P(F) |
| Prior | P(F) before evidence |
| Posterior | P(F∣E) after evidence |
| Likelihood | P(E∣F) how likely evidence under hypothesis |