# Determine the expected value and variance.

Suppose you throw a die until you obtain a 6, then throw a coin as many times as you threw the die. What's the expected value of and variance of the number of heads, tails, and heads and tails obtained?

My thinking is like this:

The throw of the die is first success distribution. Throw of the the coin is a Bernoulli distribution of the probability of getting heads. That is let $$N \sim F_s(1/6)$$ and $$X_i \sim \mathrm{Ber}(1/2)$$.

Then the sum of: $$S_N= X_1+ \dots +X_N$$ The expected value of the number of heads should be $$E(S_N)=E(N)E(X)=3$$ and the variance $$\mathrm{Var}(S_N) = E(N)\mathrm{Var}(X) + E(X)^2 \mathrm{Var}(N)=9$$. The result should be the same for tails.

But what about the number of heads and tails obtained?

Thanks in advance!

• Is the (total) number of heads and tails obtained not just $N$? – drhab Apr 11 at 9:42
• Would guess so, the problem doesn't specify. The answer should be that the expected value is 6 and the variance 30. – Jörgen persson Apr 11 at 10:11
• See geometric probability distribution: en.wikipedia.org/wiki/Geometric_distribution – georg Apr 11 at 11:30
• Okay, now I get it, I hope. Getting heads and tails is a bernoulli distribution with parameter 1 then with variance 0. So let $Z_i \in Be(1)$ $$S_N= Z_1 + \dots + Z_N$$ $$E(S_N)=E(N)E(Z)=6*1=6$$ $$Var(S_N)=E(N)Var(Z)+ E(Z)^2Var(N)=6*0+1*5*6=30$$ Got a bit confused I think. – Jörgen persson Apr 11 at 14:36