# Bayes' theorem

Bayes' theorem turns P(B given A) into P(A given B): P(A given B) = P(B given A) x P(A) / P(B). It updates a belief after seeing evidence, using the base rate.

Statistics (university) · Part 02: Probability · Card 7 of 8 · Last updated 2026-10-19

## Analogy

A smoke alarm rings. Before you panic, you weigh the alarm against how rarely your kitchen actually catches fire.

## Example

**Rare disease test**

1% have the disease
Test catches 90% of them
False alarm for 5% of healthy people
P(positive) = 0.009 + 0.0495 = 0.0585
P(disease given positive) = 0.009 / 0.0585 = 0.154

## In practice

It shows why a positive result on a test for a rare disease is often a false alarm.

## Practice

### Flashcards

- **State Bayes' theorem.** P(A given B) = P(B given A) x P(A) / P(B).

### Interview questions

**Explain, with numbers, why a positive result from a good test for a rare disease may still probably be a false alarm.**

- Base rate is low
- Healthy people far outnumber sick people
- False positives from the many exceed true positives from the few
- Apply Bayes' theorem

## Questions people ask

### Why is a positive test often wrong for rare diseases?

Because healthy people vastly outnumber sick ones. In the example, 5 percent of 99 percent healthy people give 4.95 percent false alarms, far more than the 0.9 percent true positives. So only about 15 percent of positives are truly ill.

### What is a base rate and why does it matter?

The base rate is how common something is before any evidence. Ignoring it is called base rate neglect. A highly accurate test still produces mostly false alarms when the condition is rare, because the pool of healthy people is so large.

## Related concepts

- [Conditional probability](https://studyvisually.com/learn/science/statistics-university/statistics-university-part-2/statistics-university-part-2-concept-5)
- [Law of total probability](https://studyvisually.com/learn/science/statistics-university/statistics-university-part-2/statistics-university-part-2-concept-6)

Web page: https://studyvisually.com/learn/science/statistics-university/statistics-university-part-2/statistics-university-part-2-concept-7
Study this card in the app: https://studyvisually.com/app/learn?category=statistics-university&card=statistics-university-part-2-concept-7
