If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Probability using combinations

Probability of getting exactly 3 heads in 8 flips of a fair coin. Created by Sal Khan.

## Want to join the conversation?

• I am a bit confused here, Why aren't we considering probability of a coin flip (i.e a single event occurring viz 50% or 1/2) while approaching the problem ?
I understand that the probability of getting a heads or tails is same but shouldn't it be considered while performing the calculations !
The solution is directly obtained by putting numbers 8 & 3 where we are not even considering what is heads and what is tails :/ The number 3 can refer to either heads or tails.
• I'm pretty sure the "1/2" probability is considered a part of the total outcomes (2^8) which shows that there are only 2 options, and since there are no further calculations, it can be assumed that each option is equally likely. Since the problem is asking for the probability of 3 heads, anyone looking at the problem can consider your answer/work through the context of the question. (However, you are right: the same question asking for the probability of 3/8 tails would also have the same answer.) Hope this helps!
• why can't I use this method in the last numerical (previous module: "probability & combination (part 2) where we have to calculate the probability of 3 basket in 5 free throws P(3/5) given that free throw % is 80%

total outcome= 2^5=32 (since every throw might be basket or a miss, 2 possibility for every throw).

combination of choosing 3 out of 5= 5!/3!2!= 10

total probability = 10/32=31.25% but the answer is 20.48%....does it have to do something odds of scoring a basket or missing is not equal.
• It works only if the probability of missing or hitting would be 0.5 instead of 0.8.

Deciding the probability that something will happen by doing `(number of outcomes where it does happen) / (number of total outcomes)` only works if all outcomes have an equal probability of happening.

For example, if I have an unfair die that lands half of the time on 6 then the chance of getting 6 is 1/2 and not 1/6 even though there is only 1 out of 6 possible ways where this would happen.
• Is there such thing as a negative factorial, like "-1!" or "-7!"?
• No there aren't. The factorials of negative integers are undefined.

To see why, consider that (n-1)! = n!/n. So 0! = 1!/1 = 1. However (-1)! = 0!/0 = 1/0, and division by zero is undefined. And, since (-1)! is undefined, it follows that factorials of the other negative integers are also undefined.
• If it needs to be exactly 3 heads and not more, don't we need to remove the cases where there may be more than 3 heads in the numerator?
• Yes (you could show that), but in turn, you would also have to remove all of the cases where there may be less than 3 heads in the numerator as well. If you do that, you would get the same answer, but you'd end up doing more work. Sal calculated the EXACT number of heads, and since he didn't include anything else in the numerator, we can consider this as the same as removing all of the unwanted outcomes.

P(3 H) = 0.21
OR
P(3 H) = 1-P(not 3 H) = 1-0.79 = 0.21

Hope this helps! (I know you asked this 8 years ago, but for anyone else who has the same question as you!!)
• Why does he divide all COMBINATIONS of getting 3/8 heads by the total possible PERMUTATIONS? Why doesn't he divide correct permutations by total permutations? (that is, shouldn't he omit the 3! in the denominator at ?)
• He doesn't divide by the total number of permutations, he's dividing by the total number of possible outcomes which is 2^8. To find the number of outcomes out of these 2^8 possible outcomes that have exactly 3 heads we need to figure out how many ways we can choose exactly 3 heads in 8 flips. Since one "heads" is exactly the same as another, the ordering of these 3 heads does not matter, hence the number of ways is 8C3.

Let me try and illustrate this through a smaller example, suppose we were dealing with the probability of getting exactly 2 heads in 3 flips. Here the total number of outcomes is 2^3 = 8. Let the flips be numbered 1, 2 and 3. Now if we had to choose 2 flips out of these 3 to have heads, in how many ways could we choose them? Let's call these two flips flipHeadsA and flipHeadsB. We have a total of 3 flips to choose from initially, so for flipHeadsA we have 3 options, and now we have only 2 options left for flipHeadsB. Hence there are 6 permutations for flipHeadsA and flipHeadsB. I'll list them out:

But as you can see, this means we are differentiating between heads A and heads B, which is unnecessary. If heads A was obtained on flip 1 and heads B was obtained on flip 3, this is equivalent to heads B being obtained on flip 1 and heads A being obtained on flip 3 since they are both heads, so we are overcounting if we use permutations. So we divide by the number of ways the heads can be arranged among themselves (2! in this example) to get the actual number of events that will satisfy the condition exactly 2 heads in 3 flips. Hence, the number of ways to get exactly 2 heads in 3 flips is 3C2 and not 3P2.
• I am still struggling to get my head around the intuition on this one; in particular the concept that 3 chosen variables occuring in any order out of 8 unkown variables (outcomes of coin flips) is the same concept as 3 chosen variables arising in any order (e.g.: three people sitting together in any order) out of 8 known variables (e.g.: eight people). Is the unkown nature of the variables irrelevant for the calculation of the combinations? Does this also extend to situations with more unknown variables?

For example if we have a fruit machine with 8 spinning wheels, there are 10 items on each wheel 1 of those 10 is a bell and we say we want to calculate the permutations where there will be 3 of the 8 wheels showing a bell? Would this situation still be 8!/(3!*(8-3)!)?
• The coins and the people aren't really that different.
Each coin has two possible outcomes, Heads or Tails, and each person also has two possible outcomes, sitting or standing.

The difference is that for the 8 people we are asked the number of ways that we can choose which 3 are sitting, while for the 8 coins we are asked the probability that 3 are Heads and the others are Tails.

However, since each coin is equally likely to land Heads as to land Tails, then each sequence of 8 coins is also equally likely to occur, and thereby the probability that 3 coins are Heads is equal to the number of sequences that consist of 3 Heads and 5 Tails, divided by the total number of possible sequences.

So, we want to know in how many ways we can choose which 3 coins are Heads, which of course must be the exact same as the number of ways we can choose which 3 people are sitting.

– – –

In the case with the fruit machine, each wheel can be seen as having two possible outcomes, Bell or No Bell.

However, now the two possibilities have different probabilities:
P(Bell) = 1∕10
P(No Bell) = 9∕10

This means that the probability of a certain sequence depends on the number of Bells that are in the sequence.
A sequence containing 3 Bells has the probability
(1∕10)³ ∙ (9∕10)⁵

But now that we have that probability, all we need to do is multiply it by the number of sequences containing 3 Bells, which again is the same as the number of ways we can choose which 3 wheels are Bells = 8!∕(3! ∙ 5!)
• This took me a while. Especially the analogy to people and seats from the previous videos.

Reducing the problem space to getting 2 heads in 3 flips helped. Flips are the "unique entity", and we can name them like people: flip A, flip B, flip C (instead of using numbers, which might be confusing). And we're interested in 2 "heads" events (analogous to "sitting" state of people). The flips permutations that would result in 2 heads are AB, AC, BC, BA, CB, CA. This is a total of 6 (3x2) permutations. We get the number of combinations by dividing the permutations by 2 (= k! = 2! = 2x1), so 3 combinations: AB/BA, AC/CA and BC/CB. So we've 3 possible combinations of 3 flips that result in 2 heads.

Now moving to the realm of outcomes in terms of heads and tails, we've 8 (2^3) possible outcomes: HHH, HHT, HTH, HTT, THH, THT, TTH and TTT. We can see that 3 of those outcomes contain exactly 2 heads (HHT, HTH, THH). This is also the number of combinations of 3 flips that result in 2 heads, calculated above (if it's still unintuitive, it can help to think about the case where we get HHH or TTT, which would correspond respectively to 6 permutations or 1 combination of flips).

Finally, to get the probability of getting exactly 2 heads in 3 flips, we divide the number of "success" events, in this case, of getting exactly 2 heads, by the number of total outcomes, so 3/8.
• Does n C k = n C (n-k) ? (n C k is other way of writting binomial coffiecient)
(1 vote)
• Yep, that's correct. Let's take some examples:

`16C3 = 560 = 16C13` (n = 16, k = 3)
`22C14 = 319770 = 22C8` (n = 22, k = 14)

More academic proof: Let's call `m = n - k`, therefore `k = n - m`.
``nCk = n! / [k! * (n - k)!]nCk = n! / [(n - m)! * m!]nCk = nCm``