Introduction
Bayes’ Theorem helps us revise probabilities when new evidence is obtained. It is widely used in real-world applications such as medical diagnosis, machine learning, and decision-making where we need to determine the probability of an event after observing related data.
Pattern: Bayes’ Theorem
Pattern
Bayes’ Theorem updates the probability of an event A after observing event B.
Formula:
P(A | B) = [P(B | A) × P(A)] / [P(B | A)P(A) + P(B | A′)P(A′)]
Step-by-Step Example
Question
Two machines, M₁ and M₂, produce bulbs. M₁ produces 40% of the bulbs with a defect rate of 2%. M₂ produces 60% of the bulbs with a defect rate of 3%. If a bulb is defective, what is the probability it was made by M₁?
Solution
-
Step 1: Define the known probabilities
P(M₁) = 0.4, P(M₂) = 0.6
P(D|M₁) = 0.02, P(D|M₂) = 0.03 -
Step 2: Apply Bayes’ Theorem
P(M₁|D) = [P(D|M₁) × P(M₁)] / [P(D|M₁)P(M₁) + P(D|M₂)P(M₂)] -
Step 3: Substitute and simplify
= (0.02 × 0.4) / [(0.02 × 0.4) + (0.03 × 0.6)]
= 0.008 / (0.008 + 0.018) = 0.008 / 0.026 = 0.3077 -
Final Answer:
30.77% (≈ 0.31) -
Quick Check:
M₁ contributes 0.008 defective bulbs out of total defective rate 0.026 → 0.008/0.026 = 0.3077 ✅
Quick Variations
1. Medical Test: Given a positive test, find probability of actually having the disease.
2. Quality Control: Given a defective product, find which machine produced it.
3. Email Classification: Given that an email contains certain words, find probability it is spam.
Trick to Always Use
- Step 1: Identify all hypotheses (A, A′) with their priors.
- Step 2: Find P(B|A) and P(B|A′) - the likelihoods of evidence under each hypothesis.
- Step 3: Apply Bayes’ formula and divide the numerator by total evidence probability.
- Step 4: Convert decimal to percentage for easy interpretation.
Summary
Summary
In the Bayes’ Theorem pattern:
- It helps in finding reverse probabilities like P(A|B).
- Formula used: P(A|B) = [P(B|A) × P(A)] / [P(B|A)P(A) + P(B|A′)P(A′)].
- Always identify priors (P(A)), likelihoods (P(B|A)), and normalize using the total probability of B.
- Useful in cases where you want to update your belief after seeing new evidence.
- Quick Check: The probabilities in denominator should sum to the total probability of the evidence.
