Let X be a random variable taking values in N
$ \sum_{k \geq 0} \mathbb{P} (X>k) \dots (0)$
$= \sum_{k \geq 0} \sum_{i \geq k+1} \mathbb{P}(X=i) \dots (1)$
$= \sum_{i \geq 1} \sum_{k=0}^{i-1}\mathbb{P}(X=i) \dots (2) $
$= \sum_{i \geq1} i \mathbb{P}(X=i) \dots (3) $
$= \mathbb{E} [X] $
I am having a problem with the double sum, I don't see how to think of coming up with this, or how do we go from (0) to (2) , the way I reason by default is like :
$\mathbb{E} [X] = \sum_{k \in N} k \mathbb{P}(X=k) = 1 P(1) + 2 P(2) + ... $ then I block