Qn :
We roll a six-sided die n times. Each time the die comes up 1, we flip a fair coin. Let X be the number of heads we get. Note that the number of times the coin is flipped is random. Find the mean and variance of X.
Ans:
Suppose X is the number of heads and F is the number of coin flips to get 1. We have the following formula for the expectation and variance of X:
$$\mathbb E[X] = \mathbb E[\mathbb E[X\mid F]] \tag 1$$ $$\operatorname{var}(X) = \mathbb E[\operatorname{var}(X\mid F)] + \operatorname{var}(\mathbb E[X\mid F]) \tag 2$$
Notice that both var(X|F) and E[X|F] are random variables depending on F. When F takes value 1/6, we have var(X|F) = var(X|F = 1/6) and E[X|F] = E[X|F = 1/6] which are the conditional variance and expectation of X conditioned on F = 1/6. It seems obvious but gives us a way to determine var(X|F) and E[X|F]: supposing F = 1/6, the conditional distribution of X is n = 1/6 and p = 1/2. Therefore the conditional expectation and variance are equal to E[X|F = 1/6] = np = 1/12 and var(X|F = 1/6) = np(1-p) = 1/12 * ½ = 1/24, respectively. We just replace 1/6 with F to get: var(X|F) = 1/24; E[X|F] = 1/12:
Till this am i correct, now how do i replace these in equations 1 and 2?
Is there a better way to solve it? I am confused.Can anyone help with my approach?