# A coin is flipped ten times. What is the probability that the first three are heads if an equal number of heads and tails are flipped?

I understand the question but I am not sure how to solve it. For example, if we flip HHHTTTTT then the next three must be heads because of the question. This however seems counterintuitive. I believe that there are $2^{10}$ possible strings, but I am unsure of how to count all possible strings that begin with HHH.

• Fun fact: the coin need not be fair; bias doesn't affect the question. You don't have to worry about the probability that any flip will be heads or tails when you already know that 5 of them are of each. The question is about the probability of these given results were in a certain type of order. – Graham Kemp May 4 '15 at 1:14
• The number of strings of length $10$ that begin with HHH is the same as the number of strings of length $7$, that is, $2^7$. – André Nicolas May 4 '15 at 2:53
• Using a coin in this example seems misleading, because the prototypical coin has no memory and as you have found out, in this case it seems like it would have to. However, you could just as well rephrase it in the past tense: "A coin was flipped ten times. What is the probability that the first three were heads if an equal number of heads and tails were flipped?" And in this scenario, it could have been a perfectly ordinary coin. – sumelic May 4 '15 at 7:08
• @GrahamKemp: the coin need not be "fair" but it must be random (results all independent). If the coin is taken as having memory, than it's not obvious that it has an equal probability of giving each random sequence. I think that is the source of the confusion. (But since we don't know, assuming it is random is the best way to calculate a probability.) – sumelic May 4 '15 at 7:10
• @sumelic Yes, the flips have to have identical and independent distributions (i.i.d.) so that all permutations of any specific counts of heads (and tails) have the same probability. – Graham Kemp May 4 '15 at 7:33

I understand the question but I am not sure how to solve it. For example, if we flip HHHTTTTT then the next three must be heads because of the question. This however seems counterintuitive. I believe that there are $2^{10}$ possible strings, but I am unsure of how to count all possible strings that begin with HHH.

You don't understand the question.

It is: When given the counts of heads and tails resulting from the flips, what is the probability that the order of the results has heads in the first three places?

Notice: We do not have to worry about the probability of any of the flips resulting in heads or tails. The coin does not even need to be fair; as long as the same one used each time (the flips have identical and independent distributions), bias has no impact on this question.

A coin is flipped ten times. What is the probability that the first three are heads if an equal number of heads and tails are flipped?

An equivalent problem is: When 5 red and 5 black cards are fairly shuffled, what is the probability that the first three will be red?

There are $\binom{5}{3}$ (equiprobable) ways to select three of the five red cards out of $\binom{10}{3}$ ways to select any three of all ten cards.

$$\frac{\dbinom{5}{3}}{\dbinom{10}{3}}=\cfrac{\;\cfrac{5!}{3!2! }\;}{\;\cfrac{10!}{3!7!}\;}=\dfrac{5! \; 7!}{2! \; 10!} =\frac{1}{12}$$

Alternatively: there are $\binom{7}{2}$ ways to order the cards/coins such that the first three are red/head, out of $\binom{10}{5}$ ways to order them in total. Divide and calculate to obtain the same result.

• @r.e.s. It's the same result; just a different approach to the solution. – Graham Kemp May 4 '15 at 1:17
• I like your equivalent problem; it makes a lot more sense as a real-life scenario. – sumelic May 4 '15 at 7:37
• "You don't understand the question" -- also, questions in conditional probability can be surprisingly difficult to state unambiguously in English, as for example blog.tanyakhovanova.com/2010/04/a-son-born-on-tuesday – Steve Jessop May 4 '15 at 16:38
• Oh, yes, indeed, @SteveJessop. It's often not easy to comprehend such problems when they are presented in plain English. They can be quite unintentionally obtuse at times. – Graham Kemp May 4 '15 at 23:09

We do a formal conditional probability calculation.

Let $A$ be the event the first $3$ tosses are heads, and let $B$ be the event we have an equal number of heads and tails in the $10$ tosses. We want $\Pr(A|B)$. By the definition of conditional probability, we have $$\Pr(A|B)=\frac{\Pr(A\cap B)}{\Pr(B)}.$$ We calculate the two probabilities on the right.

First we calculate $\Pr(B)$. The probability of $5$ heads and $5$ tails in $10$ tosses is $\frac{\binom{10}{5}}{2^{10}}$.

Next we calculate $\Pr(A\cap B)$. The probability the first $3$ tosses are heads is $\frac{1}{2^3}$. Given that the first $3$ tosses were heads, the probability of $5$ heads and $5$ tails is the probability of $2$ heads in the last $7$ tosses. This is $\frac{\binom{7}{2}}{2^7}$. It follows that $\Pr(A\cap B)=\frac{\binom{7}{2}}{2^{10}}$.

Finally, divide.

There are $\frac{10!}{5!5!}$ ways of getting an equal number of heads and tails. The first three are fixed at heads so we need 2 more heads and 5 tails in the remaining seven tosses this can be done in $\frac{7!}{2!5!}$ ways. The probability is therefore $${\frac{7!}{2!5!}\over\frac{10!}{5!5!}} = \frac{1}{12}$$

If $A$ means three heads at the beginning, and $B$ means $5$ heads and $5$ tails, we want to compute $$p(A/B)=\frac{p(A\cap B)}{p(B)}$$

And $$p(A\cap B)=\frac{\binom72}{2^{10}}$$ $$p(B)=\frac{\binom{10}5}{2^{10}}$$