Back to Engineering Data Analysis repository
Engineering Data Analysis2D

Conditional Probability - Theory & Concepts

Understanding how probabilities change when new information is available, including Bayes' Theorem and Independence.

Open the complete lesson

Engineering Data Analysis

Bayes' Theorem & Diagnostic Testing

Visualize conditional probability and Bayes' theorem using a probability tree. Adjust the prior probability and test accuracy to see how they impact the posterior probability.

5.0%

Probability of a random component being defective.

90.0%

Sensitivity: Test is positive when defect is present.

10.0%

False Alarm: Test is positive when NO defect is present.

Probability Tree Diagram

P(D)P(D) = 5.0%
P(G)P(G) = 95.0%
P(TD)P(T|D) = 90.0%
P(TD)P(\sim T|D) = 10.0%
P(TG)P(T|G) = 10.0%
P(TG)P(\sim T|G) = 90.0%
Start
Defective (D)
Good (G)
Positive (T)
=4.50%
Negative (~T)
=0.50%
Positive (T)
=9.50%
Negative (~T)
=85.50%

Total Positives P(T)P(T)

14.00%

Sum of True Positives and False Positives

Posterior P(DT)P(D|T)

32.1%

Prob. it is defective GIVEN a positive test

Bayes' Theorem Calculation

P(DT)=P(TD)P(D)P(TD)P(D)+P(TG)P(G)P(D|T) = \frac{P(T|D) \cdot P(D)}{P(T|D) \cdot P(D) + P(T|G) \cdot P(G)}
P(DT)=0.900.0500.900.050+0.100.950P(D|T) = \frac{0.90 \cdot 0.050}{0.90 \cdot 0.050 + 0.10 \cdot 0.950}
P(DT)32.1%P(D|T) \approx 32.1\%