Probability a Flagged Email Is Actually Spam Under Low Base Rates
Last updated: November 29, 2026
Quick Overview
A spam filter catches 95% of spam and wrongly flags 2% of legitimate email. If 10% of a user's mail is spam, what is the probability a flagged email is spam? What happens for a business inbox where only 1% is spam?
0
0
0 solved
A spam filter catches 95% of spam and wrongly flags 2% of legitimate email. If 10% of a user's mail is spam, what is the probability a flagged email is spam? What happens for a business inbox where only 1% is spam?
Bayes' rule with base rates is a staple of Google data science phone screens, framed here around Gmail. The interviewer checks the calculation and, more importantly, whether you can explain why precision collapses at low prevalence.
What the Interviewer Expects
- Set up Bayes' rule with prior, sensitivity, and false positive rate
- Compute the posterior correctly for both base rates
- Explain the base-rate effect in plain language
- Connect to precision and the need for per-segment thresholds
Key Topics to Cover
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
- What false positive rate would be needed for 90% precision at 1% prevalence?
- How would you estimate the base rate per inbox?
- How does this connect to the precision-recall curve?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Statistics QuestionsSample Answer
Clarify
Let be spam and flagged. Given (recall), (false positive rate), and prior of 0.10 or 0.01. We want , which is the filter's precision for tha...
Approach
Apply Bayes: ....