skipnothing/Math for Machine Learning

Joint & Conditional Probability

Your spam filter flags an email holding `free money` and calls it almost certainly spam. Ask the mirror question, how often spam even contains `free money`, and that number comes back small: the same evidence reads two different ways.

  • The same email, the same phrase: swap which number you divide by and the answer swings from near-certain to unlikely.
  • A test that's 90% accurate can still be wrong most times it fires, when the thing it hunts is rare.
  • Assuming two events don't interact turned 1 in 8500 into 1 in 73 million in court, jailing an innocent woman.
01

Restrict the Universe

A spam filter sorts a morning's 1,000 emails. 400 are spam, so before you look at anything else, a random one is spam 40% of the time. Now filter down to just the emails containing the phrase free money, maybe 120 of them. Inside that smaller pile, 108 are spam. The chance jumped to 90%.

Nothing about any single email changed. What changed is the pile you are dividing by. The first 40% divided the spam count by all 1,000 emails; the second 90% divided a spam count by only the 120 that contain the phrase. Shrink the world you are standing in, and the same event carries a new probability.

That is the whole move behind everything here: pick a smaller population, count inside it, divide by its size. The number you get answers a sharper question, not "how common is spam?" but "how common is spam among emails that say free money?"

SHRINK THE PILE, WATCH THE FRACTION

Keep going, sign up to unlock the rest

4 more parts in this topic, plus 19+ more topics in Math for Machine Learning.

Sign up, it's freeSee the full Math for Machine Learning
Probability0/4#16 Covariance & Correlation Matrices
#18 Bayes' Theorem