Conditional probability

Print the chapter

Every lesson of the chapter, ready for paper. Exercise sets are lettered A, B, C… and answered at the end.

To save a PDF, choose “Save as PDF” in the print dialog.

1. Probability with equally likely outcomes; the complement

Warm-up

Three quick questions from earlier lessons.

Discover

Two dice are rolled. The sums go from 2 to 12: eleven values. Is each sum equally likely, with probability 111\tfrac{1}{11}?

  1. No
  2. Yes

Roll two dice 1,000 times. Which sum comes up most often?

  1. 7
  2. All sums come up about equally often

Key idea

Probability with equally likely outcomes, and the complement.

If all outcomes in the sample space are equally likely, P(A)=number of outcomes in Anumber of outcomesP(A) = \dfrac{\text{number of outcomes in } A}{\text{number of outcomes}}. Always 0≤P(A)≤10 \le P(A) \le 1, and P(not A)=1−P(A)P(\text{not } A) = 1 - P(A).

Worked example

At least one head in 3 coin tosses.

P(no heads)=18P(\text{no heads}) = \tfrac{1}{8}
8 equally likely sequences.
P(at least one head)=1−18P(\text{at least one head}) = 1 - \tfrac{1}{8}
Complement.
=78= \tfrac{7}{8}
Compute.

Your turn, guided

Your turn: P(sum = 7) with two dice.

16\tfrac{1}{6}
6 pairs of 36.

Practice ★

  1. Two fair dice are rolled. Find the probability that the sum is 2.
  2. Two fair dice are rolled. Find the probability that the sum is 12.
  1. The probability that a flight is late is 0.78. Find the probability that it is not late.

Watch out!

Practice ★★

  1. A fair die is rolled 2 times. Find the probability of at least one six.
  2. A fair die is rolled 6 times. Find the probability of at least one six.

Exit ticket

Three questions to check you have got it.

  1. Two fair dice are rolled. Find the probability that the sum is 2.
  2. Two fair dice are rolled. Find the probability that the sum is 12.
  3. Two fair dice are rolled. Find the probability that the sum is 8.

Summary card

Basics

  • Equally likely: favorable ÷ total.
  • P(not A)=1−P(A)P(\text{not } A) = 1 - P(A); "at least one" via the complement.

Watch out: make sure the outcomes really are equally likely.

2. The addition rule and mutually exclusive events

Warm-up

Three quick questions from earlier lessons.

Discover

In a deck of 52 cards, 13 are hearts and 4 are kings. How many cards are a heart or a king?

  1. 16
  2. 17

Key idea

Add, then remove the overlap.

General addition rule: P(A or B)=P(A)+P(B)−P(A and B)P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B). If AA and BB are mutually exclusive (cannot both happen), P(A and B)=0P(A \text{ and } B) = 0 and P(A or B)=P(A)+P(B)P(A \text{ or } B) = P(A) + P(B).

Worked example

P(heart or king).

1352+452−152\tfrac{13}{52} + \tfrac{4}{52} - \tfrac{1}{52}
Each part.
=1652=413= \tfrac{16}{52} = \tfrac{4}{13}
Simplify.

Your turn, guided

Your turn: P(A) = 0.5, P(B) = 0.4, P(A and B) = 0.2. Find P(A or B).

0.70.7
0.5 + 0.4 − 0.2.

Practice ★

  1. In a class of 35 students, 12 are girls, 12 play soccer and 2 girls play soccer. A student is chosen at random. Find P(girl or soccer player).
  2. In a class of 34 students, 16 are girls, 10 play soccer and 4 girls play soccer. A student is chosen at random. Find P(girl or soccer player).
  3. In a class of 35 students, 19 are girls, 8 play soccer and 4 girls play soccer. A student is chosen at random. Find P(girl or soccer player).

Watch out!

Practice ★★

  1. Events A and B are mutually exclusive, with P(A) = 0.31 and P(B) = 0.24. Find P(A and B).
  1. A spinner lands on red with probability 0.21 and on blue with probability 0.32. Find P(red or blue).

Exit ticket

Three questions to check you have got it.

  1. In a class of 35 students, 12 are girls, 12 play soccer and 2 girls play soccer. A student is chosen at random. Find P(girl or soccer player).
  2. In a class of 34 students, 16 are girls, 10 play soccer and 4 girls play soccer. A student is chosen at random. Find P(girl or soccer player).
  3. In a class of 35 students, 19 are girls, 8 play soccer and 4 girls play soccer. A student is chosen at random. Find P(girl or soccer player).

Summary card

Addition rule

P(A or B)=P(A)+P(B)−P(A and B)P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B); for disjoint events the last term is 0.

Watch out: disjoint is not the same as independent.

3. Conditional probability

Warm-up

Three quick questions from earlier lessons.

Discover

Of 100 students, 40 take French; 10 of those also take Spanish. Among the French students, what is the probability of taking Spanish?

  1. 1040\tfrac{10}{40}
  2. 10100\tfrac{10}{100}

Key idea

