Suppose I have some function $f(\bullet)$ and a random variable $X$ with known distribution (let us say for example $X$ has a geometric distribution with mean $\displaystyle\frac{1}{1-\alpha}$).
I want to know: Is the expectation with respect to $X$ of the following summation easily computed?
$$\mathbb{E}_X\left[\sum\limits_{k=0}^{X}f(k)\right].$$
Is it something like this when I use a random variable with geometric distribution:
$$\sum\limits_{k=0}^{\infty}\alpha^kf(k)?$$
A convenient approach when dealing with sums of a random number of terms is to rewrite them as series, using indicator functions. For example, $$ Y=\sum_{k=0}^Xf(k) $$ is also $$ Y=\sum_{k=0}^\infty f(k)\,\mathbf 1_{X\geqslant k}. $$ If $f$ is nonnegative or if the series converges, integrating both sides yields $$ E(Y)=\sum_{k=0}^\infty f(k)\,P(X\geqslant k). $$