Bayes' Rule
Probability 1 · Lecture slides
The plan
- Several cases, and one thing we observe
- Part 1: which case is behind it, on the Titanic
- Part 2: the same with probabilities only, and then a second observation
Last time: the late bus
- Rain on 3 mornings in 10
- The bus was late, and rain went up to about 7 in 10
- That was two cases: rain or dry
- Today: any number of cases, and the names of the two rules
The Titanic, by class
- First class: 15% of the people on board. About 62% of them survived
- Second class: 13% of the people. About 41% survived
- Third class: 32% of the people. About 25% survived
- Crew: 40% of the people. About 24% survived
What share of everyone on board survived?
- About 24%
- About 32%
- About 38%
- About 50%
Each group counts by its size
The law of total probability
Rule
P(B)=P(A1​)P(B∣A1​)+⋯+P(An​)P(B∣An​)​
B is what we observe. The cases A1​,…,An​ are a partition: exactly one of them happens.
Pick a survivor at random. Which group is most likely?
- First class
- Second class
- Third class
- Crew
Before we look
On paper The four groups had 325, 285, 706, and 885 people, and about 62%, 41%, 25%, and 24% of them survived. About how many people survived in each group?
The 2201 people, group by group
Bayes' rule
Rule
P(Ai​∣B)=P(B)P(Ai​)P(B∣Ai​)​
B is what we observe, and Ai​ is one of the cases. P(B) is the sum from the law of total probability.
The rule gives the same 30%
Your turn: use the rule
On paper Second class was 13% of the people on board, and 41% of second class survived. Of everyone on board, 32% survived. Find the probability that a survivor was in second class.
Second class, given survived
Your turn: a person who died
On paper Survived: 203 of 325 in first class, 118 of 285 in second, 178 of 706 in third, and 212 of 885 in the crew. Pick a person who died at random. Find the probability that this person was in the crew, and the probability that this person was in first class.
A person who died
A large group with a low rate can count for as much as a small group with a high rate.
Part 1 is done
Part 2: no counts, and a second observation.
A wreck on the sea floor
- It lies in one of three zones: north, middle, or south
- North with probability 2/5, middle with 2/5, south with 1/5
- A search of the right zone finds it 9 times in 10
- A search of a wrong zone finds nothing
The north zone is searched. Nothing. How likely is the north now?
- 4%
- About 6%
- 10%
- Still 40%
Nobody searched the south zone. What happens to its probability?
- It goes up
- It stays at 1/5
- It goes down
Draw it in stages
On paper North 2/5, middle 2/5, south 1/5. A search of the right zone finds the wreck 9 times in 10. Draw a tree: first which zone holds the wreck, then whether the search of the north finds it. Write a probability on every branch.
The tree for the search of the north
Bayes' rule for the north zone
The map, before and after
Prior and posterior
- Prior: the probability of a case before the observation
- Posterior: the probability of the case given the observation
- On the map, the large number is the posterior and "was" is the prior
Search again: the middle zone. Nothing.
On paper Start from 1/16, 10/16, and 5/16. The middle zone is searched, and a search of the right zone misses 1 time in 10. Nothing is found. Find the three new probabilities.
The second search: the middle zone
Both searches find nothing, in one step
The south zone went from 1 in 5 to 5 in 7, and nobody searched it.
One more report
- The search ship reports a calm sea
- The sea is calm on 7 days in 10, wherever the wreck is
- Does the map change?
Given a calm sea
An observation that is equally likely in every case changes nothing.
Summary
- A partition: exactly one of the cases happens
- Total probability: add one term for each case
- Bayes' rule: the term of one case, divided by the sum
- A posterior is the prior for the next observation
Before the next class
- Read the lesson "Bayes' Rule"
- Work its six practice problems on paper
- Bring your answer to "Three doors" and be ready to defend it