A test is 95% accurate — what is probability of actually being positive (Bayes)

hard CBSE JEE-MAIN 4 min read

Question

A disease affects 1% of the population. A test for the disease is 95% accurate — meaning it correctly identifies 95% of diseased people (sensitivity = 95%) and 95% of healthy people (specificity = 95%). If a randomly chosen person tests positive, what is the probability they actually have the disease?

Solution — Step by Step

Let:

  • DD = event that the person has the disease
  • DcD^c = event that the person does NOT have the disease
  • T+T^+ = event that the test is positive

Given:

  • P(D)=0.01P(D) = 0.01 (1% prevalence)
  • P(Dc)=0.99P(D^c) = 0.99
  • P(T+D)=0.95P(T^+ | D) = 0.95 (test positive given disease — sensitivity)
  • P(T+Dc)=0.05P(T^+ | D^c) = 0.05 (test positive given no disease — false positive rate = 1 - specificity)

We want P(DT+)P(D | T^+) — the probability of having the disease given a positive test.

Bayes’ Theorem states:

P(DT+)=P(T+D)P(D)P(T+)P(D | T^+) = \frac{P(T^+ | D) \cdot P(D)}{P(T^+)}

We need to calculate P(T+)P(T^+) using the law of total probability.

P(T+)=P(T+D)P(D)+P(T+Dc)P(Dc)P(T^+) = P(T^+ | D) \cdot P(D) + P(T^+ | D^c) \cdot P(D^c) P(T+)=(0.95)(0.01)+(0.05)(0.99)P(T^+) = (0.95)(0.01) + (0.05)(0.99) P(T+)=0.0095+0.0495=0.059P(T^+) = 0.0095 + 0.0495 = 0.059 P(DT+)=P(T+D)P(D)P(T+)=0.95×0.010.059P(D | T^+) = \frac{P(T^+ | D) \cdot P(D)}{P(T^+)} = \frac{0.95 \times 0.01}{0.059} P(DT+)=0.00950.0590.161P(D | T^+) = \frac{0.0095}{0.059} \approx 0.161

The probability of actually having the disease given a positive test is approximately 16.1%.

Why This Works

This result shocks most people — a 95% accurate test gives only a 16% chance of being positive? The key is base rate (prevalence). When a disease is rare (only 1% have it), even a small false-positive rate creates many more false positives than true positives.

Consider 10,000 people:

  • 100 have the disease → 95 test positive (true positives), 5 test negative (false negatives)
  • 9,900 don’t have the disease → 495 test positive (false positives), 9,405 test negative

Out of 95+495=59095 + 495 = 590 positive tests, only 95 are true positives:

P(DT+)=9559016.1%P(D | T^+) = \frac{95}{590} \approx 16.1\%

This is why mass screening for rare diseases with even highly accurate tests generates many false alarms. It’s not a flaw in the test — it’s a mathematical reality of low prevalence.

Alternative Method

The natural frequency method (counting approach) is often clearer for intuition:

Imagine 10,000 people. 100 have disease, 9,900 don’t.

  • True positives: 100×0.95=95100 \times 0.95 = 95
  • False positives: 9,900×0.05=4959,900 \times 0.05 = 495
  • Total positives: 95+495=59095 + 495 = 590
  • Probability truly positive: 95/59016.1%95/590 \approx 16.1\%

This gives the same answer as Bayes’ theorem but is more intuitive. For exam write-ups, use the Bayes formula approach — for personal understanding, the frequency approach is clearer.

Bayes’ theorem problems appear regularly in JEE Main and Class 12 CBSE probability chapter (typically 4-6 marks). The standard structure is always: identify P(D)P(D), P(T+D)P(T^+|D), P(T+Dc)P(T^+|D^c), compute P(T+)P(T^+) via total probability, then apply Bayes’. Organize the information into a table or tree diagram before writing equations. This prevents errors in identifying which conditional is which.

Common Mistake

The most frequent error is confusing P(T+D)P(T^+ | D) (sensitivity) with P(DT+)P(D | T^+) (positive predictive value). These look similar but are completely different. The question asks for P(DT+)P(D | T^+), not P(T+D)P(T^+ | D). Many students read “the test is 95% accurate” and immediately write the answer as 95% — this ignores the base rate entirely. Bayes’ theorem exists precisely to correctly “flip” conditional probabilities. Also watch for: forgetting to include the false positive term in P(T+)P(T^+), which would give P(DT+)=95/95=100%P(D|T^+) = 95/95 = 100\% — clearly wrong.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next