Computation of a mean (random sum) Let $X_1$, $X_2$, ... be independent and identially distributed positive random variables and define the sum $S_n = X_1 + X_2 + ... + X_n$. Consider the first time $N$ where $S_N \ge b$ with a given positive value $b$.
I need to compute (simplify) $E(NS_N)$. I need an expression in function of simple terms like $E(N)$, $E(X_1)$ etc... How proceed ? I'm not mastering the conditional mean.
Thank you
 A: Hints
Do you want to assume independence between $N$ and $X_i$? Then condition on $N$ and separate using independence.
Otherwise, you have to assume at least that $N$ is a stopping time with respect to the $\sigma$-algebra, generated by the $X_i$.
Now assume first that $X_i$ are 0-mean (eventually you will let $X_i = \mu + Y_i$ where $Y_i$ will be 0-mean, but for now assume $\mu=0$).
Now note that the stochastic process $\{S_n\}$ is a martingale, so $\mathbb{E}[S_N] = \mathbb{E}[S_t]$ for any $t$ (by Doob's lemma), in particular for $t=0$, and we know $\mathbb{E}[S_0]=0$.
I think you can argue similarly for the process $\{nS_n\}$, and then apply the construction with $Y_n$ to get your expected value.
To make that construction more formal, let $Y_i = X_i - \mu$ where $\mu = \mathbb{E}[X_1]$ so $\mathbb{E}[Y_1] = 0$ and now $Y_i$ are identical and 0-mean. Let $T_n = \sum_{k=1}^n Y_k$. By the above logic it follows that $\mathbb{E}[N T_N] =0$. But
$$
N T_N = N \sum_{k=1}^N Y_i = N \sum_{k=1}^N (X_i - \mu) = NS_N - \mu N^2
$$
and taking expected values, note that the left-hand side becomes $\mathbb{E}[N T_N] =0$ and you can draw conclusions...
