Last modified: September 16, 2024

This article is written in: 🇺🇸

Bayes' Theorem

Bayes' theorem provides a way to update our probability estimates for an event based on new evidence. It connects the conditional and marginal probabilities of events, allowing us to revise our predictions or hypotheses in light of additional information. The theorem is stated mathematically as:

$$ P(A|B) = \frac{P(B|A) \times P(A)}{P(B)} $$

where:

Let's say $P(A)=0.3$ and $P(B)=0.4$ then:

a10438be-8900-4dab-92ce-9c9fcb89875b

Example: Medical Diagnosis

Consider a medical test that is designed to diagnose a certain disease. The characteristics of the test are:

9f1ea5e9-cad4-4fc2-a6aa-5fee4f309a2d

Let A be the event "person has the disease" and B be the event "person tests positive". Applying Bayes' theorem:

$$ P(A|B) = \frac{P(B|A) \times P(A)}{P(B)} $$

First, we calculate the total probability of a positive test (P(B)), which includes both true and false positives:

$$ P(B) = P(B|A) \times P(A) + P(B|\text{not } A) \times P(\text{not } A) $$

Plugging in the given rates:

3a2138ad-9dbb-4b0c-9b5e-8bbaab5d4e70

The total probability of a positive test result is then:

$$ P(B) = (0.95 \times 0.02) + (0.05 \times 0.98) $$

Applying these values to Bayes' theorem gives us:

$$ P(A|B) = \frac{0.95 \times 0.02}{(0.95 \times 0.02) + (0.05 \times 0.98)} \approx 0.2794 $$

Therefore, if a person tests positive, there is approximately a 27.94% chance that they actually have the disease.

Example: BSE "Mad Cow" Disease Test

We are given a scenario where we need to determine the probability that a cow actually has BSE (Bovine Spongiform Encephalopathy), given that it has tested positive for the disease.

Given Quantities:

bcde4473-8acf-4dd8-a60e-c4a7b551f02d

Complementary Probability:

To find the conditional probability $P(B | T)$, we use Bayes' Theorem:

$$ P(B | T) = \frac{P(T | B) \cdot P(B)}{P(T)} $$

The denominator, $P(T)$, is the total probability of a positive test result, which includes both true positives and false positives. This is obtained using the law of total probability:

$$ P(T) = P(T | B) \cdot P(B) + P(T | B^c) \cdot P(B^c) $$

0663c27b-403f-4b28-8a3d-8999625f2bdd

With the provided values:

We calculate $P(B | T)$:

$$ P(B | T) = \frac{0.70 \cdot 0.02}{0.70 \cdot 0.02 + 0.10 \cdot 0.98} \approx 0.125 $$

Thus, if a cow tests positive for BSE, there is a 12.5% chance that the cow actually has the disease.

Table of Contents

    Bayes' Theorem
    1. Example: Medical Diagnosis
    2. Example: BSE "Mad Cow" Disease Test