If causes A1,…,An are mutually exclusive and exhaustive (a partition of the sample space), then any evidence B can only happen through one of them:
P(B)=∑i=1nP(B∣Ai)P(Ai).
A disease affects 1% of a population. A test is 99% sensitive (P(+∣D)=0.99) and 95% specific (P(−∣Dˉ)=0.95, so P(+∣Dˉ)=0.05). You test positive. What is P(D∣+)?
Step 1 — list priors and likelihoods.P(D)=0.01,P(Dˉ)=0.99,P(+∣D)=0.99,P(+∣Dˉ)=0.05.Why? We separate what we believe before (prior) from how the test behaves (likelihood).
Step 2 — total probability of a positive.P(+)=(0.99)(0.01)+(0.05)(0.99)=0.0099+0.0495=0.0594.Why? A positive can come from a true sick person OR a healthy false positive.
Step 3 — apply Bayes.P(D∣+)=0.05940.0099≈0.1667=16.7%.Why the surprise? Because the disease is rare, the huge healthy group produces many false positives that swamp the few true positives.
Step 2 — evidence:P(D)=(0.02)(0.6)+(0.05)(0.4)=0.012+0.020=0.032.Why? Sum over both factories (they partition all bulbs).
Step 3 — posteriors:P(X∣D)=0.0320.012=0.375,P(Y∣D)=0.0320.020=0.625.Why? Even though X makes more bulbs, Y's higher defect rate makes it the more likely source of a defective one.
Imagine a box that flashes "DANGER!" whenever a monster is near — and it's really good, flashing 99 out of 100 times a monster comes. But monsters are super rare. So most of the time it flashes, it's actually a squirrel that tricked it. Before you panic, you must think: "How many monsters are there in the first place?" Bayes' theorem mixes how good the alarm is with how rare monsters really are to tell you the true chance. New clue → update your guess.
Bayes' theorem ka core idea simple hai: conditional probability ko ulta karna. Bahut baar humein pata hota hai P(evidence∣cause) — jaise test positive aane ka chance jab bimari hai. Par patient ko chahiye P(cause∣evidence) — positive aaya, ab sach mein bimari hai kya? Ye dono barabar nahi hote, aur Bayes theorem in dono ke beech ka pul hai.
Formula banta hai bahut seedhe se: P(A∩B) ko dono taraf se likho, phir barabar karke divide karo. Result: posterior = (likelihood × prior) ÷ evidence. Yaad rakhne ke liye "PLE over E" bol lo. Denominator P(B) ko hum saare causes pe sum karke nikalte hain — isko Law of Total Probability kehte hain.
Sabse bada lesson base rate ka hai. Ek 99% accurate test bhi galat lag sakta hai agar bimari rare hai. Kyunki healthy log itne zyada hain ki unke false positives, real sick logon ke true positives ko dabaa dete hain. Isliye Example 1 mein answer sirf 16.7% aata hai — chaunkane wala, par sahi. Jab prevalence 30% kar do, wahi test 89.5% trustworthy ho jaata hai. Matlab prior aur evidence dono important hain.
Exam tip: kabhi bhi P(A∣B) aur P(B∣A) ko mat mix karo (prosecutor's fallacy), aur P(B) nikalte waqt saare causes include karo warna posterior sum 1 nahi hoga. Bas prior, likelihood, evidence — teeno neatly likh lo, aur answer khud aa jaata hai.