# Variance of number of heads in three flips of a coin selected from a set of fair and unfair coins

We have $10$ coins, $2$ are two-tailed, $2$ are two-headed, the other $6$ are fair ones. We (randomly) pick a coin and we flip it $3$ times. Find the variance of the number of gotten heads.

My attempt:

$X$ - number of heads that we got

$\mathbb{P}\left(X=0\right)=\frac{2}{10}\cdot1\cdot1\cdot1 + \frac{6}{10}\cdot\frac{1}{2}\cdot\frac{1}{2}\cdot\frac{1}{2}$ - we picked two-tailed coin or fair one

$\mathbb{P}\left(X=1\right)=\frac{6}{10}\cdot\frac{1}{2}\cdot\frac{1}{2}\cdot\frac{1}{2}\cdot 3$ - we picked fair one and we have 3 possibilites: HHT, HTH, THH

$\mathbb{P}\left(X=2\right)=\frac{6}{10}\cdot{3\choose2}\cdot\left(\frac{1}{2}\right)^2\cdot\left(\frac{1}{2}\right)^1$ - again we picked fair one and we have to have 2 successes in 3 tries

$\mathbb{P}\left(X=3\right)=\frac{2}{10}\cdot1\cdot1\cdot1+\frac{6}{10}\cdot\left(\frac{1}{2}\right)^3$ - we can pick two-headed or fair one coin

And the rest is simple,

$\text{Var}X=\sum_{i=0}^3i^2\cdot\mathbb{P}\left(X=i\right)-\left(\sum_{i=0}^3i\cdot\mathbb{P}\left(X=i\right)\right)^2$

Is my solution correct?

• The information is symmetric, so the expressions for the probability of 1 head or 2 heads should be the same. – Paul Feb 2 '17 at 18:42
• Yes, your approach is correct. $\checkmark$ – callculus Feb 2 '17 at 18:47
• @Paul well, yea, I should have decided whether I use probability mass function or just standard combinatorics. But the result is the same – SantaXL Feb 2 '17 at 18:50

That's one approach.   It is good.   Here's another,

We know $X\mid C \sim \mathcal{Bin}(3, C)$ and $\mathsf P(C=c)=\tfrac 15\mathbf 1_{c=0}+\tfrac 35\mathbf 1_{c=1/2}+\tfrac 15\mathbf 1_{c=1}$

So $\mathsf E(C)= \tfrac 1{2}$ and $\mathsf {Var}(C)=\tfrac 1{10}$ and $\mathsf E(C^2)=\frac 7{20}$

By the Law of Total Probability: $\mathsf E(X) \\ = \mathsf E(\mathsf E(X\mid C)) \\ = \mathsf E(3C) \\ = \frac 32$

Then by the Law of Total Variance: $\quad\mathsf {Var}(X) \\ = \mathsf{Var}(\mathsf E(X\mid C))+\mathsf E(\mathsf{Var}(X\mid C)) \\ = \mathsf {Var}(3C)+\mathsf E(3C(1-C)) \\ = \frac 9{10}+\frac 32-\frac {21}{20} \\ = \frac {27}{20}$

• Hmm, your result is different from mine. In my approach: $\mathbb{P}(X=0)=\mathbb{P}(X=3)=\frac{9}{40}, \ \mathbb{P}(X=1)=\mathbb{P}(X=2)=\frac{11}{40} \\ EX=1\cdot\frac{9}{40}+2\cdot\frac{9}{40}+3\cdot\frac{11}{40}=\frac{9+18+33}{40}=\frac{60}{40}=\frac{3}{2} \\EX^2=1^2\cdot\frac{9}{40}+2^2\cdot\frac{9}{40}+3^2\cdot\frac{11}{40}=\frac{9+36+99}{40}=\frac{144}{40}=\frac{18}{5} \\ VarX=EX^2-E^2X=\frac{18}{5}-\frac{9}{4}=\frac{27}{20}$ – SantaXL Feb 3 '17 at 13:52
• Where is the mistake? – SantaXL Feb 3 '17 at 13:53
• In mine. @SantaXL corrected. – Graham Kemp Feb 3 '17 at 14:49
• ok, thanks for showing me this approach, I wasn't aware such Law exists. – SantaXL Feb 3 '17 at 15:22