All courses › Statistics and Risk Analysis › Bayes' theorem

Bayes' theorem

Bayes' theorem flips a conditional probability: from P(B∣A)P(B|A) you find P(A∣B)P(A|B). It is widely used in testing, where you know the probability of a positive result given disease, but want the probability of disease given a positive result.

P(A∣B)=P(B∣A) P(A)P(B)P(A|B) = \frac{P(B|A)\,P(A)}{P(B)}Bayes' theorem

Symbols

P(A)P(A)probability of AA before knowing about BB
P(A∣B)P(A|B)probability of AA given that BB has occurred

Example

6% defect rate, the test finds the defect 99% of the time and false-positives 10% of the time on good units.

P(defect∣positive)=0.99⋅0.060.99⋅0.06+0.1⋅0.94≈0.387P(\text{defect}|\text{positive}) = \dfrac{0.99\cdot 0.06}{0.99\cdot 0.06 + 0.1\cdot 0.94} \approx 0.387.

Always compute the denominator P(B)P(B) by summing over all the ways BB can happen (positive test, sick or healthy).
Practise probability for free →

← Series and parallel systems · Independence and combinatorics →

Part of Statistics and Risk Analysis: Probability.