I'm not sure how to deal with random sums like this
Let $X_{1}, X_{2}, X_{3},\cdots$ be independent and identically distributed random variables and let $N$ be a non-negative integer valued random variable and is independent of the random variable $X$. If $$S_{N}=X_{1}+X_{2}+\cdots +X_{N}$$ be the sum of a random number of independent and identically distributed random variables, then
\begin{eqnarray*}
% \nonumber to remove numbering (before each equation)
E[S_{N}]&=&E[N]\cdot E[X]\\
Var[S_{N}]&=& E[N]\cdot Var[X] + Var[N]\cdot \left\{E[X]\right\}^{2}
\end{eqnarray*}
We first find the conditional expectation of $S_{N}$ given the value of $N$ as
\begin{eqnarray*}
% \nonumber to remove numbering (before each equation)
E\left[S_{N}|N=n\right] &=& E\left[X_{1}+X_{2}+\cdots +X_{N}|N=n\right] \\
&=& E\left[X_{1}+X_{2}+\cdots +X_{n}\right]\\
& &\quad \mbox{ since X and N are independent RV's}\\
&=& n E[X], \quad\quad\mbox{ since $X_{i}'s$ are iid RV's}\\
E\left[S_{N}\right] &=& \sum_{n}\underbrace{E\left(S_{N}|N=n\right)}_{n\cdot E[X]} P\left\{N=n\right\}\\
&=& \sum_{n} n\cdot E[X]\cdot P\left\{N=n\right\}\\
&=&E(X)\cdot \sum_{n}n\cdot P\left\{N=n\right\}\\
E\left[S_{N}\right] &=& E[X]\cdot E[N]
\end{eqnarray*}
In order to find an expression for $Var[S_{N}]$, we first find the second conditional moment of $S_{N}$.
\begin{eqnarray*}
% \nonumber to remove numbering (before each equation)
E(S_{N}^{2}|N=n) &=& E[(X_{1}+X_{2}+\cdots +X_{N})^{2}|N=n] \\
&=& E[(X_{1}+X_{2}+\cdots +X_{n})^{2}]\\
&=& E\left\{\sum_{i=1}^{n}X_{i}^{2}+2\sum_{i<j}X_{i}X_{j}\right\}\\
&=& \sum_{i=1}^{n}E\left(X_{i}^{2}\right) + 2 \sum_{i<j} E\left(X_{i}\right)E\left(X_{j}\right)\\
&=& n\cdot E\left(X^{2}\right) + 2\cdot \frac{n(n-1)}{2}E\left(X\right)E\left(X\right)\\
\end{eqnarray*}
\begin{eqnarray*}
E(S_{N}^{2}|N=n) &=& n\cdot E\left(X^{2}\right) + n(n-1)\left(E(X)\right)^{2}\\
&=& n[E(X^{2})-(E(X))^{2}] + n^{2}(E(X))^{2}\\
E(S_{N}^{2}|N=n) &=& n Var(X) + n^{2}(E(X))^{2}
\end{eqnarray*}
Now
\begin{eqnarray*}
% \nonumber to remove numbering (before each equation)
Var(S_{N}) &=& E(S_{N}^{2}) - \left[E(S_{N})\right]^{2} \\
&=& \sum_{n}E(S_{N}^{2}|N=n)P\{N=n\}-[E(X)E(N)]^{2}\\
&=&\sum_{n}\left[nVar\left(X\right)+n^{2}\left(E\left(X\right)\right)^{2}\right] P\left\{N=n\right\}\\
& &\quad\quad\quad -\left[E(X)E(N)\right]^{2}\\
&=& Var(X) \sum_{n}nP\left\{N=n\right\}\\
& & + \left(E\left(X\right)\right)^{2}\sum_{n}n^{2}P\left\{N=n\right\} - \left[E(X)E(N)\right]^{2}\\
&=&E(N)Var(X) + \left(E\left(X\right)\right)^{2} \left[E(N^{2})-(E(N))^{2}\right]\\
Var(S_{N}) &=& E(N)Var(X) + Var[N](E(X))^{2}
\end{eqnarray*}
self-study
tag and read the corresponding wiki $\endgroup$learn more
$\endgroup$