Bayes’ Theorem
Bayes’ Theorem: COVID tests
Bayes’ Theorem: COVID tests
Assume that 0.5% of people have COVID. Suppose a COVID test gives a (true) positive on 96% of patients who have COVID, but gives a (false) positive on 2% of patients who do not have COVID. Bob tests positive. What is the probability that Bob has COVID?
Solution
(1) Label events:
- Event : Bob is actually positive for COVID
- Event : Bob is actually negative; note
- Event : Bob tests positive
- Event : Bob tests negative; note
(2) Identify known data:
- Know:
- Know:
- Know: and therefore
We seek:
(3) Translate Bayes’ Theorem:
Set and in Bayes’:
We know all values on the right except
(4) Denominator: apply Total Probability (Division into Cases):
Observe that and are exclusive events, and that:
Therefore:
Plug in data and compute:
(5) Plug in and compute:
Link to originalIntuition - COVID testing
Some people find this low number surprising. In order to repair your intuition, think about it like this: roughly 2.5% of tests are positive, with roughly 2% coming from false positives, and roughly 0.5% from true positives. Only of all the positive results are true ones!
(This rough approximation assumes that .)
If two tests both come back positive, the odds of COVID are now 98%.
If only people with symptoms are tested, so that, say, 20% of those tested have COVID, that is, , then one positive test implies a COVID probability of 92%.
Inferring bin from marble
Inferring bin from marble
There are marbles in bins in a room:
- Bin 1 holds 7 red and 5 green marbles.
- Bin 2 holds 4 red and 3 green marbles.
Your friend goes in the room, shuts the door, and selects a random bin, then draws a random marble. (Equal odds for each bin, then equal odds for each marble in that bin.) He comes out and shows you a red marble.
What is the probability that this red marble was taken from Bin 1?
Link to originalSolution
(1) Label events:
- Event : friend chooses Bin 1.
- Event : friend chooses Bin 2.
- Event : friend draws a red marble.
- Event : friend draws a green marble.
Answer will be .
(2) Identify knowns:
- Know .
- Know .
- Know .
- Know .
- Know .
(3) Apply Bayes’ Theorem for ::
Division into Cases for the denominator:
(3) Plug in data and compute:
Independence
Independence and complements
Independence and complements
Prove that these are logically equivalent statements:
- and are independent
- and are independent
- and are independent
Make sure you demonstrate both directions of each equivalency.
Link to originalSolution
(1) Assume and show :
Divide into the cases:
Apply the assumption:
Algebra:
Negation rule:
(2) Assume and show :
Reason the same way as above, but apply the new assumption to break up the second term instead of the first.
(3) Show that and are equivalent:
To do this, simply notice that in the first equivalence we can replace with and with . Use too.
Independence by hand: red and green marbles
Independence by hand: red and green marbles
A bin contains 4 red and 7 green marbles. Two marbles are drawn.
Let be the event that the first marble is red, and let be the event that the second marble is green.
(a) Show that and are independent if the marbles are drawn with replacement.
(b) Show that and are not independent if the marbles are drawn without replacement.
Solution
(a) With replacement.
Identify knowns:
- Know:
- Know:
Now compute both sides of independence relation:
The right side is .
For , we have ways to get , and total outcomes. So left side is , which equals the right side.
(b) Without replacement. This is a bit harder.
(1) Identify knowns:
Know: and therefore
We seek: and
(2) Find using Total Probability (Division into Cases):
Find RHS factors by counting, then compute:
(3) Find using multiplication rule:
(4) Compare both sides:
Left side: .
Right side:
But so and they are not independent.
Link to original
Tree diagrams
Marble transferred, marble drawn
Marble transferred, marble drawn
Setup:
- Bin 1 holds five red and four green marbles.
- Bin 2 holds four red and five green marbles.
Experiment:
- You take a random marble from Bin 1 and put it in Bin 2 and shake Bin 2.
- Then you draw a random marble from Bin 2 and look at it.
Questions:
(a) What is the probability you draw a red marble?
(b) Supposing that you drew a red marble, what is the probability that a red marble was transferred?
Solution
Construct the tree diagram:
Identify sub-experiments, label events, compute probabilities:
(a) Compute :
Add up leaf numbers for at leaf:
(b) Compute :
Conditional probability definition:
Interpretation: value of desired path over value of all possible paths.
Link to original
Counting
Counting teams with Cooper
Counting teams with Cooper
A team of 3 student volunteers is formed at random from a class of 40. What is the probability that Cooper is on the team?
Link to originalSolution
There are teams that include Cooper, and teams in total. So we have:
Haley and Hugo from 2 groups of 3
Haley and Hugo from 2 groups of 3
A UVA class has 40 students. Suppose the professor chooses 3 students on Wednesday at random, and again 3 on Friday. What is the probability that Haley is chosen today and Hugo on Friday?
Solution
(1) Count total outcomes:
- We have possible groups chosen Wednesday.
- We have possible groups chosen Friday.
Therefore possible groups in total. (Product of possibilities.)
(2) Count desired outcomes:
The possible groups of 3 that include Haley can be counted by counting the subgroups of 2 formed of the other students in Haley’s group.
- Therefore we have groups that contain Haley.
- Similarly, we have groups that contain Hugo.
Therefore we count total desired outcomes.
(3) Compute probability:
Let label the desired event. By the counting rule:
Evaluate using our data:
Link to original
Counting VA license plates
Counting VA license plates
VA license plates have three letters (with no I, O, or Q) followed by four numerals. A random plate is seen on the road.
(a) What is the probability that the numerals occur in strictly increasing order?
(b) What is the probability that at least one number is repeated?
Solution
(a) Numerals in increasing order.
(1) Count total plates:
- Have options for letters.
- Have options for numbers.
Thus possible plates.
(2) Count ways to have 4 numerals that occur in increasing order:
There are ways to choose 4 distinct numerals from 10 options.
For each choice of four distinct numerals (i.e. for each combination), there is exactly one ordering that’s increasing.
Therefore, there are ways to have 4 numerals that occur in increasing order.
(3) Count ways to have a list of 3 letters (excluding I, O, Q).
There are 26 total letters, 3 are excluded, thus 23 options for each letter.
Repetition is allowed, thus we have total ways.
(3) Compute probability:
Total count of desired plates (taking the product of possibilities):
Let label the event that a plate has increasing numerals. The counting formula for probability is:
Evaluate using our data:
(b) At least one number repeated.
“At least” is hard to work with! Lots of ways that can happen.
Try the complement event, which is much simpler: “no repetition”
Let be event that no numbers are repeated. All are distinct. Then is our desired event.
Count the possibilities:
The total number of plates is still .
Therefore, license plates with at least one number repeated:
Desired outcomes over total outcomes:
Link to original
Counting out 4 teams
Counting out 4 teams
A board game requires 4 teams of players. How many configurations of teams are there out of a total of 17 players if the number of players per team is 4, 4, 4, 5, respectively.
Link to originalSolution
This is just the multinomial coefficient with this data:
17 4 4 4 5 So we have:
