Let $X>0$ be non-negative random variable:
- Show that, if $X$ is an integer random variable, then $\mathbb{E}[X] = \sum_{n\geq1}P(X\geq n)$
- Find and prove the corresponding formula for the case, when $X$ has a density function.
For the first one, I have already found a solution: Find the Mean for Non-Negative Integer-Valued Random Variable
However, for the second one, I have tried by myself but I am not sure, whether my answer is correct. My answer is the following:
\begin{eqnarray*} \sum_{n=0}^{\infty}P(X>n)&\overset{\small P(X>n)=(1-P(X \leq n))}{=} \: &\sum_{n=0}^{\infty} (1-F_X(n))\\ &=& \sum_{n=0}^{\infty} \left(1- \int_{-\infty}^{\infty}f(x)\ dx\right)\\ &= &\sum_{n=0}^{\infty} \left(\int_{-\infty}^{\infty}f(x)\ dx - \int_{-\infty}^{n}f(x)\ dx\right) \\ & =& \sum_{n=0}^{\infty} \left(\int_{-\infty}^{n}f(x)\ dx + \int_{n}^{\infty}f(x)\ dx - \int_{-\infty}^{n}f(x)\ dx\right) \\ & = &\sum_{n=0}^{\infty} \left(\int_{n}^{\infty}f(x)\ dx\right). \end{eqnarray*}
I am not sure if $$ \int_{-\infty}^{\infty} f(x)\ dx=1 $$ hold in this case? I would appreciate any kind of remarks or help in this case.