Random sum of random variables Say you sum i.i.d. variables $X_i$  a total of $Y$ times.  If you know the distribution of random variables $Y$ and $X_i$, what is the calculation you have to do to get the distribution of the sum?
 A: If $S=\sum_{i=1}^{Y}X_{i}$, then the cumulant generating function of $S$ satisfies $$K_S(t)=K_Y(K_X(t)).$$ Any property of $S$ can be extracted from $K_S$.
A: Let $Y$ be a discrete random variable taking the values $1,2,3\ldots$ with probabilities $y_{1},y_{2},y_{3}\ldots$ respectively.
Let $X_{1},X_{2} \ldots$ be i.i.d. discrete random variables taking the values $0,1,2\ldots$ with probabilities $x_{0},x_{1},x_{2}\ldots$ respectively.
Further, define the random variable $S$ as the following sum:
$$S=\sum_{i=1}^{Y}X_{i}$$
$P(S=k|Y=1)=P(X=k)=x_{k}$
$P(S=k|Y=2)=P(X_{1}+X_{2}=k)$
$=P(X_{1}=0,X_{2}=k)+P(X_{1}=1,X_{2}=k-1)+\ldots P(X_{1}=k,X_{2}=0)$
$=P(X_{1}=0)P(X_{2}=k)+P(X_{1}=1)P(X_{2}=k-1)+\ldots P(X_{1}=k)P(X_{2}=0)$ (independence)
$=x_{0}x_{k}+x_{1}x_{k-1}+\ldots x_{k}x_{0}=\sum_{a+b=k}x_{a}x_{b}$  
In general, $P(S=k|Y=m)=\sum_{\sum n_{i}=k}\prod x_{n_{i}}$
where there are $m$ such $n_{i}$. This is clearer to state in words - choose two natural numbers $k$ and $m$. Consider all $m$-tuples of non-negative integers, which we call $(n_{1},n_{2}\ldots n_{m})$ which sum to $k$. Find the sum of the products $x_{n_{1}}x_{n_{2}}\ldots x_{n_{m}}$ over all possible tuples; this is the probability $P(S=k|Y=m)$. Then we have
$$P(S=k)=\sum_{m=1}^{\infty}P(S=k|Y=m)y_{m}$$
which can now be written in terms of the $x_{i}$ and $y_{i}$ (which we know).  
Let the $X_{i},Y$ be Poisson random variables with means $\lambda$ and $\mu$ respectively.
Then $x_{i}=e^{-\lambda}\frac{\lambda^{i}}{i!}$, and $y_{i}=e^{-\mu}\frac{\mu^{i}}{i!}$.
Then $$\prod x_{n_{i}}=\prod e^{-\lambda}\frac{\lambda^{n_{i}}}{n_{i}!}=e^{-m\lambda}\lambda^{k}\prod \frac{1}{n_{i}!}$$
And therefore
$$P(S=k|Y=m)=e^{-m\lambda}\lambda^{k}\sum_{\sum n_{i}=k}\prod\frac{1}{n_{i}!}$$
Which gives us, finally, $$P(S=k)=\sum_{m=1}^{\infty}e^{-\mu}\frac{\mu^{m}}{m!}e^{-m\lambda}\lambda^{k}\sum_{\sum n_{i}=k}\prod\frac{1}{n_{i}!}$$ $$=\lambda^{k}e^{-\mu}\left(\frac{\mu}{1!}e^{-\lambda}\frac{1}{k!}+\frac{\mu^{2}}{2!}e^{-2\lambda}\prod_{n_{1}+n_{2}=k}\frac{1}{(n_{1}!)(n_{2}!)}+\ldots\right)$$ 
Let $p_{m,k}$ denote the sum of products $\sum_{\sum n_{i}=k}\prod\frac{1}{n_{i}!}$, where $i$ varies from $1$ to $m$. It can be easily shown that $p_{1,k}=\frac{1}{k!}$ and $p_{m,0}=1$. It can further be shown that the following recurrence holds:
$$p_{m+1,k}=\sum_{n=0}^{k}\frac{p_{m,n}}{n!} \qquad (p_{m,0}=1; \quad m \ge 1;k\ge 0)$$
It can further be shown that $p_{m,k}=\frac{m^{k}}{k!}$
Therefore
$$P(S=k)=\lambda^{k}e^{-\mu}\sum_{m=1}^{\infty}e^{-m\lambda}\frac{\mu^{m}}{m!} \frac{m^{k}}{k!}$$
I can't seem to find a simple closed-form expression for this sum; perhaps someone else can do better.
