Let $X_1, X_2, \cdots$ be independent and identically distributed random variables with expectation $\mu$. Let $N$ be a positive integer-valued random variable such that $E[N] < \infty$ and such that $I_{N≥n}$ is independent of $X_n$ for all $n$. Prove that $$E\!\left[\sum_{i=1}^NX_i\right]=\mu\, E[N]$$
This is a question from an exam a few years ago. I don’t even know where to start here. What is meant by $I_{N≥n}$?
You have to condition on the event that $N=k$ for some integer $k$; $$ E \left[ \sum_{i=1}^N X_i \right] = \sum_{k=0}^{+\infty} E \left[ \sum_{i=1}^N X_i \bigg| N = k \right] P(N=k)\\ =\sum_{k=0}^{+\infty} \sum_{i=1}^k E \left[ X_i \right] P(N=k), \quad \text{by independence of } X_i \text{ and } N \\ = \mu \sum_{k=0}^{+\infty} k P(N=k), \quad \text{since } E[X_i] = \mu \\ = \mu E[N] $$