Main content

## Statistics and probability

### Course: Statistics and probability > Unit 8

Lesson 4: Combinatorics and probability- Probability using combinations
- Probability & combinations (2 of 2)
- Example: Different ways to pick officers
- Example: Combinatorics and probability
- Getting exactly two heads (combinatorics)
- Exactly three heads in five flips
- Generalizing with binomial coefficients (bit advanced)
- Example: Lottery probability
- Probability with permutations and combinations
- Conditional probability and combinations
- Mega millions jackpot probability
- Birthday probability problem

© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Exactly three heads in five flips

Probability of exactly 3 heads in 5 flips using combinations. Created by Sal Khan.

## Want to join the conversation?

- How can I calculate the probability of getting at least 3 heads in 5 flips of a fair coin? So what is the probability of 3 or more heads?(24 votes)
- "At least 3 heads" would be P(3) + P(4) + P(5) = 10/32 + 5/32 + 1/32 = 16/32 = .5 = 50%. i.e. there are 10 ways to get exactly 3, 5 ways to get exactly 4, and 1 way to get exactly 1; or a total of 16 ways out of a total of 32 possibilities.(75 votes)

- How can you get the same answer using the combination formula n!/k!(n-k)!?

I am have been confused because he continues to switch between both methods randomly and I can't seem to get the formula to work.(15 votes)- Okay. Here's the main formual you'll get in your math class:

n! / r! (n-r)!

n stands for the total number of items

r stands for the number of items that are going to be used, organized, picked etc.

So... If you have a class of 10 kids and only 3 people can earn 1st, 2nd, and 3rd place; then you're n value would be 10 and your r value would be 3.

This would give you the equation: 10! / (10-3)!

that equals: 10! / 7!

You can then say 10 * 9 * 8 * 7! / 7!

factor out the 7! and you're left with 10*9*8 which equal 720. :)

That's just permutations.

In combinations, the order of what you're choosing doesn't matter. For example, you can order any 3 of the 5 toppings for you pizza. It doesn't matter what order the toppings go on, as long as they go on. So, n would equal 5 and r would equal 3.

However, you're formula will have changed.

This time is will be:

n! / r! (n-r)!

So your problem will look like so:

5! / 3! (5-3)!

You reduce to 5! / 3! * 2!

Factor out the 3! to get 5*4/ 2!

20/2 = 10

So you have 10 different arrangements of topping to choose from. :)

It's very helpful to memorize the two different formulas, so here they are again:

Permutations: n! / (n-r)! (here the order of your items does matter)

Combinations: n! / r! (n-r)! (the order your items are put on/used does not matter)(26 votes)

- What if the coin is unfair (ex. it lands on heads 80% of the time)? How would we calculate the probability of getting 3 heads in 5 flips?(2 votes)
- Then that would be (8/10)*(8/10)*(8/10)*(2/10)*(2/10)=0,02048 -- but that is for a specific case, where the first three of the flips land in heads and the rest in tails. now we need to add all the other possible arrengments. in this case the are 10 possible outcomes where we have 3 heads----(0,02048)*10=20.48%.(8 votes)

- what about order of tails? For example Ha Hb Ta Tb and Ha Hb Tb Ta are the same in this case just as Hb Ha Ta Tb and Ha Hb Ta Tb so why aren't we dividing different Tails combinations too?

please help(6 votes)- When you multiply the different ways to get three heads, you
**do not**double count the*same*permutation of Heads twice. In other words, you are**not counting**Ha Hb Ta Tb and then again*Ha Hb*Tb Ta. This does not happen in the multiplication of permutations of the Heads. Since the order of Ha Hb do not repeat more than once, then there is no other double count to be considered beside the change in order from Ha Hb to Hb Ha, which**is**double counting the fact of getting two Heads.(1 vote)

- How can we relate 32 (number of all
*possibilities*of 5 flips) to 10 (number of*combinations*of 3 in 5)? 32 isn't the number of*combinations*of anything (as far as I see it), right?(2 votes)- 10 is the number of ways in which we can get exactly 3 heads (or exactly 3 tails) out of the 5 flips. All of the results are:
`5 nCr 0 = 1`

5 nCr 1 = 5

5 nCr 2 = 10

5 nCr 3 = 10 <-- This is what the 10 is counting

5 nCr 4 = 5

5 nCr 5 = 1

The 32 is counting the 1 + 5 + 10 + 10 + 5 + 1, which is the total number of possible outcomes when flipping a coin 5 times.(5 votes)

- If anyone can help me with this, that would be great.

The probability of "A" passing an exam is 1/2 and for "B" is 1/3. The answer for both of them passing is 1/6 [1/2*1/3].

