← Back to the lessonTip: print on A4 and turn off the browser's "Headers and footers".
LemonmathSelf-study sheet
Grade 12 · Lesson 6.2

The law of total probability and Bayes' theorem

Name: Date: Time spent: min

Goals

Remember

Exercises

Exercise 1

Given P(B)=0.3P(B)=0.3, P(A∣B)=0.6P(A\mid B)=0.6 and P(A∣B‾)=0.2P(A\mid\overline B)=0.2, find P(A)P(A) and P(B∣A)P(B\mid A).

Exercise 2

A school has two campuses: 70%70\% of its students are at campus 1 and 30%30\% at campus 2. The proportions who cycle to school at the two campuses are 20%20\% and 50%50\%. A student of the school is chosen at random. Find the probability that the student cycles. If the student cycles, what is the probability that the student is at campus 2?

Exercise 3

Box I holds 44 red and 66 blue balls; box II holds 77 red and 33 blue balls. A die is rolled: a 11 or a 22 chooses box I, anything else chooses box II; then one ball is drawn at random from the chosen box. Find the probability of a red ball and the probability that a red ball came from box I.

Exercise 4

The first box holds 33 white and 22 black balls; the second box holds 22 white and 22 black balls. One ball is moved at random from the first box to the second, and then one ball is drawn at random from the second box. Find the probability that this last ball is white.

Exercise 5

The probability of rain on a given morning is 0.250.25. If it rains, the bus is late with probability 0.60.6; if it does not rain, the bus is late with probability 0.20.2. Is each claim true or false?

a) The probability that the bus is late is 0.30.3.

b) The probability that the bus is late when it does not rain is 0.80.8.

c) Given that the bus is late, the probability of rain is 0.50.5.

d) Given that the bus is not late, the probability of rain is less than 0.250.25.

Exercise 6

Three factories supply parts to a phone maker in the proportions 40%40\%, 35%35\%, 25%25\%, with defect rates 2%2\%, 3%3\%, 4%4\%. A part chosen at random is defective. Find the probability that it came from the first factory. Give your answer to 2 decimal places.

Exercise 7

In a company's inbox, 30%30\% of emails are spam. The phrase "you have won" appears in 40%40\% of spam emails but in only 2%2\% of ordinary emails. A new email contains "you have won". Find the probability that it is spam, as a percentage to 1 decimal place.

Exercise 8 Review

Machine A makes 300300 items, 99 of them defective; machine B makes 200200 items, 1010 of them defective. All the items are mixed and one is picked at random. Find the probability that it is defective in two ways: by direct counting and with the law of total probability. If the item is defective, what is the probability that machine B made it?

Exercise 9 Review

Box I holds 44 red and 22 white balls; box II holds 22 red and 44 white balls. One box is chosen at random (each with probability 12\dfrac12), and then 22 balls are drawn at random together from that box. Find the probability of getting 22 red balls. If 22 red balls are drawn, what is the probability that box I was chosen?

Exercise 10 Challenge

A disease affects 2%2\% of the population. A test is positive for 90%90\% of people with the disease and gives a false positive for 4%4\% of people without it. a) A person tests positive; find the probability that the person has the disease. b) The person retakes the test and is positive again (the two results are independent for each person); find the probability of the disease again.

Mini test

15 minutes, without looking back at the lesson. Part I: circle one letter; Part II: write T or F for each statement; Part III: write the answer in the box.

Part I. Multiple choice

Question 1. Given P(B)=0.4P(B)=0.4, P(A∣B)=0.5P(A\mid B)=0.5 and P(A∣B‾)=0.25P(A\mid\overline B)=0.25, the value of P(A)P(A) is
A. 0.20.2.B. 0.750.75.C. 0.30.3.D. 0.350.35.
Question 2. Machine I makes 70%70\% of the items with a defect rate of 1%1\%; machine II makes 30%30\% with a defect rate of 4%4\%. An item is defective; the probability that machine II made it is closest to
A. 0.040.04.B. 0.30.3.C. 0.630.63.D. 0.0120.012.
Question 3. Box I holds 22 red and 33 white balls; box II holds 44 red and 11 white ball. A box is chosen at random and one ball is drawn. The probability of a red ball is
A. 825\dfrac{8}{25}.B. 35\dfrac35.C. 15\dfrac15.D. 65\dfrac65.
Question 4. A disease affects 0.5%0.5\% of the population; a test is positive for 99%99\% of people with it and gives a false positive for 2%2\% of people without it. A person tests positive; the probability that the person has the disease is closest to
A. 99%99\%.B. 98%98\%.C. 20%20\%.D. 0.5%0.5\%.

Part II. True or false

