←
Mathematics — Grade 12, Part II
PROBABILITY · 7 / 7
⌕
Chapter 7 of 7

PROBABILITY

16 sections · 7,296 words

Chapter 13: Probability

45 words · 1 min read

Chapter 13

Probability

Big idea: probability measures how likely something is. When you learn new information, the chances change. This chapter shows exactly how, and how to turn a "what is the chance of the clue?" into a "what is the chance of the cause?".

13.1 Introduction

428 words · 2 min read

You already know the basic idea of probability. An experiment has several possible outcomes. The set of all outcomes is the sample space SS. An event EE is a collection of outcomes, that is, a subset of SS. When all outcomes are equally likely,

P(E)=n(E)n(S)P(E) = \frac{n(E)}{n(S)}

where n(E)n(E) is the number of outcomes in EE and n(S)n(S) the number in SS.

Roll two dice, one after the other. There are 6×6=366 \times 6 = 36 equally likely outcomes, from (1,1)(1, 1) to (6,6)(6, 6). Let EE be the event "the sum is 88". The outcomes are (2,6),(3,5),(4,4),(5,3),(6,2)(2, 6), (3, 5), (4, 4), (5, 3), (6, 2), so n(E)=5n(E) = 5 and

P(E)=536≈0.1389.P(E) = \frac{5}{36} \approx 0.1389.

