# Sum of random number of random variables

Consider a sequence of independent and identically distributed random variables $X_1, X_2, \ldots$ such that $$\mathbb P(X_i\geqslant k)=\prod_{\ell=1}^{k-2}\frac{n-\ell}n \ \textrm{ for every } 2\leqslant k\leqslant n+1.$$

Consider also $$Z= \sum_{i=1}^Y X_i ,$$

where $Y$ follows a geometric distribution with success probability $1/n$.

What is the mean and variance of $Z$ and is it possible to calculate its full distribution? I am particularly interested in what happens for large $n$.

-
If $Y,X_1,X_2,\ldots$ are independent, then $E(Z)$ is just equal to $E(Y)E(X)$. Otherwise, you need to specify how $Y,X_1,X_2,\ldots$ are related to each other. – user1551 Dec 29 '12 at 8:39
Thanks. I should have added variance explicitly and not have it hidden in the full distribution part. Fixed. – user54551 Dec 29 '12 at 9:20
But you haven't answer the key question: are $Y,X_1,X_2,\ldots$ independent? – user1551 Dec 29 '12 at 9:22
Sorry. Yes they are. – user54551 Dec 29 '12 at 9:25
I have edited that bit of information into your question. See if I understand you correctly. If not, feel free to roll back. – user1551 Dec 29 '12 at 9:35

To elaborate on @user1551 comment, under independence, you could use the law of iterated expectations to derive what you need. First, the conditional expectation of $Z$ on fixing $Y=y$ is \begin{eqnarray*} E \left[ Z|Y = y \right] & = & E \left[ \sum_{i = 1}^y X_i \right]\\ & = & yE \left[ X_i \right] \end{eqnarray*} This allows to compute $E[Z]$ \begin{eqnarray*} E \left[ Z \right] & = & E_Y \left[ E \left[ Z|Y = y \right] \right]\\ & = & E_Y \left[ yE \left[ X_i \right] \right]\\ & = & E \left[ Y \right] E \left[ X_i \right] \end{eqnarray*}
For the variance of $Z$, you could exploit formulas for conditional variances (such as here).
You could apply a similar argument in order to derive the cumulative distribution of $Z$. \begin{eqnarray*} \Pr \left[ Z \leqslant z \right] & = & E_Y \left[ \Pr \left[ Z \leqslant z|y \right] \right] \end{eqnarray*}