If a dice is thrown twice, what is the probability of getting a one on both throw? The answer is 11/36 [(1/6)^2+((1/6)*(5/6)*2)].

Now here is my problem. For the second question, why not (1/6)*(1/6) for the probability of getting a 1 on both dice as the prob. of both "A" and "B" happening in #Q 1 is multiplying both the prob. of their passing the test?

Wow, I think that was a bit complicated and long. But if anyone can help, thanks. :)(1 vote)- I'm not sure where you got the 11/36 figure, but it isn't correct.

Your logic is right. The probability of getting a 1 on both independent throws is (1/6)·(1/6)=1/36.

Alternatively, you can think of the die throws as selecting from a 6x6 table at random, with each cell having an equal probability of being chosen. (Note that 2 and 3 is a separate cell from 3 and 2, etc.) Out of 36 cells, only one has the 1 and 1 option, so the probability is 1/36.(4 votes)

- I really can't get the reason of using the combination formula for the result in the numerator (outcomes that satisfy our goal). My reasoning is stuck with the idea that identical combinations with "different" heads must be counted (even though I know this yields to a probability larger than 1 which is impossible) because I keep seeing them as different possible results. It's hard to explain ... but I tend to think visually and this is driving me crazy as I can't draw any idea in my mind that leads me to think correctly! Thanks in advance

Stefano(2 votes)- You can think about it as if you were interested in to find the number of DIFFERENT ways I can give you 3 bananas (b) and 2 apples (a), giving you one fruit at a time. If I give you the fruits is this order: bbaab, you will hope a different way of delivering for the next time. Take a look at this new combination: bbaab, It doesn't have any difference with respect to the one indicated above, despite the fact I changed the order of bananas and apples.

You need to get rid of these redundancies when you are dealing with situation where you cannot infer that one object is different from another or you can infer that the order doesn't matter. The same thing happens with the coins. Unless you were told to pick 5 coins from a bag where each coin is different from the remaining ones (to say, they're from different countries), maybe in that situation the order does matter (it depends on how the problem was stated too).(3 votes)

- Three coins are tossed up in the air. What is the probably that two of them will land heads and one will land tails? This is from the Wonderlic test prep. The answer key has 3/8 as a solution. what is the process for working this out. I have tried to use the combinatorics and can not get the correct answer. thanks(2 votes)
- First, flipping the three coins at the same time is the same as flipping them one at a time since the events are independent, so we can use the same process that Sal uses. With combinatorics, we take 3 flips and choose 2 heads, which is 3!/[(2!)(3-2)!] = 3*2*1/[(2*1)(1)] = 3. Note that this is the same number as taking 3 flips and choosing 1 tails ( 3!/[(1!)(3-1)!] ). Since the total number of outcomes is 2^3 = 8, the probability that three tossed coins results in 2 heads and 1 tails is 3/8.(3 votes)

- Can someone explain the line at2:35:

Ha can take 5 different buckets

Usually when we have a deck of 52 cards, it is 52 ways of getting one card and so forth.

Here why is not 3 ways to get a head?(2 votes)- Hi Charles,

If we were rolling a 3-sided die, then that would be the case. But that is not what we are doing here.

In this particular case, we have 5 open slots for 3 objects to go into.

So, first we need to randonmly put in Object-1 into 1 of the 5 spots, giving us a 1/5 chance to put Object-1 in any of the 5 spots.

Object-1 = (1/5)

Object two now has 4 remaining spots to go into, so Object-2 has a 1/4 chance to go into any one of the spots.

Object-2 = (1/4).

Finally, following the same logic Object-3 has 3 remaining choices.

Object-3 = (1/3).

So, for any particular case we will have a (1/5 * 1/4 * 1/3) chance of getting that outcome. Or to simply find the total number of outcomes it would be 5 * 4 * 3. This is if are including cases of the same 3 spots being taken, but in different order.

Make sense?

Hope this helps,

- Convenient Colleague

Note: As you go farther you will learn combinatoric equations that people might tell you to memorize. Really, it is better just to think through the process I gave the example for, relative to your situation, and then take into account things like if we care about order. Thinking things logically is always better than hard-core memorization, which doesn't teach you anything.(3 votes)

- Why would you want to do this instead of binompdf(5,0.5,3) or 0.5^5*5nCr3??

This looks way more tricky and unclear if you ask me...(2 votes)

## Video transcript