The 36 outcomes of two dice. The 5 orange outcomes have sum 8, so P(sum is 8) = 5/36.

  • 0≤P(E)≤10 \le P(E) \le 1, with P(S)=1P(S) = 1 and P(∅)=0P(\varnothing) = 0.
  • Complement: P(E′)=1−P(E)P(E') = 1 - P(E), where E′E' means "EE does not happen". Here P(E′)=1−536=3136P(E') = 1 - \frac{5}{36} = \frac{31}{36}.
  • Addition rule: P(E∪G)=P(E)+P(G)−P(E∩G)P(E \cup G) = P(E) + P(G) - P(E \cap G), where E∪GE \cup G means "EE or GG (or both)" and E∩GE \cap G means "EE and GG".

Check the addition rule. Let GG be "the first die shows 33". Then P(G)=16P(G) = \frac{1}{6}, and "both" happens only for (3,5)(3, 5), so P(E∩G)=136P(E \cap G) = \frac{1}{36}. So P(E∪G)=536+16−136=518P(E \cup G) = \frac{5}{36} + \frac{1}{6} - \frac{1}{36} = \frac{5}{18}. Counting the outcomes directly gives the same answer, 518\frac{5}{18}.

Suppose someone tells you a clue about the outcome: "at least one die shows a 66". The clue rules out many outcomes. Do the chances of other events change? Yes, and in this chapter you will learn how to calculate the new chances. You will meet:

  • conditional probability: the chance of an event when you already know another event has happened;
  • the multiplication rule: finding the chance that two or more events all happen;
  • independent events: events that do not affect each other;
  • the theorem of total probability and Bayes' theorem: combining several possible causes, and working backwards from an effect to its cause.

13.2 Conditional Probability

629 words · 3 min read

A clue changes what is possible. Roll two dice, and suppose you are told: "at least one die shows a 66". Call this event FF. Now only the outcomes with a 66 are still possible. There are 11 of them. The sum is 88 (EE) in only 2 of these: (2,6)(2, 6) and (6,2)(6, 2). So, given FF, the chance of EE is \frac{2}{11}.Beforetheclueitwas536. Before the clue it was \frac{5}{36}.

Given the clue F, only the 11 coloured outcomes remain. Two of them (orange) have sum 8, so P(E given F) = 2/11.

We write this as P(E∣F)P(E \mid F), read "the probability of EE given FF". We can calculate it in two equivalent ways:

  • Shrink the sample space. Count only the outcomes in FF: P(E∣F)=n(E∩F)n(F)=211P(E \mid F) = \dfrac{n(E \cap F)}{n(F)} = \dfrac{2}{11}.
  • Use probabilities. Divide the chance of "both" by the chance of the clue:

P(E∣F)=P(E∩F)P(F),P(F)≠0.P(E \mid F) = \frac{P(E \cap F)}{P(F)}, \qquad P(F) \ne 0.

Check: P(E∩F)=118P(E \cap F) = \frac{1}{18} and P(F)=1136P(F) = \frac{11}{36}, so P(E∣F)=118÷1136=211P(E \mid F) = \frac{1}{18} \div \frac{11}{36} = \frac{2}{11}, the same as before. The condition P(F)≠0P(F) \ne 0 is needed because you cannot be given a clue that can never happen.

A bag holds 55 red and 33 blue balls. Two balls are drawn one after the other, without putting the first back. Given that the first ball is red, what is the chance that the second is red too? After a red ball is removed, 77 balls are left, and 44 of them are red. So the answer is 47\frac{4}{7}. The computer listed all 8×7=568 \times 7 = 56 ordered draws and agrees: 47\frac{4}{7}.

  • A card is drawn from a standard deck of 5252. Given that it is a face card (jack, queen or king; 1212 cards), the chance that it is a king is 412=13\frac{4}{12} = \frac{1}{3}.
  • Given that the card is red, the chance that it is a heart is 12\frac{1}{2}.
  • Given that the card is a heart, the chance that it is red is 11. A heart is always red.
Common mistake: mixing up P(E∣F)P(E \mid F) and P(F∣E)P(F \mid E). They are usually different. In the dice example, P(E∣F)=211P(E \mid F) = \frac{2}{11} but P(F∣E)=25P(F \mid E) = \frac{2}{5} (of the 55 outcomes with sum 88, two contain a 66). The condition is always the event after the bar.
In simple words: conditional probability asks, "among only the outcomes that fit the clue, what fraction also fit the event?"

  1. Toss a fair coin 33 times. Given that the first toss is heads, what is the chance of at least 22 heads in total?
  2. Roll a die. Given that the number is even, what is the chance it is 66?
  3. Draw a card from a deck. Given that it is a spade, what is the chance it is an ace?
  4. A bag has 44 red and 66 blue balls. Two are drawn without replacement. Given that the first is blue, what is the chance the second is blue?

Answers

  1. 34\frac{3}{4}. The four outcomes that start with heads are HHH, HHT, HTH, HTT, and three of them have at least two heads.
  2. 13\frac{1}{3}. The even numbers are 2,4,62, 4, 6, and one of the three is a 66.
  3. 113\frac{1}{13}. Each suit has 1313 cards and exactly one ace.
  4. 59\frac{5}{9}. Five blue balls remain among 99.

13.2.1 Properties of conditional probability

388 words · 2 min read

Once the clue FF is known, FF acts like a new sample space. So conditional probabilities follow the same rules as ordinary probabilities. The examples below use one card drawn from a deck, with the clue FF: "the card is red" (2626 cards). Let EE be "the card is a king" and GG "the card is a heart". Every value was found by counting.

  • Property 1. 0≤P(E∣F)≤10 \le P(E \mid F) \le 1, and P(F∣F)=P(S∣F)=1P(F \mid F) = P(S \mid F) = 1. Example: P(E∣F)=113P(E \mid F) = \frac{1}{13}, and P(F∣F)=1P(F \mid F) = 1.
  • Property 2 (addition rule). P((E∪G)∣F)=P(E∣F)+P(G∣F)−P((E∩G)∣F)P\big((E \cup G) \mid F\big) = P(E \mid F) + P(G \mid F) - P\big((E \cap G) \mid F\big). Example: P(E∣F)=113P(E \mid F) = \frac{1}{13}, P(G∣F)=12P(G \mid F) = \frac{1}{2}, and P((E∩G)∣F)=126P\big((E \cap G) \mid F\big) = \frac{1}{26} (only the king of hearts). So the right side is 113+12−126=713\frac{1}{13} + \frac{1}{2} - \frac{1}{26} = \frac{7}{13}. Counting the red cards that are kings or hearts (13+1=1413 + 1 = 14 out of 2626) gives 713\frac{7}{13}.
  • Property 3 (complement). P(E′∣F)=1−P(E∣F)P(E' \mid F) = 1 - P(E \mid F). Example: the chance that a red card is not a king is 1−113=12131 - \frac{1}{13} = \frac{12}{13}, and counting (2424 out of 2626) gives 1213\frac{12}{13}.
  • Property 4 (disjoint events). If EE and AA cannot happen together, then P((E∪A)∣F)=P(E∣F)+P(A∣F)P\big((E \cup A) \mid F\big) = P(E \mid F) + P(A \mid F). Example: let AA be "the card is an ace". Kings and aces are disjoint, so P((E∪A)∣F)=113+113=213P\big((E \cup A) \mid F\big) = \frac{1}{13} + \frac{1}{13} = \frac{2}{13}.
Common mistake: the properties apply to the event before the bar. The clue after the bar stays the same. For example, P(E∣F)+P(E∣F′)P(E \mid F) + P(E \mid F') is not 11. The correct statement is P(E∣F)+P(E′∣F)=1P(E \mid F) + P(E' \mid F) = 1.
Why it works: P(E′∣F)=P(E′∩F)P(F)P(E' \mid F) = \dfrac{P(E' \cap F)}{P(F)}. The red cards that are not kings, together with the red kings, make up all the red cards, so the two fractions add up to P(F)P(F)=1\dfrac{P(F)}{P(F)} = 1.

  1. For a card drawn from a deck, find the chance that it is a jack, queen or king given that it is red, and the chance that it is not one of these, given that it is red. What do the two add up to?

Answers

  1. 313\frac{3}{13} and 1013\frac{10}{13}. They add up to 11, as Property 3 says.

EXERCISE 13.1

427 words · 2 min read
  1. Two dice are rolled. Find the probability that the sum is 1010, given that the first die shows 55.
  2. Two dice are rolled. Find the probability that the sum is 77, given that the two dice show different numbers.
  3. A card is drawn from a deck. Given that it is black (a spade or a club), find (a) the probability that it is a spade, (b) the probability that it is a king.
  4. A fair coin is tossed 33 times. Find the probability of exactly 22 heads, given that at least one toss is heads.
  5. A bag has 66 red and 44 blue balls. Two are drawn one after the other without replacement. Find the probability that both are red, given that at least one is red.
  6. Two dice are rolled. Find the probability that the sum is 99 or more, given that the first die shows 44.
  7. Two dice are rolled. Let EE be "the first die shows 66" and FF "the sum is 99 or more". Calculate P(E∣F)P(E \mid F) and P(F∣E)P(F \mid E) and show that they are different.
  8. A box holds 2020 items, of which 55 are faulty. Two items are checked one after the other without replacement. Given that the first is faulty, what is the probability that the second is also faulty?

Answers

  1. Given the first die is 55, there are 66 equally likely outcomes. Only (5,5)(5, 5) has sum 1010. So the answer is 16\frac{1}{6}.
  2. There are 3030 outcomes with different numbers. Six of them have sum 77: (1,6),(2,5),(3,4),(4,3),(5,2),(6,1)(1,6), (2,5), (3,4), (4,3), (5,2), (6,1). The answer is 15\frac{1}{5}.
  3. (a) 12\frac{1}{2}: 1313 of the 2626 black cards are spades. (b) 113\frac{1}{13}: 22 of the 2626 black cards are kings.
  4. At least one head: 77 outcomes (all except TTT). Exactly two heads: HHT, HTH, THH. The answer is 37\frac{3}{7}.
  5. P(both red)=13P(\text{both red}) = \frac{1}{3} and P(at least one red)=1315P(\text{at least one red}) = \frac{13}{15}. So P=13÷1315=513P = \frac{1}{3} \div \frac{13}{15} = \frac{5}{13}.
  6. With a 44 on the first die, the sum is 99 or more only when the second die is 55 or 66. So 13\frac{1}{3}.
  7. FF has 1010 outcomes. Four of them have a 66 first: (6,3),(6,4),(6,5),(6,6)(6,3), (6,4), (6,5), (6,6). So P(E∣F)=25P(E \mid F) = \frac{2}{5}. EE has 66 outcomes, and the same 44 lie in FF, so P(F∣E)=23P(F \mid E) = \frac{2}{3}. They are different.
  8. After one faulty item is removed, 1919 items remain and 44 of them are faulty. The answer is 419\frac{4}{19}. (The computer listed all 20×19=38020 \times 19 = 380 ordered pairs and agrees.)

13.3 Multiplication Theorem on Probability

493 words · 2 min read

Sometimes you want the chance that two things both happen: first EE, then FF. Rearranging the definition P(F∣E)=P(E∩F)P(E)P(F \mid E) = \dfrac{P(E \cap F)}{P(E)} gives the multiplication theorem:

P(E∩F)=P(E) P(F∣E),P(E)≠0.P(E \cap F) = P(E)\,P(F \mid E), \qquad P(E) \ne 0.

In words: the chance of "EE and then FF" is the chance of EE, times the chance of FF once EE has happened. Reversing the roles gives P(E∩F)=P(F) P(E∣F)P(E \cap F) = P(F)\,P(E \mid F) as well.

A bag has 55 red and 33 blue balls. Two balls are drawn without replacement. Find the chance that both are red. The first is red with chance 58\frac{5}{8}. Given that, the second is red with chance 47\frac{4}{7}. So

P(both red)=58×47=514.P(\text{both red}) = \frac{5}{8} \times \frac{4}{7} = \frac{5}{14}.

Listing all 5656 ordered draws by computer gives the same 514\frac{5}{14}.

The rule extends to more events: P(E∩F∩G)=P(E) P(F∣E) P(G∣E∩F)P(E \cap F \cap G) = P(E)\,P(F \mid E)\,P(G \mid E \cap F). A bag has 44 red and 66 blue balls. Three balls are drawn without replacement. Find the chance of "red, then blue, then red". Multiply: 410×69×38=110\frac{4}{10} \times \frac{6}{9} \times \frac{3}{8} = \frac{1}{10}. Every time a ball is removed, the numbers in the next fraction change. Listing all 720720 ordered draws agrees: 110\frac{1}{10}.

Two cards are drawn from a deck without replacement. The chance that both are aces is 452×351=1221\frac{4}{52} \times \frac{3}{51} = \frac{1}{221}. The computer listed all 52×51=265252 \times 51 = 2652 ordered pairs and agrees: 1221\frac{1}{221}.

If the first ball is put back before the second draw, the bag is the same each time. For the bag in Example 1, P(both red)=58×58=2564≈0.3906P(\text{both red}) = \frac{5}{8} \times \frac{5}{8} = \frac{25}{64} \approx 0.3906. This is larger than 514≈0.3571\frac{5}{14} \approx 0.3571 from Example 1, because a red ball is still available to be drawn again.

Common mistake: forgetting to change the second fraction when the first item is not replaced. "58×58\frac{5}{8} \times \frac{5}{8}" is the answer with replacement. Without replacement the second fraction is 47\frac{4}{7}.
Drawing a tree helps. Each branch has a probability. To find the chance of a path, multiply along the branches. The tree diagram in Section 13.5.2 shows this.

  1. Three cards are drawn from a deck without replacement. Find the chance that all three are hearts.
  2. A bag has 66 red and 44 blue balls. Two balls are drawn without replacement. Find the chance of red first and blue second.
  3. A die is rolled twice. Find the chance that the first roll is even and the second roll is more than 44.
  4. A fair coin is tossed three times. Find the chance of three heads.

Answers

  1. 1352×1251×1150=11850\frac{13}{52} \times \frac{12}{51} \times \frac{11}{50} = \frac{11}{850}.
  2. 610×49=415\frac{6}{10} \times \frac{4}{9} = \frac{4}{15}.
  3. 12×13=16\frac{1}{2} \times \frac{1}{3} = \frac{1}{6}. (The second roll does not depend on the first.)
  4. 12×12×12=18\frac{1}{2} \times \frac{1}{2} \times \frac{1}{2} = \frac{1}{8}.

13.4 Independent Events

838 words · 4 min read

Sometimes a clue does not change the chances. Toss a coin and roll a die. Knowing that the coin shows heads tells you nothing about the die. We say these events are independent.

Events EE and FF are independent when knowing one has happened does not change the chance of the other:

P(E∣F)=P(E).P(E \mid F) = P(E).

Putting this into the multiplication theorem gives the working test for independence:

P(E∩F)=P(E) P(F).P(E \cap F) = P(E)\,P(F).

(If P(E)≠0P(E) \neq 0 and P(F)≠0P(F) \neq 0, the two statements are equivalent.) Events that are not independent are called dependent.

Roll two dice. Let EE be "the first die is even" and FF "the sum is 77". Then P(E)=12P(E) = \frac{1}{2}, P(F)=16P(F) = \frac{1}{6}, and E∩FE \cap F has three outcomes, (2,5),(4,3),(6,1)(2, 5), (4, 3), (6, 1), so P(E∩F)=112P(E \cap F) = \frac{1}{12}. And 12×16=112\frac{1}{2} \times \frac{1}{6} = \frac{1}{12}. The two are equal, so EE and FF are independent, even though both are about the same dice. Whatever the first die shows, there is always exactly one second-die number that makes the sum 77.

E = first die even (3 columns of the grid). F = sum is 7 (a diagonal). Half of the diagonal lies in E, and E is half of the grid: that is independence.

Keep EE = "the first die is even" but let F′F' now be "the sum is 88". Then P(E)=12P(E) = \frac{1}{2}, P(F′)=536P(F') = \frac{5}{36}, and P(E∩F′)=112P(E \cap F') = \frac{1}{12} (the outcomes (2,6),(4,4),(6,2)(2, 6), (4, 4), (6, 2)). But 12×536=572\frac{1}{2} \times \frac{5}{36} = \frac{5}{72}, which is not 112\frac{1}{12}. So these events are dependent: an even first die makes a sum of 88 more likely.

Toss a coin and roll a die (1212 outcomes). Let AA be "heads" and BB "the die is even". Then P(A)=12P(A) = \frac{1}{2}, P(B)=12P(B) = \frac{1}{2}, P(A∩B)=14P(A \cap B) = \frac{1}{4}, and 12×12=14\frac{1}{2} \times \frac{1}{2} = \frac{1}{4}. Independent, as expected for two separate objects.

In a deck of cards, "the card is a king" and "the card is a heart" are also independent: P(king)=113P(\text{king}) = \frac{1}{13}, P(heart)=14P(\text{heart}) = \frac{1}{4}, and P(king of hearts)=152=113×14P(\text{king of hearts}) = \frac{1}{52} = \frac{1}{13} \times \frac{1}{4}.

Two events are mutually exclusive if they cannot happen together, so P(E∩F)=0P(E \cap F) = 0. If both have non-zero probability, then P(E) P(F)≠0P(E)\,P(F) \ne 0, so they cannot be independent. Example: "the card is an ace" and "the card is a face card" are exclusive. The chance of both is 0, but the product 452×1252\frac{4}{52} \times \frac{12}{52} is not zero. Knowing the card is an ace tells you for certain it is not a face card, so the events are very dependent.

If EE and FF are independent, so are EE and F′F' (and E′E' and FF, and E′E' and F′F'). In Example 1, the event "the sum is not 77" is also independent of "the first die is even": the computer confirms it. This matches common sense: if a clue about FF does not help, a clue about "not FF" does not help either.

Three events A,B,CA, B, C are mutually independent only if every pair is independent and P(A∩B∩C)=P(A) P(B) P(C)P(A \cap B \cap C) = P(A)\,P(B)\,P(C). Pairwise independence is not enough. Toss two coins. Let AA = "first is heads", BB = "second is heads", CC = "the two coins match". Each pair is independent (each pair has probability 14=12×12\frac{1}{4} = \frac{1}{2} \times \frac{1}{2}). But P(A∩B∩C)=14P(A \cap B \cap C) = \frac{1}{4}, while P(A) P(B) P(C)=18P(A)\,P(B)\,P(C) = \frac{1}{8}. So the three events are not mutually independent.

Common mistake: saying events are independent because they "look unrelated", or dependent because they are "about the same thing". Always test P(E∩F)=P(E) P(F)P(E \cap F) = P(E)\,P(F). Example 1 (both about the same dice, yet independent) shows why.

  1. Two dice are rolled. Are "the first die shows 33 or 44" and "the sum is 77" independent?
  2. A card is drawn. Are "it is a heart" and "it is a face card" independent?
  3. A coin is tossed 33 times. Are "at least two heads" and "the first toss is heads" independent?

Answers

  1. Yes. P=13P = \frac{1}{3} and 16\frac{1}{6} for the two events, and P(both)=118=13×16P(\text{both}) = \frac{1}{18} = \frac{1}{3} \times \frac{1}{6}.
  2. Yes. P(heart)=14P(\text{heart}) = \frac{1}{4}, P(face)=313P(\text{face}) = \frac{3}{13}, P(both)=352P(\text{both}) = \frac{3}{52}, and the product of the first two is 352\frac{3}{52}.
  3. No. P(E)=12P(E) = \frac{1}{2}, P(F)=12P(F) = \frac{1}{2}, but P(E∩F)=38P(E \cap F) = \frac{3}{8}, which is not 14\frac{1}{4}.

EXERCISE 13.2

376 words · 2 min read
  1. Two dice are rolled. Are the events "the first die is odd" and "the sum is 88" independent?
  2. Two dice are rolled. Are "the first die shows 33 or 44" and "the sum is 77" independent?
  3. A card is drawn from a deck. Are "the card is a heart" and "the card is a face card" independent?
  4. A fair coin is tossed 33 times. Are "at least two heads" and "the first toss is heads" independent?
  5. A coin is tossed and a die is rolled. Find the probability of heads and a number greater than 44.
  6. EE and FF are independent events with P(E)=13P(E) = \frac{1}{3} and P(F)=14P(F) = \frac{1}{4}. Find P(E∩F)P(E \cap F), P(E∪F)P(E \cup F), and the probability that neither happens.
  7. A machine has 33 independent parts, and each works with probability 910\frac{9}{10}. Find the probability that (a) all three work, (b) at least one works.
  8. A die is rolled once. Let EE be "the number is 11" and FF "the number is 22". Are EE and FF mutually exclusive? Are they independent?

Answers

  1. No. P(E)=12P(E) = \frac{1}{2}, P(F)=536P(F) = \frac{5}{36}, and P(E∩F)=118P(E \cap F) = \frac{1}{18} (the outcomes (3,5)(3, 5) and (5,3)(5, 3)). But P(E) P(F)=572P(E)\,P(F) = \frac{5}{72}.
  2. Yes. P(E)=13P(E) = \frac{1}{3}, P(F)=16P(F) = \frac{1}{6}, P(E∩F)=118P(E \cap F) = \frac{1}{18} (the outcomes (3,4)(3, 4) and (4,3)(4, 3)), and 13×16=118\frac{1}{3} \times \frac{1}{6} = \frac{1}{18}.
  3. Yes. P(heart)=14P(\text{heart}) = \frac{1}{4}, P(face card)=313P(\text{face card}) = \frac{3}{13}, and P(both)=352P(\text{both}) = \frac{3}{52}, which equals 352\frac{3}{52}.
  4. No. P(E)=12P(E) = \frac{1}{2} and P(F)=12P(F) = \frac{1}{2}, so the product is 14\frac{1}{4}. But P(E∩F)=38P(E \cap F) = \frac{3}{8}.
  5. The coin and die are independent: 12×26=16\frac{1}{2} \times \frac{2}{6} = \frac{1}{6}. (Listing all 1212 outcomes agrees.)
  6. P(E∩F)=13×14=112P(E \cap F) = \frac{1}{3} \times \frac{1}{4} = \frac{1}{12}. P(E∪F)=13+14−112=12P(E \cup F) = \frac{1}{3} + \frac{1}{4} - \frac{1}{12} = \frac{1}{2}. Neither: 1−12=121 - \frac{1}{2} = \frac{1}{2}. Check: P(E′) P(F′)=23×34=12P(E')\,P(F') = \frac{2}{3} \times \frac{3}{4} = \frac{1}{2}.
  7. (a) (910)3=7291000\left(\frac{9}{10}\right)^3 = \frac{729}{1000}. (b) The only way none works is (110)3\left(\frac{1}{10}\right)^3, so the answer is 1−11000=99910001 - \frac{1}{1000} = \frac{999}{1000}.
  8. They are mutually exclusive (P(E∩F)=0P(E \cap F) = 0). They are not independent: P(E) P(F)=136P(E)\,P(F) = \frac{1}{36} is not 00. Exclusive events with non-zero probabilities are always dependent.

13.5 Bayes' Theorem

166 words · 1 min read

So far you calculated the chance of an effect when the cause was known. For example: "machine AA makes a part, so what is the chance the part is defective?" Real life often goes the other way. You find a defective part and ask: which machine made it?

This is a reverse question. You know P(defective∣machine A)P(\text{defective} \mid \text{machine } A), and you want P(machine A∣defective)P(\text{machine } A \mid \text{defective}). These are not the same number, and you cannot just swap them. Bayes' theorem turns one into the other.

To state it we first need two ideas: a partition of the sample space (a way to split all the possible causes into separate cases), and the theorem of total probability (a way to add up the chance of the effect over all the causes).

The plan for this section: (1) split the situation into separate, complete cases; (2) add the chance of the effect across all cases; (3) divide to find how much each case contributed.

13.5.1 Partition of a sample space

434 words · 2 min read

A set of events E1,E2,…,EnE_1, E_2, \dots, E_n is a partition of the sample space SS if:

  • the events are complete: together they cover all of SS, that is E1∪E2∪⋯∪En=SE_1 \cup E_2 \cup \dots \cup E_n = S;
  • the events are separate: no two of them can happen together, that is Ei∩Ej=∅E_i \cap E_j = \varnothing for i≠ji \ne j;
  • each event is possible: P(Ei)>0P(E_i) > 0 for every ii.

In other words, every outcome belongs to exactly one of the events. Think of cutting a cake into slices: the slices do not overlap and together they make the whole cake.

  • Roll two dice. "the sum is less than 66", "the sum is 66", and "the sum is more than 66" form a partition. Their probabilities are 518\frac{5}{18}, 536\frac{5}{36} and 712\frac{7}{12}, and they add up to 1.
  • "The first die is even" and "the first die is odd" form a partition.
  • In a deck of cards, the four suits form a partition. So do "aces" (113\frac{1}{13} of the deck), "face cards" (313\frac{3}{13}) and "number cards from 22 to 1010" (913\frac{9}{13}).
  • Any event EE with 0<P(E)<10 < P(E) < 1, together with its complement E′E', forms a partition. (Checked for EE = "the sum is 88".)

The probabilities of the events in a partition always add to 11, because every outcome is counted exactly once.

  • "The first die is less than 44" and "the second die is less than 44". These overlap: (1,2)(1, 2) is in both. They also do not cover everything: (5,5)(5, 5) is in neither.
  • "The sum is 77" and "the sum is 88". They are separate, but they do not cover all outcomes (for example the sum 55 is missing).
  • "The first die is less than 77" and "the first die is more than 99". The second event is impossible, so it is not allowed in a partition.
Common mistake: checking only one of the conditions. A partition needs all of them: complete, separate, and possible.

Roll two dice. Which of these pairs or triples of events are partitions?

  1. "the first die is 11 or 22", "the first die is 33 or 44", "the first die is 55 or 66";
  2. "the sum is at most 77", "the sum is at least 77";
  3. "the sum is even", "the sum is odd".

Answers

  1. Yes. Each first-die number is in exactly one of the three events.
  2. No. They overlap: the sum 77 is in both.
  3. Yes. Every sum is either even or odd, never both.

13.5.2 Theorem of total probability

1,102 words · 5 min read

Let E1,E2,…,EnE_1, E_2, \dots, E_n be a partition of SS, with P(Ei)>0P(E_i) > 0 for each ii, and let AA be any event. Because the EiE_i are complete and separate, the event AA splits into separate pieces A∩E1,A∩E2,…A \cap E_1, A \cap E_2, \dots. Adding their probabilities and using the multiplication theorem on each piece gives the theorem of total probability:

P(A)=P(E1) P(A∣E1)+P(E2) P(A∣E2)+⋯+P(En) P(A∣En).P(A) = P(E_1)\,P(A \mid E_1) + P(E_2)\,P(A \mid E_2) + \dots + P(E_n)\,P(A \mid E_n).

In words: the chance of AA is a weighted average of its chance in each case, where each weight is the chance of that case.

There are three bags, each holding 55 balls. Bag AA has 33 red and 22 blue. Bag BB has 11 red and 44 blue. Bag CC has 44 red and 11 blue. One bag is chosen at random and one ball is drawn from it. What is the chance that the ball is red?

The three bags are a partition, each with chance 13\frac{1}{3}. The chance of red inside each bag is 35\frac{3}{5}, 15\frac{1}{5}, 45\frac{4}{5}. So

P(red)=13⋅35+13⋅15+13⋅45=15+115+415=815.P(\text{red}) = \frac{1}{3} \cdot \frac{3}{5} + \frac{1}{3} \cdot \frac{1}{5} + \frac{1}{3} \cdot \frac{4}{5} = \frac{1}{5} + \frac{1}{15} + \frac{4}{15} = \frac{8}{15}.

Listing all 1515 balls (each equally likely to be the one drawn) gives 815\frac{8}{15} as well.

Each path probability is found by multiplying along the branches. The three red paths (1/5, 1/15, 4/15) add up to 8/15 = P(red).

The tree diagram shows the same calculation. To find the chance of a path, multiply along its branches. To find the chance of an effect, add the paths that lead to it.

Now we can answer the reverse question. If we know the ball is red, how likely is it that it came from bag CC? Start from the definition of conditional probability, and use the multiplication theorem on the top and total probability on the bottom:

P(Ei∣A)=P(Ei∩A)P(A)=P(Ei) P(A∣Ei)∑j=1nP(Ej) P(A∣Ej).P(E_i \mid A) = \frac{P(E_i \cap A)}{P(A)} = \frac{P(E_i)\,P(A \mid E_i)}{\sum_{j=1}^{n} P(E_j)\,P(A \mid E_j)}.

This is Bayes' theorem. The numerator is the chance of the path through EiE_i to AA. The denominator is the chance of all paths to AA. So Bayes' theorem says: the new chance of a cause is its share of all the paths that lead to the effect.

For the bags: P(C∣red)=415815=12P(C \mid \text{red}) = \dfrac{\frac{4}{15}}{\frac{8}{15}} = \frac{1}{2}. In the same way P(A∣red)=38P(A \mid \text{red}) = \frac{3}{8} and P(B∣red)=18P(B \mid \text{red}) = \frac{1}{8}. These three add up to 11, as they must. Direct counting among the 88 red balls out of 1515 confirms the value for CC: 12\frac{1}{2}. Notice that bag CC started with chance 13\frac{1}{3} and, after seeing a red ball, its chance rose to 12\frac{1}{2}.

A factory has three machines. Machine 11 makes half of all items (12\frac{1}{2}), machine 22 makes 310\frac{3}{10} and machine 33 makes 15\frac{1}{5}. The fractions of defective items are 150\frac{1}{50}, 120\frac{1}{20} and 110\frac{1}{10}. An item is chosen at random and is found to be defective. Which machine most likely made it?

MachineShare P(Mi)P(M_i)Defective rate P(D∣Mi)P(D \mid M_i)ProductAfter the check P(Mi∣D)P(M_i \mid D)
1112\frac{1}{2}150\frac{1}{50}1100\frac{1}{100}29\frac{2}{9} ≈0.222\approx 0.222
22310\frac{3}{10}120\frac{1}{20}3200\frac{3}{200}13\frac{1}{3} ≈0.333\approx 0.333
3315\frac{1}{5}110\frac{1}{10}150\frac{1}{50}49\frac{4}{9} ≈0.444\approx 0.444

The products add up to P(D)=9200P(D) = \frac{9}{200}, that is 4.5% of all items are defective. Dividing each product by this total gives the last column: 29\frac{2}{9}, 13\frac{1}{3} and 49\frac{4}{9}. Machine 33 makes the fewest items, but it makes the most defective ones, so it is the most likely source.

Before the test (grey) and after finding a defective item (teal). Machine 3 makes the fewest items but has the highest defect rate, so it is the most likely source of a defective one.

Suppose 1%1\% of the components in a batch are faulty. A test flags 95%95\% of faulty components, but it also flags 4%4\% of good ones by mistake. A component is flagged. What is the chance that it is really faulty? Most people guess about 95%95\%. Count in a batch of 10 00010\,000:

  • Faulty components: 100100. The test flags 9595 of them.
  • Good components: 9 9009\,900. The test flags 396396 of them by mistake.
  • Total flagged: 95+396=49195 + 396 = 491. Only 9595 of these are faulty.

So P(faulty∣flagged)=95491=95491≈0.1935P(\text{faulty} \mid \text{flagged}) = \dfrac{95}{491} = \frac{95}{491} \approx 0.1935, about 19.3%. Bayes' theorem gives the same: 1100⋅19201100⋅1920+99100⋅125\dfrac{\frac{1}{100} \cdot \frac{19}{20}}{\frac{1}{100} \cdot \frac{19}{20} + \frac{99}{100} \cdot \frac{1}{25}}. The surprise comes from the fact that good components are far more common, so even a small mistake rate flags many of them.

Common mistake: confusing P(A∣E)P(A \mid E) with P(E∣A)P(E \mid A). The test catches 95%95\% of faulty components, P(flagged∣faulty)=0.95P(\text{flagged} \mid \text{faulty}) = 0.95. But the chance that a flagged component is faulty, P(faulty∣flagged)P(\text{faulty} \mid \text{flagged}), is only about 0.190.19.
How to solve a Bayes problem: (1) name the causes (they must form a partition) and write their chances; (2) write the chance of the effect for each cause; (3) multiply each pair; (4) add the products to get the total; (5) divide the product for the cause you want by the total.

EXERCISE 13.3

582 words · 3 min read
  1. Box XX has 44 red and 66 blue balls. Box YY has 77 red and 33 blue balls. A fair coin decides the box (heads: XX, tails: YY), and a ball is drawn from that box. (a) Find the chance of red. (b) Given that the ball is red, find the chance it came from box YY.
  2. Production line PP makes 70%70\% of the items of a factory and line QQ makes 30%30\%. Of the items from PP, 2%2\% are defective, and of the items from QQ, 5%5\% are defective. (a) Find the chance that a random item is defective. (b) A defective item is found. What is the chance it came from QQ?
  3. A die is rolled. If it shows 11 or 22, a ball is drawn from bag AA (which has 22 red and 22 blue balls). Otherwise a ball is drawn from bag BB (33 red and 11 blue). (a) Find the chance of red. (b) Given red, find the chance that bag AA was used.
  4. 2%2\% of the components in a batch are faulty. A test flags 90%90\% of the faulty components and wrongly flags 5%5\% of the good ones. A component is flagged. What is the chance it is faulty?
  5. A die is rolled. If it shows 11, 22 or 33 use bag XX; if 44 or 55 use bag YY; if 66 use bag ZZ. The chance of drawing a red ball is 34\frac{3}{4} from XX, 12\frac{1}{2} from YY and 14\frac{1}{4} from ZZ. A red ball is drawn. Find the chance it came from XX.
  6. For events AA and BB: P(A)=35P(A) = \frac{3}{5}, P(B∣A)=14P(B \mid A) = \frac{1}{4} and P(B∣A′)=12P(B \mid A') = \frac{1}{2}. Find P(B)P(B) and P(A∣B)P(A \mid B).
  7. In a multiple-choice test, a student knows the answer to a question with chance 23\frac{2}{3}. Otherwise the student guesses among 44 choices. Find the chance that an answer is correct, and the chance that the student really knew the answer given that it is correct.
  8. One coin is fair and the other has heads on both sides. A coin is chosen at random and tossed. It shows heads. What is the chance that it is the two-headed coin?

Answers

  1. (a) 12⋅25+12⋅710=1120\frac{1}{2} \cdot \frac{2}{5} + \frac{1}{2} \cdot \frac{7}{10} = \frac{11}{20}. (b) 12⋅7101120=711\dfrac{\frac{1}{2} \cdot \frac{7}{10}}{\frac{11}{20}} = \frac{7}{11}. (Listing all 2020 balls agrees with both.)
  2. (a) 710⋅150+310⋅120=291000\frac{7}{10} \cdot \frac{1}{50} + \frac{3}{10} \cdot \frac{1}{20} = \frac{29}{1000}, that is 2.9%. (b) 3200291000=1529≈0.517\dfrac{\frac{3}{200}}{\frac{29}{1000}} = \frac{15}{29} \approx 0.517.
  3. (a) 13⋅12+23⋅34=23\frac{1}{3} \cdot \frac{1}{2} + \frac{2}{3} \cdot \frac{3}{4} = \frac{2}{3}. (b) 1623=14\dfrac{\frac{1}{6}}{\frac{2}{3}} = \frac{1}{4}.
  4. 150⋅910150⋅910+4950⋅120=1867\dfrac{\frac{1}{50} \cdot \frac{9}{10}}{\frac{1}{50} \cdot \frac{9}{10} + \frac{49}{50} \cdot \frac{1}{20}} = \dfrac{18}{67}. The total flagged is 6.7% and the answer is 1867≈0.2687\frac{18}{67} \approx 0.2687.
  5. P(red)=12⋅34+13⋅12+16⋅14=712P(\text{red}) = \frac{1}{2} \cdot \frac{3}{4} + \frac{1}{3} \cdot \frac{1}{2} + \frac{1}{6} \cdot \frac{1}{4} = \frac{7}{12}. Then P(X∣red)=3/8712=914P(X \mid \text{red}) = \dfrac{3/8}{\frac{7}{12}} = \frac{9}{14}.
  6. AA and A′A' form a partition, so P(B)=35⋅14+25⋅12=720P(B) = \frac{3}{5} \cdot \frac{1}{4} + \frac{2}{5} \cdot \frac{1}{2} = \frac{7}{20}. Then P(A∣B)=3/20720=37P(A \mid B) = \dfrac{3/20}{\frac{7}{20}} = \frac{3}{7}.
  7. P(correct)=23⋅1+13⋅14=34P(\text{correct}) = \frac{2}{3} \cdot 1 + \frac{1}{3} \cdot \frac{1}{4} = \frac{3}{4}. P(knew∣correct)=2/334=89P(\text{knew} \mid \text{correct}) = \dfrac{2/3}{\frac{3}{4}} = \frac{8}{9}.
  8. P(heads)=12⋅12+12⋅1=34P(\text{heads}) = \frac{1}{2} \cdot \frac{1}{2} + \frac{1}{2} \cdot 1 = \frac{3}{4}. So the answer is 1/234=23\dfrac{1/2}{\frac{3}{4}} = \frac{2}{3}. (Listing the 44 faces, 33 of which are heads and 22 of those on the two-headed coin, agrees.)

Miscellaneous Examples

460 words · 2 min read

Two dice are rolled. Given that the sum is at least 1010, find the chance that at least one die shows 66. The sum is at least 1010 in 66 outcomes: (4,6),(5,5),(5,6),(6,4),(6,5),(6,6)(4, 6), (5, 5), (5, 6), (6, 4), (6, 5), (6, 6). Five of them contain a 66. So the answer is 56\frac{5}{6}.

Two cards are drawn from a deck without replacement. What is the chance that the second card is an ace? Split by the first card. If the first is an ace (chance 113\frac{1}{13}), the second is an ace with chance 351\frac{3}{51}. If not (chance 1213\frac{12}{13}), it is 451\frac{4}{51}. Total probability gives 113⋅351+1213⋅451=113\frac{1}{13} \cdot \frac{3}{51} + \frac{12}{13} \cdot \frac{4}{51} = \frac{1}{13}. This is the same as the chance that the first card is an ace. (Listing all 26522652 ordered pairs agrees.) Now reverse the question: given that the second card is an ace, the chance that the first was an ace is 113⋅351113=117\dfrac{\frac{1}{13} \cdot \frac{3}{51}}{\frac{1}{13}} = \frac{1}{17}.

Two independent alarms detect a fault with chances 45\frac{4}{5} and 710\frac{7}{10}. Both detect: 45⋅710=1425\frac{4}{5} \cdot \frac{7}{10} = \frac{14}{25}. Neither detects: 15⋅310=350\frac{1}{5} \cdot \frac{3}{10} = \frac{3}{50}. At least one detects: 1−350=47501 - \frac{3}{50} = \frac{47}{50}. Exactly one detects: 45⋅310+15⋅710=1950\frac{4}{5} \cdot \frac{3}{10} + \frac{1}{5} \cdot \frac{7}{10} = \frac{19}{50}. The three cases (both, exactly one, neither) form a partition: 1425+1950+350=1\frac{14}{25} + \frac{19}{50} + \frac{3}{50} = 1.

Bag II has 33 red and 22 blue balls. Bag IIII has 22 red and 33 blue balls. One ball is moved at random from bag II to bag IIII, and then a ball is drawn from bag IIII. Find the chance that it is red. If it is red, what is the chance that the moved ball was red?

The moved ball is red with chance 35\frac{3}{5}. Then bag IIII has 33 red out of 66, so the chance of red is 12\frac{1}{2}. The moved ball is blue with chance 25\frac{2}{5}. Then bag IIII has 22 red out of 66, so the chance is 13\frac{1}{3}. So P(red)=35⋅12+25⋅13=1330P(\text{red}) = \frac{3}{5} \cdot \frac{1}{2} + \frac{2}{5} \cdot \frac{1}{3} = \frac{13}{30}. By Bayes' theorem, P(moved red∣drawn red)=3/101330=913P(\text{moved red} \mid \text{drawn red}) = \dfrac{3/10}{\frac{13}{30}} = \frac{9}{13}.

Suppose P(F)=12P(F) = \frac{1}{2}, P(E∣F)=15P(E \mid F) = \frac{1}{5} and P(E)=14P(E) = \frac{1}{4}. Then P(E∩F)=P(F) P(E∣F)=110P(E \cap F) = P(F)\,P(E \mid F) = \frac{1}{10}. Next, P(E∪F)=14+12−110=1320P(E \cup F) = \frac{1}{4} + \frac{1}{2} - \frac{1}{10} = \frac{13}{20}. And P(F∣E)=P(E∩F)P(E)=1101/4=25P(F \mid E) = \dfrac{P(E \cap F)}{P(E)} = \dfrac{\frac{1}{10}}{1/4} = \frac{2}{5}. Notice that P(E∣F)≠P(F∣E)P(E \mid F) \ne P(F \mid E).

*Miscellaneous Exercise on Chapter 13*

468 words · 2 min read
  1. A fair coin is tossed 33 times. Given that the three results are not all the same, find the chance of at least two heads.
  2. Two cards are drawn from a deck without replacement. Find the chance that both have the same suit.
  3. Two dice are rolled. Given that neither die shows a 66, find the chance that the sum is even.
  4. AA and BB are independent events with P(A)=12P(A) = \frac{1}{2} and P(A∪B)=35P(A \cup B) = \frac{3}{5}. Find P(B)P(B).
  5. A box holds new, used and old batteries in the proportions 14\frac{1}{4}, 12\frac{1}{2} and 14\frac{1}{4}. They last a full year with chances 910\frac{9}{10}, 35\frac{3}{5} and 15\frac{1}{5}. A battery picked at random lasts a full year. What is the chance that it was a new one?
  6. Two dice are rolled. EE is "the first die is even" and FF is "the sum is 77". Show that EE and F′F' ("the sum is not 77") are independent.
  7. A fair coin is tossed 33 times. Find the chance of three heads, given that the first toss is heads.
  8. A bag has 55 red and 55 blue balls. Three balls are drawn without replacement. Find the chance that all three have the same colour.

Answers

  1. The outcomes that are not all the same: 66 of the 88 (all except HHH and TTT). Three of those have exactly two heads (HHT, HTH, THH); none has more. So the answer is 12\frac{1}{2}.
  2. Whatever the first card is, 1212 of the remaining 5151 cards have its suit. The answer is 1251=417\frac{12}{51} = \frac{4}{17}. (Listing all 26522652 ordered pairs agrees.)
  3. With no 66, each die shows 11 to 55: 2525 outcomes. The sum is even when both are odd (3×3=93 \times 3 = 9) or both are even (2×2=42 \times 2 = 4). So 1325\frac{13}{25}, that is 1325\frac{13}{25}.
  4. For independent events, P(A∪B)=P(A)+P(B)−P(A) P(B)=12+12P(B)P(A \cup B) = P(A) + P(B) - P(A)\,P(B) = \frac{1}{2} + \frac{1}{2}P(B). So 12P(B)=35−12=110\frac{1}{2}P(B) = \frac{3}{5} - \frac{1}{2} = \frac{1}{10} and P(B)=15P(B) = \frac{1}{5}. Check: 12+15−110=35\frac{1}{2} + \frac{1}{5} - \frac{1}{10} = \frac{3}{5}.
  5. P(lasts)=940+1240+240=2340P(\text{lasts}) = \frac{9}{40} + \frac{12}{40} + \frac{2}{40} = \frac{23}{40}. P(new∣lasts)=9/402340=923P(\text{new} \mid \text{lasts}) = \dfrac{9/40}{\frac{23}{40}} = \frac{9}{23}.
  6. P(E)=12P(E) = \frac{1}{2} and P(F′)=56P(F') = \frac{5}{6}, so the product is 512\frac{5}{12}. P(E∩F′)=512P(E \cap F') = \frac{5}{12} by counting (1818 even-first outcomes minus the 33 with sum 77, giving 1515 of 3636). They are equal, so EE and F′F' are independent.
  7. Given the first toss is heads, the other two tosses are free: the chance both are heads is 12⋅12=14\frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4}.
  8. All red: 510⋅49⋅38=112\frac{5}{10} \cdot \frac{4}{9} \cdot \frac{3}{8} = \frac{1}{12}. All blue: the same. Total 112+112=16\frac{1}{12} + \frac{1}{12} = \frac{1}{6}. (Listing all 720720 ordered draws agrees.)

Summary

165 words · 1 min read
  • Conditional probability: P(E∣F)=P(E∩F)P(F)P(E \mid F) = \dfrac{P(E \cap F)}{P(F)}, for P(F)≠0P(F) \ne 0. Equivalently, count only the outcomes in FF.
  • Properties: 0≤P(E∣F)≤10 \le P(E \mid F) \le 1; P(F∣F)=1P(F \mid F) = 1; P(E′∣F)=1−P(E∣F)P(E' \mid F) = 1 - P(E \mid F); P((E∪G)∣F)=P(E∣F)+P(G∣F)−P((E∩G)∣F)P\big((E \cup G) \mid F\big) = P(E \mid F) + P(G \mid F) - P\big((E \cap G) \mid F\big).
  • Multiplication theorem: P(E∩F)=P(E) P(F∣E)=P(F) P(E∣F)P(E \cap F) = P(E)\,P(F \mid E) = P(F)\,P(E \mid F). For three events, P(E∩F∩G)=P(E) P(F∣E) P(G∣E∩F)P(E \cap F \cap G) = P(E)\,P(F \mid E)\,P(G \mid E \cap F).
  • Independent events: P(E∩F)=P(E) P(F)P(E \cap F) = P(E)\,P(F), which means P(E∣F)=P(E)P(E \mid F) = P(E). Complements of independent events are independent. Mutually exclusive events with non-zero probability are never independent.
  • Three events are mutually independent only if every pair is independent and P(A∩B∩C)=P(A) P(B) P(C)P(A \cap B \cap C) = P(A)\,P(B)\,P(C).
  • Partition: events E1,…,EnE_1, \dots, E_n that are separate, complete and possible. Their probabilities add up to 11.
  • Total probability: P(A)=∑P(Ei) P(A∣Ei)P(A) = \sum P(E_i)\,P(A \mid E_i).
  • Bayes' theorem: P(Ei∣A)=P(Ei) P(A∣Ei)∑jP(Ej) P(A∣Ej)P(E_i \mid A) = \dfrac{P(E_i)\,P(A \mid E_i)}{\sum_j P(E_j)\,P(A \mid E_j)}.
  • Do not confuse P(A∣E)P(A \mid E) with P(E∣A)P(E \mid A).

*Historical Note*

295 words · 1 min read

Probability grew out of questions about games of chance, and it took several centuries to become a full branch of mathematics.

  • Early traces. Written remarks about the chances in dice games appear as early as the 15th century, for example in a commentary on Dante's Divine Comedy.
  • Girolamo Cardano (1501–1576) wrote a book on games of chance in which he counted the favourable cases for the totals of two dice. It was published after his death, in 1663.
  • Galileo Galilei (1564–1642) explained why, with three dice, a total of 1010 comes up more often than a total of 99. We can check his reasoning: out of 216 equally likely outcomes, there are 2727 ways to make 1010 and only 2525 ways to make 99.
  • 1654: the birth of the theory. Blaise Pascal (1623–1662) and Pierre de Fermat (1601–1665) exchanged letters about a question on how to divide the stakes of an unfinished game fairly. Pascal used algebra and Fermat used counting of combinations. Their correspondence is generally seen as the true beginning of probability theory.
  • Christiaan Huygens (1629–1695) heard about their work and wrote the first printed book on probability, published in 1657.
  • Jacob Bernoulli (1654–1705) wrote Ars Conjectandi ("The Art of Conjecturing"), published after his death in 1713. It contains the first form of the law of large numbers and the study of what we now call the binomial distribution.
  • Thomas Bayes (died 1761) worked out how to reverse a conditional probability. His essay was published after his death, in 1763. The rule you learned in Section 13.5 carries his name.
  • Andrey Kolmogorov (1903–1987) gave probability a firm logical foundation in 1933. He treated probability as a function on sets, with a few simple rules (axioms) from which all the rest follows.
End of book
You have reached the end