Raised Fist0

Bayes’ Theorem

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong

Introduction

Bayes’ Theorem என்பது, புதிய evidence கிடைக்கும் போது probability மதிப்புகளை revise செய்ய உதவுகிறது. இது medical diagnosis, machine learning, மற்றும் decision-making போன்ற நிஜ வாழ்க்கை பயன்பாடுகளில் பரவலாக பயன்படுத்தப்படுகிறது. தொடர்புடைய data ஐ கவனித்த பின், ஒரு நிகழ்வு நடைபெறும் வாய்ப்பை கண்டறிய இது மிகவும் உதவியாக இருக்கும்.

Pattern: Bayes’ Theorem

Pattern: Bayes’ Theorem

Bayes’ Theorem, நிகழ்வு B நடந்ததை கவனித்த பின், நிகழ்வு A இன் probability ஐ update செய்கிறது.

Formula:
P(A | B) = [P(B | A) × P(A)] / [P(B | A)P(A) + P(B | A′)P(A′)]

Step-by-Step Example

Question

இரண்டு machines, M₁ மற்றும் M₂, bulbs தயாரிக்கின்றன. M₁, bulbs இல் 40% உற்பத்தி செய்து, 2% defect rate கொண்டுள்ளது. M₂, bulbs இல் 60% உற்பத்தி செய்து, 3% defect rate கொண்டுள்ளது. ஒரு bulb defective எனில், அது M₁ மூலம் தயாரிக்கப்பட்டிருக்கும் probability என்ன?

Solution

  1. Step 1: அறியப்பட்ட probability களை வரையறுத்தல்

    P(M₁) = 0.4, P(M₂) = 0.6
    P(D|M₁) = 0.02, P(D|M₂) = 0.03
  2. Step 2: Bayes’ Theorem பயன்படுத்துதல்

    P(M₁|D) = [P(D|M₁) × P(M₁)] / [P(D|M₁)P(M₁) + P(D|M₂)P(M₂)]
  3. Step 3: Substitute செய்து 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
  4. Final Answer:

    30.77% (≈ 0.31)
  5. Quick Check:

    M₁, மொத்த defective rate 0.026 இல் 0.008 bulbs அளவிற்கு பங்களிக்கிறது → 0.008/0.026 = 0.3077 ✅

Quick Variations

1. Medical Test: positive test கிடைத்த நிலையில், உண்மையில் disease இருப்பதற்கான probability ஐ கண்டறிதல்.

2. Quality Control: defective product கிடைத்த நிலையில், அது எந்த machine மூலம் தயாரிக்கப்பட்டது என்பதை கண்டறிதல்.

3. Email Classification: ஒரு email சில குறிப்பிட்ட words கொண்டுள்ளது என்ற நிலையில், அது spam ஆக இருப்பதற்கான probability ஐ கண்டறிதல்.

Trick to Always Use

  • Step 1: எல்லா hypotheses (A, A′) மற்றும் அவற்றின் priors ஐ கண்டறியுங்கள்.
  • Step 2: P(B|A) மற்றும் P(B|A′) - ஒவ்வொரு hypothesis கீழும் evidence இன் likelihood ஐ கணக்கிடுங்கள்.
  • Step 3: Bayes’ formula பயன்படுத்தி, numerator ஐ மொத்த evidence probability மூலம் வகுக்கவும்.
  • Step 4: எளிதாக புரிந்து கொள்ள decimal ஐ percentage ஆக மாற்றுங்கள்.

Summary

Bayes’ Theorem pattern இல்:

  • P(A|B) போன்ற reverse probabilities ஐ கண்டறிய உதவுகிறது.
  • பயன்படுத்தப்படும் formula: P(A|B) = [P(B|A) × P(A)] / [P(B|A)P(A) + P(B|A′)P(A′)].
  • Priors (P(A)), likelihoods (P(B|A)) ஆகியவற்றை கண்டறிந்து, B இன் மொத்த probability கொண்டு normalize செய்ய வேண்டும்.
  • புதிய evidence கிடைத்த பின், உங்கள் belief ஐ update செய்ய வேண்டிய சூழல்களில் மிகவும் பயனுள்ளது.
  • Quick Check: denominator இல் உள்ள probability களின் கூட்டுத்தொகை, evidence இன் மொத்த probability ஆக இருக்க வேண்டும்.

Practice

(1/5)
1. Box A contains 3 red and 2 blue balls. Box B contains 1 red and 4 blue balls. A box is chosen at random and one ball drawn; it is red. What is the probability the ball came from Box A?
easy
A. 3/4
B. 1/4
C. 1/2
D. 2/3

Solution

  1. Step 1: Write priors and likelihoods

    P(A)=1/2, P(B)=1/2. P(red|A)=3/5, P(red|B)=1/5.
  2. Step 2: Apply Bayes' rule

    P(A|red) = [P(red|A)P(A)] / [P(red|A)P(A) + P(red|B)P(B)].
  3. Step 3: Substitute

    =(3/5×1/2) / [(3/5×1/2) + (1/5×1/2)] = (3/10) / (4/10) = 3/4.
  4. Final Answer:

    3/4 → Option A.
  5. Quick Check:

    Box A is more likely to produce red (3/5 vs 1/5), so posterior > 1/2 → 3/4 ✅
