TITLE: What is the expected result for the number of heads obtained in this coin/dice flipping example?
QUESTION [3 upvotes]: Suppose you roll one fair six-sided die and then flip as many coins as the number showing on the die. (For example, if the die shows 4, then you flip four coins.) Let Y be the number of heads obtained. Compute $E(Y)$.
So, $E(Y)=\Sigma_{y=1}^{y=6}yP_{y}(y)$
We will define $X$ as the number on the die. Therefore:
$$E(Y)=\sum_{y=1}^{y=6}yP_{y}(y)=\sum_{y=0}^{y=6}\sum_{x=1}^{x=6}(y)P(X=x,Y=y)=\sum_{y=0}^{y=6}y\sum_{x=1}^{x=6}(1/6)\binom{x}{y}(1/2)^x$$
This inner equation is valid: $(1/6)\binom{x}{y}(1/2)^x$
Basically, it says that if I roll a 3, and I get 1 head only, what is the probability of that occurring = $(1/6)\text{[for the roll]}\binom{3}{1}\text{[from 3 rolls, we choose one head]}(1/2)^3=1/16$
Now, I need to simplify the above double sum, but I am not sure how to do it. The answer in my textbook is $7/4$, but it does not show steps. I think I am right until now, I just need help doing this summation.

REPLY [2 votes]: If $D$ is the result of the die-throw, $E(Y) = \sum_{d=1}^6 E(Y|D=d)P(D=d)$.
Clearly $E(Y|D=d)= \frac{d}{2}$. So we are left with $$E(Y) = \sum_{d=1}^6 \frac{1}{6}\frac{d}{2} = \frac{1}{12}\sum_{d=1}^6 d = \frac{21}{12}$$
{"set_name": "stack_exchange", "score": 3, "question_id": 2995477}