3.2 Coin Flipping
We'll start with some simple examples of coin flipping, asking some simple questions, and move to more complex observations and unintuitive conclusions.
Example 2 What is the probability of flipping thirty heads in a row, with a fair coin?
Show solution
Our intuition will clearly insist that this will be a very small number, but how small? Our first method, of listing all of the possibilities gets quite a bit cumbersome with this question. The second method is quite straightforward
This is virtually impossible (Table 1.1).
Example 3 What is the probability of flipping two heads in three flips, with a fair coin?
Show solution
Our intuition suggests that this should be a reasonably common occurrence. We address this problem in exactly the same two ways: first, by counting, the second with the rules of probability. In the first method, we observe from the table that there are three ways of getting two heads: “T H H,” “H T H,” and “H H T.” Thus,
In the second method we write
from which we can apply the sum rule for exclusive events (Equation 1.11) and, like before, the product rule for independent events (Equation 1.9),
which is about a 38% chance, slightly unlikely (Table 1.1).
Example 4 What is the probability of flipping ten heads in thirty flips, with a fair coin?
Show solution
Once the numbers start getting large, our intuition fails, and we can't list all the possibilities. In order to proceed, we need to develop a systematic way of approaching these sorts of problems. Essentially it comes down to two parts:
- What is the probability of one particular sequence being considered?
- How many ways can this type of sequence appear in the process described in the question?
Point 1 is asking, what is the probability of this particular sequence:
H H H H H H H H H H T T T T T T T T T T T T T T T T T T T T
or this sequence:
T T H T T T T H H H H T T T T T H T T H T T T T T T H H T H
Although it is unintuitive, mathematically both of these specific sequences have exactly the same probability: each head or tail has equal probability, is not related to the others, and there are the same number of them. So we have
Every single specific length-thirty sequence of heads and tails has the same probability, one in a billion.
Point 2 is asking, how many sequences are there of thirty heads and tails where ten of them are heads? Another way of phrasing it is, given a sequence like:
H H H H H H H H H H T T T T T T T T T T T T T T T T T T T T
how many different ways can I rearrange this sequence and get a unique sequence?
Counting the Rearrangements
We are going to determine the answer to our question in small steps.
Note
Symbols: A B C D
First, we ask,
Note
Boxes: □ □ □ □
Note
| Choices | Remaining Symbols |
|---|---|
| A □ □ □ | B C D |
| B □ □ □ | A C D |
| C □ □ □ | A B D |
| D □ □ □ | A B C |
Example 5 How many ways can we rearrange the unique symbols A, B, C, and D?
Show solution
To make this intuitive, we set up four empty boxes and we imagine placing our symbols in the boxes, one at a time. How many choices do we have? For the first box, we have four choices. For each of these choices, we've removed one of the symbols, and one of the boxes. Thus, we are left with three remaining symbols for each choice, and three remaining boxes. For each of the original four choices, we now have three choices for the second box. This immediately leads to possibilities by the time we've filled two boxes. For each of these twelve possibilities, there are two symbols remaining and two boxes. Continuing this logic, we have two choices for the third box, and then only one choice for the final box. In summary, for each of the four choices for the first box we have three choices for the second, two choices for the third, and one for the final box. Thus we have
Note
| Choices | Remaining Symbols |
|---|---|
| A B □ □ | C D |
| A C □ □ | B D |
| A D □ □ | B C |
| B A □ □ | C D |
| B C □ □ | A D |
| B D □ □ | A C |
| C A □ □ | B D |
| C B □ □ | A D |
| C D □ □ | A B |
| D A □ □ | B C |
| D B □ □ | A C |
| D C □ □ | A B |
In general we have
Number of Rearrangements of Unique Symbols where we've introduced the notation for the factorial of as .
Note
Number of Rearrangements of Unique Symbols
Example 6 How many ways can we rearrange the symbols A, A, A, and D?
Show solution
By eye we can see that there are only four rearrangements of these symbols. How is this different from the previous question with four symbols? We can imagine going from the first question, with four unique symbols “A B C D,” and replace both “B” and “C” with “A” to get it. “BC” and “CB” are different sequences of unique symbols. However, if we replace “B” with an “A” and “C” with an “A”, both sequences become the same sequence, namely “AA”. If we try to blindly apply Equation 3.1, the one for the number of rearrangements of unique symbols, to the case where there are duplicates, we will overestimate the number of rearrangements - we are over counting duplicate subsequences. Further, we can be specific about how much we are over counting and thus find a new equation which includes the possibility of duplicates.
Note
Symbols: A A A D
Note
| Rearrangements |
| D A A A |
| A D A A |
| A A D A |
| A A A D |
For example, if we have three duplicates in a sequence, the number of over countings will be the number of possible rearrangements of three unique symbols, because all of these rearrangements result in the same sequence of duplicate symbols. Thus, our procedure should be,
Example 7 How many ways are there of rearranging the symbols “A A A D D”?
Show solution
Following the same logic, we have
Note
All possible results of rearranging the symbols “A A A D D”:
| 1 | A A D D A |
|---|---|
| 2 | D A A D A |
| 3 | A D A D A |
| 4 | D A A A D |
| 5 | D A D A A |
| 6 | A A D A D |
| 7 | D D A A A |
| 8 | A D D A A |
| 9 | A A A D D |
| 10 | A D A A D |
Sequences of Heads and Tails
Now we can return to our original question,
Example 8 What is the probability of flipping ten heads in thirty flips, with a fair coin?
Show solution
We broke it down into two parts:
- What is the probability of one particular sequence being considered?
- How many ways can this type of sequence appear in the process described in the question?
Because we have a length-thirty sequence of “H” and “T” with 10 duplicate “H” symbols and 20 duplicate “T,” we have the following number of ways that this could occur (i.e. the number of rearrangements of these sequences):
So the probability of flipping 10 heads in 30 flips is
Try it in XYZ Crunch
The binomial panel does both halves of this at once
The book multiplies 30,045,015 rearrangements by the one-in-a-billion probability of any single length-30 sequence. The distributions panel does the counting and the multiplying together, but it reports the CUMULATIVE probability P(X <= k), so open both links and subtract: 0.049369 - 0.021387 = 0.027982, the book's 0.028. Then drag k around to see how quickly the probability falls away from 15.
which is extremely unlikely (Table 1.1).
In general we have
Probability of flipping heads and tails Given the probability of flipping a single heads as 1/2, and the total number of flips is , we have the following equivalent forms:
where we have introduced the notation that is sometimes used, called choose, read as “N choose h,”
Note
Probability of flipping heads and tails
Given the probability of flipping a single heads as 1/2, and the total number of flips is , we have the following probability for heads and tails:
Shown in Figure 3.1 is the probability of flipping heads in 30 flips, for each value of from (no heads or, in other words, 30 tails) up to (all 30 heads). Clearly the most likely value is 15, but all of the numbers from 12 up to 18 have significant probability.
Example 9 What is the probability of getting 17 or more heads in 30 flips?
Show solution
Because these are independent events, we can simply sum up the terms for , , etc... yielding the following, either through direct calculation, or by reading the Figure 3.1.
Try it in XYZ Crunch
One lookup instead of seven terms
The book adds 0.11 + 0.08 + 0.05 + 0.028 + 0.013 + 0.005 + 0.002 and some tiny numbers to reach 0.29. The panel gives P(at most 16 heads) = 0.707668 in one step, and 1 - 0.707668 = 0.292332 is the same answer with the tiny numbers already in it.
which is quite likely!
Adapted from Statistical Inference for Everyone, by Brian Blais (Bryant University), licensed under CC BY-SA 4.0 (dual-licensed under the GNU FDL 1.2 or later; this adaptation uses the CC BY-SA grant). Changes were made; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.