# Expected number of failures when tossing coins

I'm trying to solve a problem but I suspect my solution is incorrect. I'm hoping someone can verify and perhaps give me an idea about how to solve it correctly.

We have three fair coins and each is tossed until the first head appears on each coin. (So once one head appears on one of the three coins, we stop tossing that particular coin.) When we are finished, a total of $6$ tails have been obtained. What is the expected value of the number of tails on the first coin?

This is how I have tried to solve it:

If a total of $6$ tails have appeared the possible number of tails obtained with the first coin is 0, 1, 2, 3, 4, 5 or 6. I define a random variable $X \sim \mathrm{Geometric}(1/2)$ so that the value of $X$ is the number of tails (failures) until the first head (success) is obtained.

I know that the PMF of a random variable with Geometric distribution is $(1-p)^k*p$ and in this case $p = 1/2$

From here I went on to compute the expected value as $$\mathrm{E}(X) = \sum_{k=0}^6 k*\mathrm{P}(X=k) = \sum_{k=0}^6 k*(\frac{1}{2})^k*\frac{1}{2}$$

and reached the result $15/16.$

As I said, I'm pretty certain this is not the right answer, but I'm not sure why and how to solve it correctly, so any help is appreciated.

• The distribution of $X$ is not geometric. The geometric distribution can take any integer value. This is not the case here, where $X$ is at most $6$. – Augustin Nov 4 '15 at 13:27
• Not sure I am following. What's special about the first coin? Surely its expectation should be the same as that of the other two, hence $2$. – lulu Nov 4 '15 at 13:27
• By "first coin", do you mean the "first coin to show a head"? – robjohn Nov 4 '15 at 13:57
• I honestly don't know for sure, I don't have more information about the problem than what I just wrote but my interpretation was that they by first coin simply mean the one we began tossing rather than "first coin to show a head". – m.bing Nov 4 '15 at 14:01
• You have two answers that interpret "first coin" as "first coin from the left" and my answer that interprets "first coin" as "first coin to show a head". So you should be covered. :-) – robjohn Nov 4 '15 at 15:56

The answer is 2.

Treat them as iid random variables X1 X2 and X3. You have to essentially find E[X1 | X1+X2+X3] = ( X1 + X2+ X3 )/ 3.

• But of course they aren't independent. $X_3=6-X_1-X_2$. – lulu Nov 4 '15 at 13:31
• They are . The above statement is incorrect. The correct statement is E[X3]= 6 - E[X1]-E[X2] – Rahul Pawar Nov 4 '15 at 13:33
• I agree with the conclusion, but not the independence. How can three variables be independent if knowing two determines the third? – lulu Nov 4 '15 at 13:34
• lulu think about this way the outcome of any one coin is not influenced by other. And knowing two does not determine the third. Knowing the expected value of two and the expected value of sum of three determines the expected value of the third. – Rahul Pawar Nov 4 '15 at 13:37
• Hm. Of course, my "gut" told me the answer is 2, but usually my gut is wrong so I thought the solution would be a bit more advanced than that, hehe. – m.bing Nov 4 '15 at 13:42

If by "first coin" you mean "first coin to show a head", here is my answer.

The probability that the each coin shows $k$ tails before the first head is $\frac1{2^{k+1}}$, so the probability for each arrangement that the sum of the number of tails is $6$ is $\frac1{2^9}$. That is, each such arrangement has equal probability.

One Method to Compute the Number of Arrangements

The number of such arrangements where the lowest number of tails is $k$ or greater is the coefficient of $x^6$ in $\left(\frac{x^k}{1-x}\right)^3$ which is the coefficient of $x^{6-3k}$ in $\left(\frac1{1-x}\right)^3$, which is \begin{align} (-1)^{6-3k}\binom{-3}{6-3k} &=\binom{6-3k+2}{6-3k}\\ &=\binom{8-3k}2[k\le2] \end{align}

Another Method to Compute the Number of Arrangements

To count the number of ways to have $3$ non-negative integers that sum to $6$, we can use the Stars and Bars Method, which says the number is $\binom{6+3-1}{3-1}=\binom{8}{2}$ (the same as above).

To count the number of ways to have $3$ positive integers that sum to $6$, we can count the number of ways to have $3$ non-negative integers that sum to $3$ (by preloading each stars and bars partition with $1$). This gives $\binom{3+3-1}{3-1}=\binom{5}{2}$ (the same as above).

To count the number of ways to have $3$ integers, greater than or equal to $2$, that sum to $6$, we can count the number of ways to have $3$ non-negative integers that sum to $0$ (by preloading each stars and bars partition with $2$). This gives $\binom{0+3-1}{3-1}=\binom{2}{2}$ (the same as above).

Thus, the number of arrangements with exactly $0$ as the lowest number is $\binom{8}{2}-\binom{5}{2}=18$.

The number of arrangements with exactly $1$ as the lowest number is $\binom{5}{2}-\binom{2}{2}=9$.

The number of arrangements with exactly $2$ as the lowest number is $\binom{2}{2}-0=1$.

Thus, the expected value is $$0\cdot\frac{18}{28}+1\cdot\frac{9}{28}+2\cdot\frac1{28}=\frac{11}{28}$$

• I can't figure out your calculations but something seems wrong to me. The probability for $0$ is $\frac{7}{8}$ which leaves only $\frac{1}{8}$ for everybody else. Since the max value is 2 I think the expectation is bounded by $\frac{1}{4}$. – Alex Fish Nov 4 '15 at 14:17
• No, the number of ways to sum to $6$ with the lowest being $0$ is $18$: $0+0+6$ gives $3$ because of the placement of the $6$, $0+1+5$, $0+2+4$, $0+3+3$, $0+4+2$, $0+5+1$ gives $5$ times $3$ for the placement of the $0$. That is a total of $3+15=18$. Since the total number of arrangements that sum to $6$ is $28$, the probability that the lowest number of tails is $0$ is $\frac{18}{28}$. – robjohn Nov 4 '15 at 14:34
• All the cases in which it is not $0$ are the cases in which the first toss of every coin is tail. The probability for that is $\frac{1}{8}$. – Alex Fish Nov 4 '15 at 14:41
• If I understand your solution correctly, you are interpreting the problem as tossing the three coins simultaneously until one or more come up heads, setting those aside and continuing to toss the ones that came up tails. The answers by Rahul Pawar and Marconius are interpreting it as tossing one coin until it comes up heads, then tossing the second coin until it comes up heads, then tossing the third coin. – Barry Cipra Nov 4 '15 at 14:44
• @BarryCipra: yes. I tried to make it clear that I was computing the expectation for number of tails before the temporally first coin to roll a head. Although this was my initial interpretation, I see that it was unclear what the question was asking, and even the OP was not sure. Since the other interpretation has a simple solution based on the linearity of expectation, I thought this interpretation was also more interesting (as well as more natural in my opinion). – robjohn Nov 4 '15 at 15:11

Since the coins are fair, we can assume the tosses are independent, and the expected number of tails on each coin is the same. So by symmetry $E[X_1]=E[X_2]=E[X_3]$, and we are given that $E[X_1]+E[X_2]+E[X_3]=6$ for all combinations of coin tosses that meet the stipulations of the problem. Hence

$$E[X_1]=2$$

• +1: as I just mentioned in a comment to my answer, this is the way I would approach this interpretation of the question. I found the other interpretation ("first coin" means the "first coin to show a head") to be more natural, but that is only my opinion. – robjohn Nov 4 '15 at 15:14