Last time we talked about independence of a *pair* of events, but we can easily go on and talk about independence of a longer sequence of events. For example, suppose we have three coins. Suppose:

• the 1st coin has probability of landing heads up and of landing tails up;

• the 2nd coin has probability of landing heads up and of landing tails up;

• the 3rd coin has probability of landing heads up and of landing tails up.

Suppose we flip all of these coins: the 1st, then the 2nd, then the 3rd. What’s the probability that we get this sequence of results:

If the coin flips are *independent*, the probability is just this product:

See the pattern? We just multiply the probabilities. And there’s nothing special about *coins* here, or the number *three*. We could flip a coin, roll a die, pick a card, and see if it’s raining outside.

For example, what’s the probability that we get heads with our coin, the number 6 on our die, an ace of spades with our cards, and it’s raining? *If these events are independent*, we just calculate:

the probability that we get heads, times

the probability that we roll a 6, times

the probability that we get an ace of spades, times

the probability that it’s raining outside.

Let’s solve some puzzles using this idea!

### Three flips of a fair coin

**Example 1.** Suppose you have a **fair** coin: this means it has a 50% chance of landing heads up and a 50% chance of landing tails up. Suppose you flip it three times and these flips are independent. What is the probability that it lands heads up, then tails up, then heads up?

We’re asking about the probability of this event:

Since the flips are independent this is

Since the coin is fair we have

so

So the answer is 1/8, or 12.5%.

**Example 2.** In the same situation, what’s the probability that the coin lands heads up exactly twice?

There are 2 × 2 × 2 = 8 events that can happen:

We can work out the probability of each of these events. For example, we’ve already seen that is

since the coin is fair and the flips are independent. In fact, all 8 probabilities work out the same way. We always get 1/8. In other words, each of the 8 events is equally likely!

But we’re interested in the probability that we get exactly two heads. That’s the probability of this subset:

Using the rule we saw in Part 7, this probability is

So the answer is 3/8, or 37.5%.

I could have done this a lot faster. I could say “there are 8 events that can happen, each equally likely, and three that give us two heads, so the probability is 3/8.” But I wanted to show you how we’re just following rules we’ve already seen!

### Three flips of a very unfair coin

**Example 3.** Now suppose we have an unfair coin with a 90% chance of landing heads up and 10% chance of landing tails up! What’s the probability that if we flip it three times, it lands heads up exactly twice? Again let’s assume the coin flips are independent.

Most of the calculation works exactly the same way, but now our coin has

We’re interested in the events where the coin comes up heads twice, so we look at this subset:

The probability of this subset is

So now the probability is just 24.3%.

### Six flips of a fair coin

**Example 4.** Suppose you have a fair coin. Suppose you flip it six times and these flips are independent. What is the probability that it lands heads up exactly twice?

We did a similar problem already, where we flipped the coin three times. Go back and look at that if you forget! The answer to *that* problem was

Why? Here’s why: there were 3 ways to get two heads when you flipped 3 coins, and each of these events had probability

We can do our new problem the same way. Count the number of ways to get two heads when we flip six coins. Then multiply this by

The hard part is to count how many ways we can get two heads when we flip six coins. To get good at probabilities, we have to get good at counting. It’s boring to list all the events we’re trying to count:

So let’s try to come up with a better idea.

We have to pick 2 out of our 6 flips to be H’s. How many ways are there to do this?

There are 6 ways to pick *one* of the flips and draw a red H on it, and then 5 ways left over to pick *another* and draw a blue H on it… letting the rest be T’s. For example:

So, we’ve got 6 × 5 = 30 choices. But we don’t really care which H is red and which H is blue—that’s just a trick to help us solve the problem. For example, we don’t want to count

as different from

So, there aren’t really 30 ways to get two heads. There are only half as many! There are 15 ways.

So, the probability of getting two heads when we flip the coin six times is

where the squiggle means ‘approximately’. So: about 23.4%.

### Binomial coefficients

Now for some jargon, which will help when we do harder problems like this. We say there are **6 choose 2** ways to choose 2 out of 6 things, and we write this as

This sort of number is called a **binomial coefficient**.

We’ve just shown that

Why write it like this funky fraction: ? Because it’ll help us see the pattern for doing harder problems like this!

### Nine flips of a fair coin

If we flip a fair coin 9 times, and the flips are independent, what’s the probability that we get heads exactly 6 times?

This works just like the last problem, only the numbers are bigger. So, I’ll do it faster!

When we flip the coin 9 times there are possible events that can happen. Each of these is equally likely if it’s a fair coin and the flips are independent. So each has probability

To get the answer, we need to multiply this by the number of ways we can get heads exactly 6 times. This number is called ‘9 choose 6’ or

for short. It’s the number of ways we can choose 6 things out of a collection of 9.

So we just need to know: what’s 9 choose 6? We can work this out as before. There are 9 ways to pick *one* of the flips and draw a red H on it, then 8 ways left to pick *another* and draw a blue H on it, and 7 ways left to pick *a third* and draw a orange H on it. That sounds like 9 × 8 × 7.

But we’ve overcounted! After all, we don’t care about the colors. We don’t care about the difference between this:

and this:

In fact we’ve counted each possibility 6 times! Why six? The first H could be red, green or blue—that’s 3 choices. But then the second H could be either of the two remaining 2 colors… and for the third, we just have 1 choice. So there are 3 × 2 × 1 = 6 ways to permute the colors.

So, the *actual* number of ways to get 6 heads out of 9 coin flips is

In other words:

To get the answer to our actual problem, remember we need to multiply by this. So the answer is

If you’re a pure mathematician, you can say you’re done now. But normal people won’t understand this answer, so let’s calculate it out. I hope you know the first ten powers of two: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. So:

I hope you can also do basic arithmetic like this:

So, the probability of getting 6 heads when you do 9 independent flips of a fair coin is

or 16.4025%. I broke down and used a calculator at the last step. We’re becoming serious nerds here.

Okay, that’s enough for now. We’ve been counting how many ways we can get a certain number of heads from a certain number of coin flips. What we’re realy doing is taking a set of coin flips, say of them, and choosing a subset of of them to be heads. So, we say

**Definition.** The **binomial coefficient**

called ** choose ** is the number of ways of choosing a subset of things from a set of things.

We have seen in some examples that

Here there’s a product of consecutive numbers on top, and on bottom too. We didn’t prove this is true in general, but it’s not hard to see, using the tricks we’ve used already.

In the example 2, there’s a missing “heads” in the question.

Also, in the next sentence, it’s written 2 x 2 x = 8 without the last 2.

Thanks very much! Fixed.

After you introduce binomial coefficient you write 5 choose 2 equals 6×5 / 2×1 which is an obvious typo.

Thanks. I really appreciate it when people catch mistakes in these notes, since someday they may evolve into a book.

Fixed!

I still see it in the same place. Just after “We’ve just shown that”

Whoops. I’m trying to eliminate all references to ‘5 choose 2’ and replace them with ‘6 choose 2’, since that’s the problem I’m talking about here. I found and fixed a lot of them but not the one you actually mentioned! Now that’s fixed.

In your “9 flips, 6 heads” example, you don’t compute , but rather . You pick out a red head, a blue head, and an orange head to get 9*8*7 in the numerator, and then claim you are overcounting by a factor of 3*2*1.

I know , so you get the right answer in either case, but you never mention that fact about binomial coefficients.

Dear John,

In the last paragraph, there is a major flaw: the number of factors in the numerator should be , too!

Thanks, I fixed that.