A conditional probability is the probability of an event, given that
another event is known to have happened. Knowing that the second event
happened rules out some outcomes, so the probability can change.
Our example is a medical test. A condition affects 1 person in 100, and
there is a test for it. Of the people who have the condition, 9 in 10 test
positive. Of the people who do not have it, 1 in 10 test positive. A person
tests positive. We want the probability that this person has the condition,
given the positive test.
Count the people
We find this probability first for a crowd, because people in a crowd can be
counted. In the figure, 1000 people take the test one after another.
We look only at the two positive stacks, because we know the person tested
positive. At the end, 9 of these people have the condition and 99 do
not. So 9 of the 108 people who test positive have the condition,
which is about 8%.
A positive test for a person who does not have the condition is called a
false positive. Only 1 in 10 of the people without the condition get one,
and 9 in 10 of the people with the condition test positive. However, only 1
person in 100 has the condition, which is 10 of the 1000 people. The positive
tests from people with the condition and the false positives are therefore
109×10=9and101×990=99.
The definition
Let A and B be events with P(B)>0. The conditional probability of A
given B is
P(A∣B)=P(B)P(A∩B),(1)
where A∩B is the event that both happen. The denominator keeps only
the outcomes in B, and the numerator keeps the outcomes of A that are
also in B.
We apply the definition to the count. Choose one of the 1000 people at
random. Let D be the event that the person has the condition, and let T
be the event that the person tests positive. Then P(D∣T) is the
probability that the person has the condition, given that the person tested
positive. This is the probability we want.
Of the 1000 people, 108 test positive, and 9 both have the condition
and test positive. So P(T)=108/1000 and P(D∩T)=9/1000, and
(1) gives
P(D∣T)=P(T)P(D∩T)=108/10009/1000=1089=121.
Of the people who test positive, 1 in 12 has the condition. This is the
share from the count, because the 1000 cancels.
The total cancels whenever every outcome is equally likely (each of the 1000
people, each face of a die). Then P(A∣B) is the number of outcomes in
both A and B, divided by the number of outcomes in B.
The tree
A probability tree is a diagram of every possible outcome when events
happen one after another. It branches once for each result an event can have,
so each path from the start to an end is one possible outcome.
Each branch carries the probability of its result, given the branches before
it. The probability of a path is the product of the probabilities along it.
This is the multiplication rule, which is (1) with both sides multiplied
by P(B):
P(A∩B)=P(B)P(A∣B).(2)
We draw the tree for the test. The first event is whether the person has the
condition, and the second event is the test result. The three numbers we were
given go on the branches:
P(D)=1/100 is the probability that the person has the condition.
P(T∣D)=9/10 is the probability of a positive test, given that the
person has the condition.
P(T∣Dc)=1/10 is the probability of a positive test, given that
the person does not have the condition. Dc is the event that the person
does not have it.
On paper
Draw this tree, with a probability on every branch and the product at the
end of every path. Then compare it with the figure.
Two paths end in a positive test, and no person follows both, so we add
their probabilities: P(T)=9/1000+99/1000=108/1000. Only the first of
the two goes through the condition, so P(D∩T)=9/1000, and (1)
gives
P(D∣T)=P(T)P(D∩T)=108/10009/1000=121.
This is the answer from the count. The tree needed no crowd, only the three
probabilities.
P(T∣D) and P(D∣T) are different probabilities.
P(T∣D)=9/10 is the probability of a positive test for a person who
has the condition. P(D∣T)=1/12 is the probability of the condition
for a person who tests positive.
Practice
Work each problem on paper before opening its solution.
Problem 1
Two dice that add to 8
A red die and a blue die are rolled. The sum of the two numbers is 8.
Draw a grid with one row for each number on the red die and one column for
each number on the blue die, so that each of the 36 cells is one outcome.
Shade every cell where the sum is 8. Then circle the shaded cells where at
least one die shows a 6.
Find the probability that at least one die shows a 6, given that the sum is
8, as an exact fraction.
Solution
Step 1: Count the outcomes
The grid has 36 cells. Each die is equally likely to show each of its
numbers, so every cell has probability 1/36.
Step 2: Keep the cells where the sum is 8
Let B be the event that the sum is 8. With the red die written first, its
cells are (2,6), (3,5), (4,4), (5,3), and (6,2). That is 5 cells,
so P(B)=5/36. The other 31 cells did not happen.
Step 3: Count the sixes among them
Let A be the event that at least one die shows a 6. Of the 5 cells in B,
2 are in A: (2,6) and (6,2). So P(A∩B)=2/36.
Step 4: Divide
P(A∣B)=P(B)P(A∩B)=5/362/36=52.
The 36 cancels, so the answer is a count of cells: 2 of the 5 that
are left. The pair 2 and 6 is two cells and the pair 4 and 4 is one cell,
which is why the grid keeps the two dice apart.
Answer:
2/5
Problem 2
Choir and instruments
A school has 120 students. Of these, 40 play an instrument, 30 sing in the
choir, and 20 do both.
Draw a table with two rows (plays an instrument, does not) and two columns
(sings in the choir, does not). Write a count in each of the four cells, and
write the total beside each row and under each column.
One student is chosen at random. Find each probability as an exact fraction.
For each one, write down which cells are counted in the numerator and which
in the denominator.
The student plays an instrument and sings in the choir.
The student plays an instrument, given that the student sings in the
choir.
The student sings in the choir, given that the student plays an
instrument.
Solution
Step 1: Fill in the table
The 20 students who do both go in the first cell. The row of students who
play an instrument has 40, so its other cell is 40−20=20. The choir
column has 30, so its other cell is 30−20=10. The last cell is what is
left of the 120 students, which is 70.
Choir
Not choir
Total
Plays an instrument
20
20
40
Does not
10
70
80
Total
30
90
120
Step 2: Count all 120 students for "and"
Let I be the event that the student plays an instrument and C the event
that the student sings in the choir. Nothing is known about the student, so
the denominator is all 120 students:
P(I∩C)=12020=61.
Step 3: Count only the choir column
Given that the student sings in the choir, the student is one of the 30 in
the choir column, so
P(I∣C)=3020=32.
This is (1) from the lesson, 30/12020/120, with the 120
canceled.
Step 4: Count only the instrument row
Given that the student plays an instrument, the student is one of the 40 in
the first row, so
P(C∣I)=4020=21.
Step 5: Compare
The three fractions have the same numerator, the 20 students who do
both. The denominators are 120, 30, and 40, because each question counts
those 20 among a different group.
"And" counts among everyone. "Given" counts among only the group that is
given, and the two given groups here are different, so P(I∣C) and
P(C∣I) are different.
Answer:
1/6, 2/3, and 1/2
Problem 3
At least one six
A red die and a blue die are rolled.
Draw the grid of 36 outcomes twice, with one row for each number on the red
die and one column for each number on the blue die. On the first grid, shade
the cells where the red die shows a 6. On the second grid, shade the cells
where at least one die shows a 6.
Find each probability as an exact fraction.
Both dice show a 6, given that the red die shows a 6.
Both dice show a 6, given that at least one die shows a 6.
Solution
Step 1: Shade the first given event
The red die shows a 6 in one row of the grid. The row has 6 cells.
Step 2: Shade the second given event
At least one die shows a 6 in that row and in one column. The row and the
column share the cell (6,6), so together they have 6+6−1=11 cells.
Step 3: Divide
Both dice show a 6 in 1 cell, and that cell is in both shaded
regions. Every cell has probability 1/36, so the two answers are
6/361/36=61and11/361/36=111.
Step 4: Compare
The numerator is the same cell both times. The second given event is true
for 11 outcomes and not 6, so that one cell is a smaller share of them.
"The red die shows a 6" names a die, so only the blue die is left to ask
about, and it shows a 6 with probability 1/6. "At least one die shows a 6"
does not say which die, so it also keeps the 5 outcomes where only the blue
die shows a 6.
Answer:
1/6 and 1/11
Problem 4
Two batteries from a drawer
A drawer holds 6 batteries that look the same, and 2 of them are dead. We
take out two batteries without looking, one after the other. The first goes
into a flashlight. The second goes into a battery tester.
Draw the tree: first whether the first battery is dead, then whether the
second battery is dead. Write a probability on every branch and the product
at the end of every path.
Find each probability as an exact fraction.
Both batteries are dead.
The tester shows that the second battery is dead, and the flashlight has
not been switched on. Find the probability that the first battery is
dead, given that the second is dead.
Solution
Step 1: Draw the tree
Let A be the event that the first battery is dead and B the event that
the second is dead. The first branches are A with probability
2/6=1/3 and Ac with probability 4/6=2/3.
The second branches depend on the first, because the first battery is not
put back. If the first is dead, 5 batteries are left and 1 is dead, so
P(B∣A)=1/5. If the first is good, 5 are left and 2 are dead, so
P(B∣Ac)=2/5.
Step 2: Multiply along the first path
Both batteries are dead along one path. Its probability is the product
along it, which is (2) from the lesson with A as the event that comes
first:
P(A∩B)=P(A)P(B∣A)=31×51=151.
The other three products are 4/15, 4/15, and 6/15=2/5. In the
figure each product is the area of a rectangle.
Step 3: Add the paths that end in a dead second battery
The second battery is dead along two paths, and no pair follows both, so
P(B)=151+154=31.
This is the same as P(A). Before either battery is tested, the second is
as likely to be dead as the first.
Step 4: Divide
P(A∣B)=P(B)P(A∩B)=1/31/15=51.
Step 5: What the later draw tells us
The second draw did not change the first battery. It changed what we know
about it. The battery in the tester is one of the 2 dead ones, so the battery
in the flashlight is one of the other 5, and 1 of those 5 is dead. That is
1/5, which is less than the 1/3 we had before the test.
Answer:
1/15 and 1/5
Problem 5
A flagged email
One in ten emails that arrive at an inbox is spam. A filter flags a spam email
with probability 3/4, and it flags an email that is not spam with
probability 1/6.
Draw the tree for one email: first whether it is spam, then whether it is
flagged. Write a probability on every branch and the product at the end of
every path.
An email is flagged. Use the tree to find the probability that it is spam, as
an exact fraction.
Solution
Step 1: Draw the tree
Let S be the event that the email is spam and F the event that it is
flagged. The first branches are S with probability 1/10 and Sc with
probability 9/10. The second branches are F and Fc. The tree has four
paths, and the probability of each is the product along it.
The products are also areas. In the figure, the width of a strip is the
probability of the first branch and the height of a rectangle is the
probability of the second, so the area of each rectangle is one of the four
products.
The four products are 3/40, 1/40, 3/20, and 3/4. They add to 1,
because together the four rectangles fill the square.
Step 2: Add the paths that end in a flag
An email is flagged along two paths: it is spam and flagged, or it is not spam
and flagged. No email follows both, so
P(F)=403+203=409.
Step 3: Divide
Only the first of those two paths is spam, so P(S∩F)=3/40 and
P(S∣F)=P(F)P(S∩F)=9/403/40=31.
Of the flagged emails, 2 in 3 are not spam, even though the filter catches 3
in 4 of the spam.