So let's start again
with a fair coin. And this time, instead of
flipping it four times, let's flip it five times. So five flips of this fair coin. And what I want to think
about in this video is the probability of
getting exactly three heads. And the way I'm
going to think about it is, if you have five flips,
how many different equally likely possibilities are there? So you're going to have the
first flip-- let me draw it over here-- first flip. And there's two
possibilities there. It could be heads or tails. Second flip, two
possibilities there. Third flip, two possibilities. Fourth flip, two possibilities. Fifth flip, two possibilities. So it's 2 times 2 times
2 times 2 times 2. I hope I said that five times. Or you could view that as
2 to the fifth power. And that is going
to be equal to 32 equally likely possibilities. 32-- 2 times 2 is 4, 4 times
2 is 8, 8 times 2 is 16, 16 times 2 is 32 possibilities. And to figure out
this probability, we really just have to
figure out how many of those possibilities involve
getting three heads. We could write out all
the 32 possibilities and literally just
count the heads. But let's just use
that other technique that we just started to
explore in that last video. We have five flips here. So let me draw the flips--
one, two, three, four, five. And we want to have
exactly three heads. And I'm going to call
those three heads-- let me do it in pink-- heads
A, heads B, heads C, just to give them a name. Although what we're going
to see later in this video is that we don't want to
differentiate between them. To us, it makes no difference if
we get this ordering-- heads A, heads B, heads C, tails, tails. Or if we get this
ordering-- heads A, heads C, or heads
B, tails, tails. We can't count these as
two different orderings. We can only count this as one. So what we're going
to do is first come up with all of
the different orderings if we cared about the
difference between A, B, and C. And then we're going to divide
by all of the different ways that you can arrange
three different things. So how many ways
can we put A, B, and C into these five buckets
that we can view as the flips, if we cared about A, B, and C ? So let's start with A.
If we haven't allocated any of these buckets to
any of the heads yet, then we could say that A could
be in five different buckets. So there's five possibilities
where A could be. So let's just say that this
is the one that it goes in, although it could be in
any one of these five. But if this takes
up one of the five, then how many different
possibilities can this heads sit in? How many different
possibilities are there? Well, then there's only going
to be four buckets left. So then there's only
four possibilities. And so if this was
where heads A goes, then heads B could be in
any of the other four. If heads A was in
this first one, then heads B could have been
in any of the four. I'll just do a
particular example. Maybe heads B shows
up right there. So once we've taken
two of the slots, how many spaces do
we have for heads C? Well, we only have three
spaces left, then, for heads C. And so it could be in any
of these three spaces. And just to show a
particular example, it would look like that. And so if you cared about order,
how many different ways can you, out of five
different spaces, allocate them to
three different heads? You would say it is
5 times 4 times 3. 5 times 4 is 20, times
3 is equal to 60. So you would say there
are 60 different ways to arrange heads A, B, and C
in five buckets, or five flips, or if these were
people, in five chairs. And obviously, there
aren't 60 possibilities of getting three heads. In fact, there's only 32
equally likely possibilities. And the reason why we got
such a big number over here is that we are counting this
scenario as being fundamentally different than if this was
heads B, heads A, and then heads C over here. And what we need to
do is say, well, these aren't different possibilities. We don't have to
overcount for all of the different ways
you arrange this. And so what we need
to do is divide this by all of the
different ways that you can arrange three things. So if I have three things
that are in three spaces. So here I have a heads in
the second flip, third flip, and fifth flip. If I have three things in
three spaces like this, how many ways can
I arrange them? And so if I have three
spaces, how many ways can I arrange an A, B, and C
in those three spaces? Well, A can go
into three spaces. It can go into any of the three. Then B would have two spaces
left, once A takes one of them. And then C would
have one space left, once A and B take two of them. So there's 3 times 2
times 1 way to arrange three different things. So 3 times 2 times
1 is equal to 6. So the number of possibilities
of getting three heads is actually going to be
this 5 times 4 times 3. Let me write this
down in another color. So the number of possibilities--
let's write "poss" for short-- is equal to this 5 times 4
times 3 over the number of ways that I can rearrange
three things. Because we don't want to
overcount for all of these, viewing this arrangement
as fundamentally different than this arrangement. So then we want to
divide it by-- I want to do that same orange
color-- dividing it by 3 times 2 times 1. And which gives us, in the
numerator, 120 divided by 6. Oh sorry, that's not--
it's 60 divided by 6. This is 60. 5 times 4 times 3 is 60. It gives us 60 divided
by 6, which gives us 10 possibilities that gives
us exactly three heads. And that's of 32 equally
likely possibilities. So the probability of getting
exactly three heads-- well, you get exactly three
heads in 10 of the 32 equally likely possibilities. So you have a 5/16
chance of that happening.