Unit 4: Probability, Random Variables & Probability Distributions
Conditional Probability
Applying probability rules, including conditional probability, to compound events.
Why a Positive Test Result Isn't as Certain as It Feels
A medical test correctly flags 45 of the 50 people who truly have a rare disease, and incorrectly flags only 19 of the 950 healthy people, out of 1000 people tested. Before reading on: given a positive test result, what's your gut estimate for the chance that person actually has the disease?
Definition — Conditional Probability
| Test Positive | Test Negative | Total | |
|---|---|---|---|
| Has Disease | 45 | 5 | 50 |
| No Disease | 19 | 931 | 950 |
| Total | 64 | 936 | 1000 |
Worked Example — Computing a Conditional Probability from a Two-Way Table
Worked Example — Checking Independence
Probability Simulator
Experiment
Run a trial to see the outcome here.
Simulation
Histogram — experimental vs theoretical
Running probability — Law of Large Numbers
Statistics
Mean
— experimental
3.5 theoretical
Variance
— experimental
2.917 theoretical
Standard deviation
— experimental
1.708 theoretical
Trials
0 experimental
— theoretical
Frequency table
| Outcome | Count | Experimental | Theoretical |
|---|---|---|---|
| 1 | 0 | — | 0.167 |
| 2 | 0 | — | 0.167 |
| 3 | 0 | — | 0.167 |
| 4 | 0 | — | 0.167 |
| 5 | 0 | — | 0.167 |
| 6 | 0 | — | 0.167 |
Central Limit Theorem
Draws 300 independent samples of 5trials each from the current experiment, averages each sample, and histograms the resulting sample means — the distribution should look progressively more bell-shaped (normal) as the sample size grows, even though the experiment’s own distribution usually isn’t.
Tip
Common Mistakes
Confusing P(positive | disease) — the test's accuracy on people who have the disease — with P(disease | positive) — the actual chance a positive result reflects the disease.
These are different conditional probabilities, computed in opposite directions, and the worked example shows they can differ substantially (90% vs. 70.3%) — always check which event is being conditioned on which.
Key Takeaways
- P(A|B) restricts attention to only the outcomes where B occurred, then asks what fraction of those also satisfy A.
- P(A|B) and P(B|A) are generally different quantities — order matters in conditional probability.
- Independence means P(A|B) = P(A): learning B occurred doesn't change A's probability at all.
Summary
Conditional probability reasons about specific events. The next lesson builds a fuller mathematical object — a random variable — that assigns probabilities to every possible numerical outcome at once.
Sign in to track your progress and mark this lesson complete.
Track your progress