PROBABILITY
Chapter 13: Probability
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
You already know the basic idea of probability. An experiment has several possible outcomes. The set of all outcomes is the sample space . An event is a collection of outcomes, that is, a subset of . When all outcomes are equally likely,
where is the number of outcomes in and the number in .
Roll two dice, one after the other. There are equally likely outcomes, from to . Let be the event "the sum is ". The outcomes are , so and
A grid of 36 dots. The horizontal axis is the number on the first die, from 1 to 6. The vertical axis is the number on the second die, from 1 to 6. Five dots lie on a diagonal line and are drawn in orange: (2, 6), (3, 5), (4, 4), (5, 3) and (6, 2). These are the outcomes with sum 8. The other 31 dots are grey.
- , with and .
- Complement: , where means " does not happen". Here .
- Addition rule: , where means " or (or both)" and means " and ".
Check the addition rule. Let be "the first die shows ". Then , and "both" happens only for , so . So . Counting the outcomes directly gives the same answer, .
Suppose someone tells you a clue about the outcome: "at least one die shows a ". 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
A clue changes what is possible. Roll two dice, and suppose you are told: "at least one die shows a ". Call this event . Now only the outcomes with a are still possible. There are 11 of them. The sum is () in only 2 of these: and . So, given , the chance of is \frac{2}{11}.
The same grid of 36 dots as before, now in three colours. Eleven teal dots are the outcomes where at least one die shows 6, which lie in the top row and the right-hand column. Two of these, (2, 6) and (6, 2), are orange: they also have sum 8. The other 25 dots are pale grey and are ruled out by the clue.
We write this as , read "the probability of given ". We can calculate it in two equivalent ways:
- Shrink the sample space. Count only the outcomes in : .
- Use probabilities. Divide the chance of "both" by the chance of the clue:
Check: and , so , the same as before. The condition is needed because you cannot be given a clue that can never happen.
A bag holds red and 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, balls are left, and of them are red. So the answer is . The computer listed all ordered draws and agrees: .
- A card is drawn from a standard deck of . Given that it is a face card (jack, queen or king; cards), the chance that it is a king is .
- Given that the card is red, the chance that it is a heart is .
- Given that the card is a heart, the chance that it is red is . A heart is always red.
- Toss a fair coin times. Given that the first toss is heads, what is the chance of at least heads in total?
- Roll a die. Given that the number is even, what is the chance it is ?
- Draw a card from a deck. Given that it is a spade, what is the chance it is an ace?
- A bag has red and blue balls. Two are drawn without replacement. Given that the first is blue, what is the chance the second is blue?
Answers
- . The four outcomes that start with heads are HHH, HHT, HTH, HTT, and three of them have at least two heads.
- . The even numbers are , and one of the three is a .
- . Each suit has cards and exactly one ace.
- . Five blue balls remain among .
13.2.1 Properties of conditional probability
Once the clue is known, 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 : "the card is red" ( cards). Let be "the card is a king" and "the card is a heart". Every value was found by counting.
- Property 1. , and . Example: , and .
- Property 2 (addition rule). . Example: , , and (only the king of hearts). So the right side is . Counting the red cards that are kings or hearts ( out of ) gives .
- Property 3 (complement). . Example: the chance that a red card is not a king is , and counting ( out of ) gives .
- Property 4 (disjoint events). If and cannot happen together, then . Example: let be "the card is an ace". Kings and aces are disjoint, so .
- 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
- and . They add up to , as Property 3 says.
EXERCISE 13.1
- Two dice are rolled. Find the probability that the sum is , given that the first die shows .
- Two dice are rolled. Find the probability that the sum is , given that the two dice show different numbers.
- 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.
- A fair coin is tossed times. Find the probability of exactly heads, given that at least one toss is heads.
- A bag has red and 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.
- Two dice are rolled. Find the probability that the sum is or more, given that the first die shows .
- Two dice are rolled. Let be "the first die shows " and "the sum is or more". Calculate and and show that they are different.
- A box holds items, of which 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
- Given the first die is , there are equally likely outcomes. Only has sum . So the answer is .
- There are outcomes with different numbers. Six of them have sum : . The answer is .
- (a) : of the black cards are spades. (b) : of the black cards are kings.
- At least one head: outcomes (all except TTT). Exactly two heads: HHT, HTH, THH. The answer is .
- and . So .
- With a on the first die, the sum is or more only when the second die is or . So .
- has outcomes. Four of them have a first: . So . has outcomes, and the same lie in , so . They are different.
- After one faulty item is removed, items remain and of them are faulty. The answer is . (The computer listed all ordered pairs and agrees.)
13.3 Multiplication Theorem on Probability
Sometimes you want the chance that two things both happen: first , then . Rearranging the definition gives the multiplication theorem:
In words: the chance of " and then " is the chance of , times the chance of once has happened. Reversing the roles gives as well.
A bag has red and blue balls. Two balls are drawn without replacement. Find the chance that both are red. The first is red with chance . Given that, the second is red with chance . So
Listing all ordered draws by computer gives the same .
The rule extends to more events: . A bag has red and blue balls. Three balls are drawn without replacement. Find the chance of "red, then blue, then red". Multiply: . Every time a ball is removed, the numbers in the next fraction change. Listing all ordered draws agrees: .
Two cards are drawn from a deck without replacement. The chance that both are aces is . The computer listed all ordered pairs and agrees: .
If the first ball is put back before the second draw, the bag is the same each time. For the bag in Example 1, . This is larger than from Example 1, because a red ball is still available to be drawn again.
- Three cards are drawn from a deck without replacement. Find the chance that all three are hearts.
- A bag has red and blue balls. Two balls are drawn without replacement. Find the chance of red first and blue second.
- A die is rolled twice. Find the chance that the first roll is even and the second roll is more than .
- A fair coin is tossed three times. Find the chance of three heads.
Answers
- .
- .
- . (The second roll does not depend on the first.)
- .
13.4 Independent Events
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 and are independent when knowing one has happened does not change the chance of the other:
Putting this into the multiplication theorem gives the working test for independence:
(If and , the two statements are equivalent.) Events that are not independent are called dependent.
Roll two dice. Let be "the first die is even" and "the sum is ". Then , , and has three outcomes, , so . And . The two are equal, so and 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 .
The grid of 36 dice outcomes in four colours. The outcomes where the first die is even (2, 4 or 6) form three columns and are teal, except for three outcomes that are also on the sum-7 diagonal, which are orange: (2, 5), (4, 3) and (6, 1). The remaining outcomes on the sum-7 diagonal, (1, 6), (3, 4) and (5, 2), are purple. All other dots are pale grey.
Keep = "the first die is even" but let now be "the sum is ". Then , , and (the outcomes ). But , which is not . So these events are dependent: an even first die makes a sum of more likely.
Toss a coin and roll a die ( outcomes). Let be "heads" and "the die is even". Then , , , and . 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: , , and .
Two events are mutually exclusive if they cannot happen together, so . If both have non-zero probability, then , 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 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 and are independent, so are and (and and , and and ). In Example 1, the event "the sum is not " is also independent of "the first die is even": the computer confirms it. This matches common sense: if a clue about does not help, a clue about "not " does not help either.
Three events are mutually independent only if every pair is independent and . Pairwise independence is not enough. Toss two coins. Let = "first is heads", = "second is heads", = "the two coins match". Each pair is independent (each pair has probability ). But , while . So the three events are not mutually independent.
- Two dice are rolled. Are "the first die shows or " and "the sum is " independent?
- A card is drawn. Are "it is a heart" and "it is a face card" independent?
- A coin is tossed times. Are "at least two heads" and "the first toss is heads" independent?
Answers
- Yes. and for the two events, and .
- Yes. , , , and the product of the first two is .
- No. , , but , which is not .
EXERCISE 13.2
- Two dice are rolled. Are the events "the first die is odd" and "the sum is " independent?
- Two dice are rolled. Are "the first die shows or " and "the sum is " independent?
- A card is drawn from a deck. Are "the card is a heart" and "the card is a face card" independent?
- A fair coin is tossed times. Are "at least two heads" and "the first toss is heads" independent?
- A coin is tossed and a die is rolled. Find the probability of heads and a number greater than .
- and are independent events with and . Find , , and the probability that neither happens.
- A machine has independent parts, and each works with probability . Find the probability that (a) all three work, (b) at least one works.
- A die is rolled once. Let be "the number is " and "the number is ". Are and mutually exclusive? Are they independent?
Answers
- No. , , and (the outcomes and ). But .
- Yes. , , (the outcomes and ), and .
- Yes. , , and , which equals .
- No. and , so the product is . But .
- The coin and die are independent: . (Listing all outcomes agrees.)
- . . Neither: . Check: .
- (a) . (b) The only way none works is , so the answer is .
- They are mutually exclusive (). They are not independent: is not . Exclusive events with non-zero probabilities are always dependent.
13.5 Bayes' Theorem
So far you calculated the chance of an effect when the cause was known. For example: "machine 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 , and you want . 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).
13.5.1 Partition of a sample space
A set of events is a partition of the sample space if:
- the events are complete: together they cover all of , that is ;
- the events are separate: no two of them can happen together, that is for ;
- each event is possible: for every .
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 ", "the sum is ", and "the sum is more than " form a partition. Their probabilities are , and , 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" ( of the deck), "face cards" () and "number cards from to " ().
- Any event with , together with its complement , forms a partition. (Checked for = "the sum is ".)
The probabilities of the events in a partition always add to , because every outcome is counted exactly once.
- "The first die is less than " and "the second die is less than ". These overlap: is in both. They also do not cover everything: is in neither.
- "The sum is " and "the sum is ". They are separate, but they do not cover all outcomes (for example the sum is missing).
- "The first die is less than " and "the first die is more than ". The second event is impossible, so it is not allowed in a partition.
Roll two dice. Which of these pairs or triples of events are partitions?
- "the first die is or ", "the first die is or ", "the first die is or ";
- "the sum is at most ", "the sum is at least ";
- "the sum is even", "the sum is odd".
Answers
- Yes. Each first-die number is in exactly one of the three events.
- No. They overlap: the sum is in both.
- Yes. Every sum is either even or odd, never both.
13.5.2 Theorem of total probability
Let be a partition of , with for each , and let be any event. Because the are complete and separate, the event splits into separate pieces . Adding their probabilities and using the multiplication theorem on each piece gives the theorem of total probability:
In words: the chance of 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 balls. Bag has red and blue. Bag has red and blue. Bag has red and 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 . The chance of red inside each bag is , , . So
Listing all balls (each equally likely to be the one drawn) gives as well.
A tree diagram that starts at a point on the left and splits into three branches, one for each bag: Bag A, Bag B and Bag C, each with probability one third. Each bag splits again into a red branch and a blue branch. The leaf labels give the chance of that colour in the bag and the chance of the whole path. The red paths are: Bag A one fifth, Bag B one fifteenth, Bag C four fifteenths. These three red paths add up to eight fifteenths.
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 ? Start from the definition of conditional probability, and use the multiplication theorem on the top and total probability on the bottom:
This is Bayes' theorem. The numerator is the chance of the path through to . The denominator is the chance of all paths to . 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: . In the same way and . These three add up to , as they must. Direct counting among the red balls out of confirms the value for : . Notice that bag started with chance and, after seeing a red ball, its chance rose to .
A factory has three machines. Machine makes half of all items (), machine makes and machine makes . The fractions of defective items are , and . An item is chosen at random and is found to be defective. Which machine most likely made it?
| Machine | Share | Defective rate | Product | After the check |
|---|---|---|---|---|
The products add up to , that is 4.5% of all items are defective. Dividing each product by this total gives the last column: , and . Machine makes the fewest items, but it makes the most defective ones, so it is the most likely source.
A bar chart with three groups for Machine 1, 2 and 3. In each group the left bar is the prior chance that an item came from that machine, and the right bar is the chance after the item is found to be defective. For Machine 1 the bars go from 0.50 down to 0.22. For Machine 2 they are 0.30 and 0.33. For Machine 3 they go from 0.20 up to 0.44.
Suppose of the components in a batch are faulty. A test flags of faulty components, but it also flags of good ones by mistake. A component is flagged. What is the chance that it is really faulty? Most people guess about . Count in a batch of :
- Faulty components: . The test flags of them.
- Good components: . The test flags of them by mistake.
- Total flagged: . Only of these are faulty.
So , about 19.3%. Bayes' theorem gives the same: . The surprise comes from the fact that good components are far more common, so even a small mistake rate flags many of them.
EXERCISE 13.3
- Box has red and blue balls. Box has red and blue balls. A fair coin decides the box (heads: , tails: ), 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 .
- Production line makes of the items of a factory and line makes . Of the items from , are defective, and of the items from , 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 ?
- A die is rolled. If it shows or , a ball is drawn from bag (which has red and blue balls). Otherwise a ball is drawn from bag ( red and blue). (a) Find the chance of red. (b) Given red, find the chance that bag was used.
- of the components in a batch are faulty. A test flags of the faulty components and wrongly flags of the good ones. A component is flagged. What is the chance it is faulty?
- A die is rolled. If it shows , or use bag ; if or use bag ; if use bag . The chance of drawing a red ball is from , from and from . A red ball is drawn. Find the chance it came from .
- For events and : , and . Find and .
- In a multiple-choice test, a student knows the answer to a question with chance . Otherwise the student guesses among choices. Find the chance that an answer is correct, and the chance that the student really knew the answer given that it is correct.
- 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
- (a) . (b) . (Listing all balls agrees with both.)
- (a) , that is 2.9%. (b) .
- (a) . (b) .
- . The total flagged is 6.7% and the answer is .
- . Then .
- and form a partition, so . Then .
- . .
- . So the answer is . (Listing the faces, of which are heads and of those on the two-headed coin, agrees.)
Miscellaneous Examples
Two dice are rolled. Given that the sum is at least , find the chance that at least one die shows . The sum is at least in outcomes: . Five of them contain a . So the answer is .
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 ), the second is an ace with chance . If not (chance ), it is . Total probability gives . This is the same as the chance that the first card is an ace. (Listing all ordered pairs agrees.) Now reverse the question: given that the second card is an ace, the chance that the first was an ace is .
Two independent alarms detect a fault with chances and . Both detect: . Neither detects: . At least one detects: . Exactly one detects: . The three cases (both, exactly one, neither) form a partition: .
Bag has red and blue balls. Bag has red and blue balls. One ball is moved at random from bag to bag , and then a ball is drawn from bag . 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 . Then bag has red out of , so the chance of red is . The moved ball is blue with chance . Then bag has red out of , so the chance is . So . By Bayes' theorem, .
Suppose , and . Then . Next, . And . Notice that .
*Miscellaneous Exercise on Chapter 13*
- A fair coin is tossed times. Given that the three results are not all the same, find the chance of at least two heads.
- Two cards are drawn from a deck without replacement. Find the chance that both have the same suit.
- Two dice are rolled. Given that neither die shows a , find the chance that the sum is even.
- and are independent events with and . Find .
- A box holds new, used and old batteries in the proportions , and . They last a full year with chances , and . A battery picked at random lasts a full year. What is the chance that it was a new one?
- Two dice are rolled. is "the first die is even" and is "the sum is ". Show that and ("the sum is not ") are independent.
- A fair coin is tossed times. Find the chance of three heads, given that the first toss is heads.
- A bag has red and blue balls. Three balls are drawn without replacement. Find the chance that all three have the same colour.
Answers
- The outcomes that are not all the same: of the (all except HHH and TTT). Three of those have exactly two heads (HHT, HTH, THH); none has more. So the answer is .
- Whatever the first card is, of the remaining cards have its suit. The answer is . (Listing all ordered pairs agrees.)
- With no , each die shows to : outcomes. The sum is even when both are odd () or both are even (). So , that is .
- For independent events, . So and . Check: .
- . .
- and , so the product is . by counting ( even-first outcomes minus the with sum , giving of ). They are equal, so and are independent.
- Given the first toss is heads, the other two tosses are free: the chance both are heads is .
- All red: . All blue: the same. Total . (Listing all ordered draws agrees.)
Summary
- Conditional probability: , for . Equivalently, count only the outcomes in .
- Properties: ; ; ; .
- Multiplication theorem: . For three events, .
- Independent events: , which means . 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 .
- Partition: events that are separate, complete and possible. Their probabilities add up to .
- Total probability: .
- Bayes' theorem: .
- Do not confuse with .
*Historical Note*
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 comes up more often than a total of . We can check his reasoning: out of 216 equally likely outcomes, there are ways to make and only ways to make .
- 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.