Conditioning shrinks the sample space.

P(A∣B)=P(A and B)P(B)P(A \mid B) = \dfrac{P(A \text{ and } B)}{P(B)}: the probability of AA among the outcomes in BB. In general P(A∣B)≠P(B∣A)P(A \mid B) \ne P(B \mid A).

Worked example

P(rain) = 0.3, P(late) = 0.2, P(rain and late) = 0.12.

P(late∣rain)=0.120.3=0.4P(\text{late} \mid \text{rain}) = \tfrac{0.12}{0.3} = 0.4
Divide by P(rain).
P(rain∣late)=0.120.2=0.6P(\text{rain} \mid \text{late}) = \tfrac{0.12}{0.2} = 0.6
Divide by P(late).
Two different numbers
Different conditions.

Your turn, guided

Your turn: P(A and B) = 0.1, P(B) = 0.4. Find P(A | B).

0.250.25
0.1 ÷ 0.4.

Practice ★

  1. P(A) = 0.60, P(B) = 0.22 and P(A and B) = 0.5. Find P(A | B).
  2. P(A) = 0.55, P(B) = 0.33 and P(A and B) = 0.13. Find P(A | B).
  1. A screening test was given to 316 people: 47 had the disease and tested positive, 8 had the disease and tested negative, 34 did not have it and tested positive, 227 did not have it and tested negative. Find P(disease | positive).
  2. A screening test was given to 256 people: 33 had the disease and tested positive, 7 had the disease and tested negative, 21 did not have it and tested positive, 195 did not have it and tested negative. Find P(disease | positive).

Watch out!

Practice ★★

  1. A test detects a disease in 87% of people who have it. Which statement says the same thing?
    1. P(positive | disease) = 0.87
    2. P(disease | positive) = 0.87
    3. P(disease and positive) = 0.87

Exit ticket

Three questions to check you have got it.

  1. A screening test was given to 316 people: 47 had the disease and tested positive, 8 had the disease and tested negative, 34 did not have it and tested positive, 227 did not have it and tested negative. Find P(disease | positive).
  2. A screening test was given to 256 people: 33 had the disease and tested positive, 7 had the disease and tested negative, 21 did not have it and tested positive, 195 did not have it and tested negative. Find P(disease | positive).
  3. A screening test was given to 239 people: 57 had the disease and tested positive, 3 had the disease and tested negative, 29 did not have it and tested positive, 150 did not have it and tested negative. Find P(disease | positive).

Summary card

Conditional probability

P(A∣B)=P(A and B)/P(B)P(A \mid B) = P(A \text{ and } B) / P(B).

Watch out: P(A∣B)P(A \mid B) and P(B∣A)P(B \mid A) are different.

4. Independence and the multiplication rule

Warm-up

Three quick questions from earlier lessons.

Discover

A card is drawn from a deck. Does knowing it is a heart change the probability that it is a king?

  1. No
  2. Yes

Key idea

Independent events do not influence each other.

AA and BB are independent if P(A∣B)=P(A)P(A \mid B) = P(A), equivalently P(A and B)=P(A) P(B)P(A \text{ and } B) = P(A)\,P(B). In general P(A and B)=P(A) P(B∣A)P(A \text{ and } B) = P(A)\,P(B \mid A). Draws without replacement are dependent.

Worked example

Two cards drawn without replacement: P(both aces).

P(ace)=452P(\text{ace}) = \tfrac{4}{52}
First draw.
P(ace∣ace)=351P(\text{ace} \mid \text{ace}) = \tfrac{3}{51}
3 aces left of 51.
452⋅351=1221\tfrac{4}{52} \cdot \tfrac{3}{51} = \tfrac{1}{221}
Multiply.

Your turn, guided

Your turn: two independent events with probabilities 0.5 and 0.3. P(both).

0.150.15
0.5 × 0.3.

Practice ★

  1. Two independent machines fail with probabilities 0.8 and 0.7. Find the probability that both fail.
  2. Two independent machines fail with probabilities 0.7 and 0.4. Find the probability that both fail.
  1. P(A) = 3/10, P(B) = 6/10 and P(A and B) = 18/100. Are A and B independent?
    1. Yes: P(A and B) = P(A)·P(B)
    2. No, because P(A and B) > 0
    3. It cannot be decided

Watch out!

Practice ★★

  1. A bag has 5 red and 3 blue marbles. Two are drawn without replacement. Find P(both red).
  2. A bag has 6 red and 7 blue marbles. Two are drawn without replacement. Find P(both red).

Exit ticket

Three questions to check you have got it.

  1. Two independent machines fail with probabilities 0.8 and 0.7. Find the probability that both fail.
  2. Two independent machines fail with probabilities 0.7 and 0.4. Find the probability that both fail.
  3. Two independent machines fail with probabilities 0.3 and 0.5. Find the probability that both fail.

Summary card

Independence

  • Independent: P(A and B)=P(A)P(B)P(A \text{ and } B) = P(A)P(B).
  • In general: P(A)P(B∣A)P(A)P(B \mid A).

