Probability
The medical test · simulation, Bayes, Monty Hall, spam
In this chapter, you will learn to
- Estimate a probability by simulating thousands of draws
- Update a belief with new evidence (Bayes)
- Avoid the classic traps of probabilistic reasoning
6 exercises
Each exercise is graded automatically, in your browser. The full statements are available once you have an account.
What this is for in real life
The world is uncertain, and all an AI ever does is reason with that uncertainty. - Language models. ChatGPT or Claude do not write a sentence in one go: at each step, they give a probability to every possible…
Medical test
You are a doctor. A patient is panicking: their screening test came back positive. You know 3 things about the test: - Prevalence: the fraction of the population that has the disease - Sensitivity: the…
Lesson: the rules of probability
The medical test had you handle, without naming them, the fundamental rules of probability. Conditional probability: is the probability of given that is true (here…
Monty Hall
You are on a TV game show. In front of you, 3 doors. Behind one of them hides a car; behind the other two, goats. You pick a door (say door 1). The host, who knows where the car is, opens another door hiding a…
Bayesian detective
You are investigating a burglary. There are 3 suspects: Alice, Bob and Charlie. At the start, you have no reason to favor one over another: each has a "belief" of 1/3. Clue 1: A witness says the criminal wore a…
Spam filter
You get too much spam. You decide to build an automatic filter. You analyzed your old emails and recorded the frequency of certain words: | Word | Frequency in spam | Frequency in legitimate emails | |---|---|---| |…