StatisticsBayes' Theorem

Bayes' theorem: P(condition | positive) with 4% prevalence, 98% sensitivity, 97% specificity

Homework Question

A manufacturing defect affects 4%4\% of a population. A test detects it 98%98\% of the time when present (sensitivity) and correctly gives a negative 97%97\% of the time when absent (specificity). If a randomly chosen case tests positive, what is the probability it truly has a manufacturing defect?

Verified Final Answer
P(D∣+)≈0.5765P(D \mid +) \approx 0.5765 (about 57.6%57.6\%)

Key Formula & Principle

P(D∣+)=P(+∣D)P(D)P(+∣D)P(D)+P(+∣Dc)P(Dc)P(D \mid +) = \frac{P(+ \mid D)P(D)}{P(+ \mid D)P(D) + P(+ \mid D^c)P(D^c)}

Step-by-Step Solution

  1. 1
    Given: P(D)=0.04P(D) = 0.04, P(+∣D)=0.98P(+ \mid D) = 0.98, P(+∣Dc)=1−0.97=0.03P(+ \mid D^c) = 1 - 0.97 = 0.03.
  2. 2
    Total probability of a positive: P(+)=(0.98)(0.04)+(0.03)(0.96)=0.0680P(+) = (0.98)(0.04) + (0.03)(0.96) = 0.0680.
  3. 3
    Bayes: P(D∣+)=(0.98)(0.04)0.0680=0.03920.0680≈0.5765P(D \mid +) = \frac{(0.98)(0.04)}{0.0680} = \frac{0.0392}{0.0680} \approx 0.5765.
  4. 4
    Even with an accurate test, a low base rate means many positives are false positives.
Interactive Homework Customizer

Have this WebAssign / Canvas problem with different numbers?

Replace the numbers or functions below to match your exact assignment version, then generate a custom step-by-step derivation.

View all Statistics →