This section introduces a simple example of Bayesian reasoning: the vampire problem. The example is adapted from Richard McElreath's book Statistical Rethinking, which uses intuitive examples to explain probability, inference and statistical modelling.
The problem considers a fictional blood test for detecting whether someone is a vampire. Although the example is deliberately playful, the reasoning is directly relevant to engineering, diagnostics and reliability assessment. A test can appear accurate and still give misleading conclusions when the event being tested for is rare.
The question is: if someone receives a positive test result, what is the probability that they are actually a vampire?
It may be tempting to answer close to 90%, because the test correctly identifies vampires most of the time. However, that ignores the base rate. Vampires are rare, so most positive test results may still come from mortals who received a false positive result.
Bayes' theorem allows us to calculate the probability of being a vampire given that the test result is positive:
P(vampire | positive) = P(positive | vampire)P(vampire) / P(positive)
The denominator, P(positive), is the overall probability of a positive test result. There are two ways to get a positive result:
Using the marginalisation rule:
P(positive) = P(positive | vampire)P(vampire) + P(positive | mortal)P(mortal)
Substituting the values:
P(positive) = 0.90 × 0.01 + 0.08 × 0.99 = 0.0882
Therefore:
P(vampire | positive) = 0.90 × 0.01 / 0.0882 = 0.102
So, after a positive test result, the probability that the person is actually a vampire is only about 10.2%.
The result is low because the positive-test group contains both true positives and false positives. The true-positive contribution is:
0.90 × 0.01 = 0.009
The false-positive contribution is:
0.08 × 0.99 = 0.0792
Even though the false-positive rate is only 8%, mortals are so common that they dominate the positive-test population. This is why P(positive | vampire) is not the same as P(vampire | positive).
The engineering lesson is that test accuracy alone is not enough. When looking for a rare event, such as an uncommon defect or a rare failure mode, the base rate matters. A moderately reliable test may still produce many false alarms if the event being tested for is very uncommon.
Stay up to date with our technology updates, events, special offers, news, publications and training
If you want to find out more about NAFEMS and how membership can benefit your organisation, please click below.
Joining NAFEMS© NAFEMS Ltd 2026
Developed By Duo Web Design