Question 1. Workshop I makes 60%60\% of the items with a defect rate of 3%3\%; workshop II makes 40%40\% with a defect rate of 6%6\%. An item is chosen at random.
a) The probability that the item is defective is 0.0420.042.T / F
b) The probability that the item is defective, given that it is from workshop II, is 0.0240.024.T / F
c) Given that the item is defective, the probability that it is from workshop II is 0.40.4.T / F
d) Given that the item is not defective, the probability that it is from workshop I is greater than 0.60.6. T / F

Part III. Short answer

Question 1. 40%40\% of phone users use iOS and 60%60\% use Android. The proportions using app X in the two groups are 30%30\% and 25%25\%. A phone user is chosen at random; find the probability that the user uses app X.
Question 2. Box I holds 33 red and 77 blue balls; box II holds 66 red and 44 blue balls. A die is rolled: a 66 chooses box I, anything else chooses box II; then one ball is drawn and it is red. Find the probability that it came from box I. Give your answer to 2 decimal places.

Score: ........ / 10

Hints (only when stuck)

Exercise 1.

What you need: the law of total probability and Bayes' theorem.

Steps:

  1. P(B‾)=0.7P(\overline B)=0.7.
  2. Find P(A)P(A), then divide 0.3⋅0.60.3\cdot0.6 by P(A)P(A).
Exercise 2.

What you need: the two campuses are two complementary cases.

Steps:

  1. Add the two paths that lead to "cycles".
  2. Divide the path through campus 2 by the total.
Exercise 3.

What you need: P(box I)=26=13P(\text{box I})=\dfrac26=\dfrac13.

Steps:

  1. P(red)=13⋅410+23⋅710P(\text{red})=\dfrac13\cdot\dfrac4{10}+\dfrac23\cdot\dfrac7{10}.
  2. Use Bayes' theorem.
Exercise 4.

What you need: two cases: the ball moved is white or black; after the move, the second box has 55 balls.

Steps:

  1. Moving a white ball (probability 35\dfrac35): the second box has 33 white out of 55.
  2. Moving a black ball (probability 25\dfrac25): the second box has 22 white out of 55.
Exercise 5.

What you need: the law of total probability and Bayes' theorem; P(not late∣rain)=1−0.6P(\text{not late}\mid\text{rain})=1-0.6.

Steps:

  1. Find P(late)P(\text{late}).
  2. Apply Bayes' theorem to "late" and to "not late".
Exercise 6.

What you need: the general form of the law of total probability and of Bayes' theorem with three cases.

Steps:

  1. Find P(defective)P(\text{defective}) as a sum of three products.
  2. Divide 0.4⋅0.020.4\cdot0.02 by that sum.
Exercise 7.

What you need: Bayes' theorem; this is how a simple spam filter works.

Steps:

  1. Find P(phrase)=0.3⋅0.4+0.7⋅0.02P(\text{phrase})=0.3\cdot0.4+0.7\cdot0.02.
  2. Divide 0.3⋅0.40.3\cdot0.4 by that result.
Exercise 8.

What you need: conditional probability by counting (see conditional probability).

Steps:

  1. Counting: 9+10500\dfrac{9+10}{500}.
  2. Formula: P(A)=300500=0.6P(A)=\dfrac{300}{500}=0.6, P(defective∣A)=9300=0.03P(\text{defective}\mid A)=\dfrac{9}{300}=0.03, and similarly for machine B.
Exercise 9.

What you need: counting with combinations (see permutations, arrangements and combinations): each box gives (62)=15\binom{6}{2}=15 ways to draw 22 balls.

Steps:

  1. P(2 red∣box I)=(42)15P(\text{2 red}\mid\text{box I})=\dfrac{\binom{4}{2}}{15} and P(2 red∣box II)=(22)15P(\text{2 red}\mid\text{box II})=\dfrac{\binom{2}{2}}{15}.
  2. Use the law of total probability, then Bayes' theorem.
Exercise 10.

What you need: Bayes' theorem; with two independent tests, the probability of two positives is 0.920.9^2 with the disease and 0.0420.04^2 without it.

Steps:

  1. a) Numerator 0.02⋅0.90.02\cdot0.9; the denominator adds 0.98⋅0.040.98\cdot0.04.
  2. b) Replace 0.90.9 by 0.810.81 and 0.040.04 by 0.00160.0016.

Self-check

#Did it aloneNeeded a hintNot yet
1☐☐☐
2☐☐☐
3☐☐☐
4☐☐☐
5☐☐☐
6☐☐☐
7☐☐☐
8☐☐☐
9☐☐☐
10☐☐☐

Redo the ones you missed after: ☐ 1 day   ☐ 3 days   ☐ 7 days

Scan for step-by-step solutions