Bayes' Theorem and Its Application to AI Reasoning — Beginner-Friendly Notes
1. The Theorem (one line + one formula)
- — prior: belief in hypothesis before evidence.
- — likelihood: how likely evidence is if hypothesis true.
- — posterior: belief after seeing evidence (what we want).
- — evidence normaliser: .
Intuition: Posterior ∝ Prior × Likelihood — evidence updates belief.
2. Derivation in One Step
From → rearrange.
3. Mini Example — Spam Filter (AI core use)
Want :
- Prior (20% mails are spam)
- Likelihood ,
- → classify as spam.
Same pattern for diagnosis, speech, vision — Bayes turns generative knowledge ( easy to model) into diagnostic knowledge ( needed).
4. Naive Bayes (most common AI application — preview Module 5)
Assume words independent given class: → then
— simple, surprisingly good for text.
5. AI Reasoning Uses
| Task | What Bayes gives | ||
|---|---|---|---|
| Diagnosis | disease | symptoms | |
| Spam | spam | words | |
| Robot localisation | position | sensor reading | |
| Speech | words spoken | audio |
6. Common Pitfall
$P(E|H)
eq P(H|E)$ — "90% of spam has 'offer'" does NOT mean "90% of 'offer' mails are spam" — base rate matters (see previous topic's 0.15 example).
7. One-Line Summary
Bayes' theorem inverts likelihood to posterior, letting AI update prior beliefs with evidence and powering classifiers, diagnosis and state estimation.
8. Quick Self-Check
- Compute posterior if , , $P(E|
eg H)=0.05$. - Why is computed by summing over hypotheses?