Watch out: without replacement, update the second probability.

5. Tree diagrams and reverse conditioning

Warm-up

Three quick questions from earlier lessons.

Discover

1% of people have a condition. A test is positive for 95% of them, and for 5% of healthy people. Of 10,000 people, about how many test positive in total?

  1. About 590
  2. About 5,000

Key idea

A tree organizes conditional probabilities.

First branches: P(A)P(A) and P(not A)P(\text{not } A); second branches: conditional probabilities. Multiply along a path; add the paths that end in BB to get P(B)P(B). Then P(A∣B)=P(A and B)P(B)P(A \mid B) = \dfrac{P(A \text{ and } B)}{P(B)} (reverse conditioning, Bayes' rule).

Worked example

With the numbers above: P(condition | positive).

0.01×0.95=0.00950.01 \times 0.95 = 0.0095
Path: condition, positive.
P(+)=0.0095+0.99×0.05=0.059P(+) = 0.0095 + 0.99 \times 0.05 = 0.059
Both paths to positive.
P(condition∣+)=0.00950.059≈0.16P(\text{condition} \mid +) = \tfrac{0.0095}{0.059} \approx 0.16
Divide.

Your turn, guided

Your turn: P(A) = 0.2, P(B | A) = 0.5, P(B | not A) = 0.25. Find P(B).

0.30.3
0.2 × 0.5 + 0.8 × 0.25.

Practice ★

  1. 12% of a population has a condition. A test is positive for 86% of people with the condition and for 11% of people without it. Find P(positive).
  2. 14% of a population has a condition. A test is positive for 94% of people with the condition and for 8% of people without it. Find P(positive).
  1. 22% of a population has a condition. A test is positive for 81% of people with the condition and for 12% of people without it. Find P(condition | positive).

Watch out!

Practice ★★

  1. A disease affects 1 in 1,000 people. A test is 93% accurate for both sick and healthy people. Your test is positive. What is most likely?
    1. You are still more likely healthy: false positives from the many healthy people outnumber the true positives
    2. You are about 93% likely to be sick
    3. You are certainly sick
  1. Boss problem. 5% of people have a disease. A test is positive for 90% of people with the disease and for 7% of people without it.

Exit ticket

Three questions to check you have got it.

  1. 12% of a population has a condition. A test is positive for 86% of people with the condition and for 11% of people without it. Find P(positive).
  2. 14% of a population has a condition. A test is positive for 94% of people with the condition and for 8% of people without it. Find P(positive).
  3. 28% of a population has a condition. A test is positive for 95% of people with the condition and for 14% of people without it. Find P(positive).

Summary card

Trees

  • Multiply along paths; add paths to the same end.
  • P(A∣B)=P(A and B)/P(B)P(A \mid B) = P(A \text{ and } B)/P(B).

Watch out: with rare events, most positives can be false.

6. Permutations and combinations in probability

Warm-up

Three quick questions from earlier lessons.

Discover

In how many orders can 3 books stand on a shelf?

  1. 6
  2. 3

Key idea

Count ordered choices; divide when order does not matter.

Choosing rr things from nn in order (a permutation): nPr=n(n−1)⋯(n−r+1)_nP_r = n(n - 1) \cdots (n - r + 1). Choosing rr things without order (a combination): nCr=nPrr!_nC_r = \dfrac{_nP_r}{r!}, because each group was counted r!r! times. With equally likely outcomes, a probability is (favorable count) ÷ (total count).

Worked example

Choose 2 of 5 students: as president and treasurer, or as a pair.

5⋅4=205 \cdot 4 = 20
In order.
20÷2!=1020 \div 2! = 10
As a pair.

Your turn, guided

Your turn: choose 2 of 6 for a committee.

1515
6 · 5 ÷ 2.

Practice ★

  1. 5 runners are in a race. In how many ways can the gold, silver and bronze medals be awarded?
  2. 10 runners are in a race. In how many ways can the gold, silver and bronze medals be awarded?
  1. Which question is answered by counting arrangements where order matters (a permutation)?
    1. In how many ways can 5 students stand in a line for a photo?
    2. In how many ways can 2 of the 5 students be chosen for a committee?
    3. How many handshakes happen if each of 5 students shakes hands once with every other?

Watch out!

Practice ★★

  1. In how many ways can a team of 3 students be chosen from 5 students?
  2. In how many ways can a team of 3 students be chosen from 7 students?
  1. Two students are chosen at random from a class of 4 to go on a trip. What is the probability that both Ana and Ben are chosen?

Exit ticket

Three questions to check you have got it.

  1. 5 runners are in a race. In how many ways can the gold, silver and bronze medals be awarded?
  2. 10 runners are in a race. In how many ways can the gold, silver and bronze medals be awarded?
  3. 6 runners are in a race. In how many ways can the gold, silver and bronze medals be awarded?

Summary card

Permutations and combinations

Order matters: nPr. Order does not: nCr = nPr ÷ r!.

Watch out: ask whether swapping two choices changes the result.