Expected value of sum of number of dice after rolling a die n times A fair six-sided die is rolled $Y$ times, where $Y\sim \operatorname{Po}(4)$.
Let $X_i, \,i=1,\ldots,Y$ be the number obtained on the $i$th roll, and let
$$Z=\sum_{i=1}^Y X_i$$
How do I calculate the expected value of $Z$?
As far as I know the expectation of $Y$ is $4$, I don't know how to start. Can anyone help me with this? Thank you!
 A: Hint: this problem would be easier if $Y$ were a fixed number rather than a random variable. It turns out solving this easier problem can help you solve the original problem.
Use the "tower rule"/"law of total expectation":
$$E[Z] = E[E[Z \mid Y]].$$

Edit: If $Y$ is fixed at a certain value $y$, then $E[Z \mid Y=y] = \sum_{i=1}^y E[X_i] = 3.5y$. Thus $E[Z \mid Y] = 3.5Y$ and $E[Z] = E[E[Z \mid Y]] = E[3.5Y] = 3.5 E[Y]$.
In general (for sums of a random number of i.i.d. random variables), it does end up being the product of the expectations: this is Wald's equation.
A: Not mentioned in the Question or explicitly in the Answers
is that finding $Var(Z)$ involves summing two components of variance. The general type of problem is called 'random sum of random variables'.
Here is a simulation of the distribution of $Z$ based
on a million realizations of $Z.$  A million iterations often gives numerical answers accurate to two or more significant digits. [R procedures are
programmed to anticipate the case where rpois(1,4) returns 0.]
set.seed(2020)
z = replicate(10^6, sum(sample(1:6, rpois(1,4), rep=T)))
mean(z)
[1] 14.01161   # aprx 4(3.5) = 14
var(z)
[1] 60.71234   # aprx 60.67 (see link)
cp = (-1:max(z))+.5  # histogram bin boundaries
hist(y, prob=T, br=cp, col="skyblue2")


Some apparently anomalous values at $z=0,1,\dots,6$ are real.
For example:
$P(Z = 0) = P(Y=0);\,$ $P(Z=1) = P(Y=1)/6.$
mean(z==0);  dpois(0,4)
[1] 0.018229
[1] 0.01831564
mean(z==1);  dpois(1,4)/6
[1] 0.012285
[1] 0.01221043
mean(z==2);  dpois(1,4)/6 + dpois(2,4)/36
[1] 0.016453
[1] 0.01628057

Notes: (1) The usual conditional formulas do not provide the
distribution of $Z.$ In practical applications, 
an advantage of simulation is to get a reasonable
approximation for tail probabilities: e.g., $P(Z \ge 25) \approx 0.1.$
mean(z >= 25)
[1] 0.099142

(2) A common application of such distributions is actuarial.
A Poisson number of claims on a particular kind of policy are filed each month
and the payout on individual claims has a known distribution.
