Bayes' Theorem Toy Problem: Spam-Flag Example
Context
You are evaluating a simple classifier that flags messages as spam. Based on historical data, you know the spam rate and the classifier’s performance (true positive and false positive rates). Compute the probability that a message is truly spam given it was flagged.
Assume:
-
Prior spam rate: 2% of all messages are spam.
-
If a message is spam, the classifier flags it 90% of the time.
-
If a message is not spam, the classifier still flags it 5% of the time (false positive).
Task
Walk through a complete Bayes-theorem calculation:
-
Clearly define the prior P(H) and likelihoods P(E|H), P(E|¬H).
-
Write the full formula.
-
Compute the posterior P(H|E) and report the final numeric answer.
Show every step, state assumptions, and simplify the final answer to a clear fraction and a one-decimal percentage.