in some lecture notes, I stumbled upon the following formula : that if $X$ is a non-negative real-valued random variable then :
$\mathbb{E}[X] = \sum_{n \geq0} \mathbb{P}(X \geq n)$
I tried looking for proofs on MSE and elsewhere but only found for general cases which involve measure theory.
for this specific discrete case I tried the following :
$$\begin{align} & \sum_{n \geq0} \mathbb{P}(X \geq n) = \sum_{n \geq0}\sum_{k \geq n}\mathbb{P}(X =k )= \sum_{k \geq 0}\mathbb{P}(X =k ) + \sum_{k \geq 1}\mathbb{P}(X =k ) + \cdots \\ & \end{align}$$
if you expand each series term by term and align each same term one under the other, you can notice that there's :
one $\,\mathbb{P}(X =0)$ term, two $\,\mathbb{P}(X =1)$ terms, three $\,\mathbb{P}(X =2)$ terms and so on, in general we have $n+1$ $\,\mathbb{P}(X =n)$ terms
problem is If I apply same reasoning to the usual definition of the expectation then I find only $n$ $\,\mathbb{P}(X =n)$ terms
is the formula in the lecture notes wrong or is my reasoning wrong ? also I'd like a more formal proof where I can see the importance of the condition of positiveness.
thanks !