Skip to main content
Daily Math Minute

Unit 4: Probability, Random Variables & Probability Distributions

Conditional Probability

Applying probability rules, including conditional probability, to compound events.

Advanced25 min lesson3 min readUpdated August 12, 2026Author not yet attributed

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

P(A|B) = P(A and B)/P(B) — the probability of A, given that B has already happened, restricts attention to only the outcomes where B occurred. Two events are independent exactly when P(A|B) = P(A) — knowing B happened doesn't change A's probability at all.
P(AB)=P(A and B)P(B)P(A \mid B) = \frac{P(A \text{ and } B)}{P(B)}
Test PositiveTest NegativeTotal
Has Disease45550
No Disease19931950
Total649361000
1000 people tested for a rare disease.

Worked Example — Computing a Conditional Probability from a Two-Way Table

P(has disease | positive test) = P(disease and positive)/P(positive) = (45/1000)/(64/1000) = 45/64 ≈ 0.703, or about 70.3%. Even with a test that correctly flags 90% of actual cases (45/50), a positive result only means about a 70% chance of truly having the disease — because the disease is rare (5% of the population), most positive results still come from the much larger group of healthy people, a small fraction of whom are false positives.

Worked Example — Checking Independence

Is testing positive independent of having the disease? P(positive) = 64/1000 = 0.064. P(positive | disease) = 45/50 = 0.9. Since 0.9 ≠ 0.064, the events are strongly dependent — exactly what a useful medical test should show: knowing someone has the disease dramatically changes the probability their test is positive.

Probability Simulator

Experiment

Run a trial to see the outcome here.

Simulation
0 / 200 trials

Histogram — experimental vs theoretical

Running probability — Law of Large Numbers

x = 100, y = 0.1667
Statistics

Mean

experimental

3.5 theoretical

Variance

experimental

2.917 theoretical

Standard deviation

experimental

1.708 theoretical

Trials

0 experimental

theoretical

Frequency table

OutcomeCountExperimentalTheoretical
100.167
200.167
300.167
400.167
500.167
600.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

When a conditional probability feels surprising, check whether the event being conditioned on (here, having the rare disease) is itself rare — a low base rate is almost always the reason a seemingly accurate test still produces many false positives relative to true positives.

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.