Bayes Theorem Calculator公式

## How to Apply Bayes' Theorem

### Formula

**P(A|B) = P(B|A) * P(A) / P(B)**

where P(B) = P(B|A)*P(A) + P(B|not A)*P(not A)

Bayes' theorem updates a prior belief P(A) after observing evidence B. The likelihood P(B|A) measures how probable the evidence is if A is true. The denominator P(B) normalizes the result.

计算示例

A disease affects 1% of the population. A test is 90% sensitive and has a 5% false positive rate. If someone tests positive, what is the probability they have the disease?

  1. P(A) = 0.01 (prior: disease prevalence)
  2. P(B|A) = 0.9 (sensitivity)
  3. P(B|not A) = 0.05 (false positive rate)
  4. P(B) = 0.9 * 0.01 + 0.05 * 0.99 = 0.009 + 0.0495 = 0.0585
  5. P(A|B) = (0.9 * 0.01) / 0.0585 = 0.009 / 0.0585 ≈ 0.1538
  6. Despite a positive test, there is only about a 15.4% chance of having the disease.