Hint: Posterior ∝ prior × likelihood; normalize across boxes.
Common Mistakes: Forgetting to weight by the prior probability of choosing each box.
2. A disease has prevalence 1%. A test has 99% sensitivity (P(+|disease)=0.99) and 5% false positive rate (P(+|no disease)=0.05). If a randomly chosen person tests positive, what is the probability they actually have the disease?
easy
A. 1/20
B. 1/6
C. 1/10
D. 1/4

Solution

  1. Step 1: Write priors and likelihoods

    P(D)=0.01, P(not D)=0.99. P(+|D)=0.99, P(+|not D)=0.05.
  2. Step 2: Bayes' formula

    P(D|+) = P(+|D)P(D) / [P(+|D)P(D) + P(+|not D)P(not D)].
  3. Step 3: Substitute and compute

    = (0.99×0.01) / (0.99×0.01 + 0.05×0.99) = 0.0099 / (0.0099 + 0.0495) = 0.0099 / 0.0594 = 1/6 (≈0.1667).
  4. Final Answer:

    1/6 → Option B.
  5. Quick Check:

    Low prevalence makes false positives dominate despite high sensitivity → posterior ~16.7% ✅
Hint: Compute numerator = sensitivity×prevalence; denominator = numerator + falsePositiveRate×(1-prevalence).
Common Mistakes: Ignoring prevalence and treating sensitivity as posterior directly.
3. Machine M1 produces 40% of items with 2% defective rate; M2 produces 60% with 3% defective rate. A randomly chosen item is defective. What is the probability it came from M1?
easy
A. 0.5
B. 0.25
C. 0.3077
D. 0.6923

Solution

  1. Step 1: Write priors and likelihoods

    P(M1)=0.40, P(M2)=0.60. P(D|M1)=0.02, P(D|M2)=0.03.
  2. Step 2: Bayes' formula

    P(M1|D) = P(D|M1)P(M1) / [P(D|M1)P(M1) + P(D|M2)P(M2)].
  3. Step 3: Substitute

    =(0.02×0.40) / (0.02×0.40 + 0.03×0.60) = 0.008 / (0.008 + 0.018) = 0.008 / 0.026 = 0.3077.
  4. Final Answer:

    0.3077 → Option C.
  5. Quick Check:

    M1 contributes 0.008 of defects vs total 0.026 → 0.008/0.026 ≈ 30.77% ✅
Hint: Posterior = (likelihood×prior) / sum(likelihood×prior) across sources.
Common Mistakes: Using raw defect rates without weighting by production share.
4. Urn U1 has 2 white and 3 black balls; urn U2 has 4 white and 1 black. An urn is chosen with P(U1)=1/3 and P(U2)=2/3. A drawn ball is white. What is the probability it came from U1?
medium
A. 1/5
B. 2/5
C. 3/5
D. 4/5

Solution

  1. Step 1: Priors and likelihoods

    P(U1)=1/3, P(U2)=2/3. P(white|U1)=2/5, P(white|U2)=4/5.
  2. Step 2: Bayes' rule

    P(U1|white) = [P(white|U1)P(U1)] / [P(white|U1)P(U1) + P(white|U2)P(U2)].
  3. Step 3: Compute

    =(2/5×1/3) / [(2/5×1/3) + (4/5×2/3)] = (2/15) / (2/15 + 8/15) = (2/15) / (10/15) = 1/5.
  4. Final Answer:

    1/5 → Option A.
  5. Quick Check:

    U2 is more likely a priori and also likelier to give white, so posterior for U1 is small → 1/5 ✅
Hint: Compute contributions to evidence from each urn, then take ratio for the target urn.
Common Mistakes: Failing to multiply likelihood by the correct prior for each urn.
5. Three machines M1, M2, M3 produce 20%, 30%, 50% of items with defect rates 1%, 2%, 4% respectively. If an item is defective, what is the probability it came from M3?
medium
A. 1/3
B. 5/14
C. 2/7
D. 5/7

Solution

  1. Step 1: Compute contributions

    Numerators: M1 → 0.01×0.20=0.002; M2 → 0.02×0.30=0.006; M3 → 0.04×0.50=0.020.
  2. Step 2: Total defective probability

    Sum = 0.002 + 0.006 + 0.020 = 0.028.
  3. Step 3: Bayes' posterior for M3

    P(M3|defect) = 0.020 / 0.028 = 20/28 = 5/7 ≈ 0.7143.
  4. Final Answer:

    5/7 → Option D.
  5. Quick Check:

    M3 contributes the largest share of defects (0.02 of 0.028) → ~71.43% ✅
Hint: For multiple sources, compute likelihood×prior for each, then normalize by their sum.
Common Mistakes: Neglecting any machine's contribution when calculating the total defective probability.