# Counting the number of ways heads shows up exactly for 10 coin tosses

Problem: Ten coins are tossed and each is equally likely to come down heads or tails. How many ways are there to get 3 heads?

I know the size of the sample space is $2^{10}$. It seems like I should subtract the total number of orderings with more than 3 heads and less than 2 heads from the sample space. Then I would have the result. Is that the best way of going about this? There doesn't seem to be any necessarily straightforward approach.

• If $3$ of the $10$ coins come down as heads, then $10-3=7$ are tails. Then the question becomes how many ways can you arrange $3$ heads and $7$ tails in a line of $10$ coins. – woogie Apr 13 '17 at 17:19
• Have you ever heard of binomial coefficients? – JMoravitz Apr 13 '17 at 17:19
• Each way of choosing a subset of size 3 of the set of 10 pennies is a way for exactly 3 of the pennies to be heads. – B. Goddard Apr 13 '17 at 17:20
• @rudy not quite... $3!7!$ will appear in a correct answer somehow, but not by itself as the answer as a whole. Perhaps a fraction that involves it... – JMoravitz Apr 13 '17 at 17:22
• @JMoravitz My issue, I feel, is that order matters in terms of how many sequences there are, but order does not matter for how I am selecting them. – rudy Apr 13 '17 at 17:22

The binomial coefficient $\binom{10}{3}=\frac{10!}{3!7!}$ counts the number of ways in which you may select a subset of three objects out of a set of ten distinct objects.

In this case, our ten objects are the distinct positions in the sequence. We select three of them to be those positions who will have a coinflip resulting in a head (and the remaining seven positions will have a coinflip resulting in a tail). As such, $\binom{10}{3}$ is the number of ways of selecting three positions in the sequence of ten flips to be a head and therefore counts the number of sequences with exactly three heads.

The mantra that "you use combinations when order doesn't matter" here is in reference to that having picked which of the locations are occupied by heads, the order in which you write which locations those are won't matter despite the locations themselves having a specific order that matters. "I pick the first, the third, and the second positions to be those with heads" results in HHHTTTTTTT, meanwhile "I pick the third, the first, and the second positions to be those with heads" also results in HHHTTTTTTT.

You are correct that there are $2^{10}$ different sequences of ten coinflips (seen quickly by multiplication principle). We can break it down into cases as well:

$2^{10} = \text{#exactly0heads}~+~\text{#exactly1head}+\text{#exactly2heads}+\dots+\text{#exactly10heads}$

$2^{10}=\binom{10}{0}+\binom{10}{1}+\binom{10}{2}+\dots+\binom{10}{10}$

This is just a special case of the binomial theorem: $(x+y)^n = \sum\limits_{k=0}^n\binom{n}{k}x^ky^{n-k}$ where $x=y=1$ and $n=10$