I want to show $E(X)=\sum_{n=1}^\infty P(X\ge n)$ Let $X:\Omega \to \mathbb N$ be a random variable on probability space $(\Omega,\mathcal B,P)$ .show that $$E(X)=\sum_{n=1}^\infty P(X\ge n).$$
my definition from $E(X)$ is equal
$$E(X)=\int_\Omega X \, dP.$$
Thanks.
 A: I think the standard way of doing this is by writing 
$$X =\sum_{n=1}^\infty \mathbf{1}(X\ge n)$$
$$E(X) =E\left(\sum_{n=1}^\infty \mathbf{1}(X\ge n)\right)$$
and then reverse order of expectation and sum (by Tonelli's theorem)
A: Definition of $E(X)$ for discrete $X$ is $E(X) = \sum_i x_i \cdot P(X = x_i)$.
$$P( X \ge i ) = P( X = i ) + P( X = i + 1 ) + \cdots$$
So
\begin{align}
& \sum_i P( X \ge i ) = P( X \ge 1 ) + P( X \ge 2 ) + \cdots \\[8pt]
= {} & P( X = 1 ) + P( X = 2 ) + P( X = 3 ) + \cdots + P(X = 2 ) + P( X = 3 ) + \cdots
\end{align}
(we rearange the terms in the last expression)
\begin{align}
& = 1 \cdot P( X = 1 ) + 2 \cdot P( X = 2 ) + 3 \cdot P( X = 3 ) + \cdots \\[8pt]
& = \sum_i i \cdot P( X = i )
\end{align}
q.e.d.
A: I like January's answer. May I suggest a way to write down the series so that the eye catches the rearrangement more easily (this is the way I like to write it on the blackboard)?
$$
\begin{eqnarray}
\sum_{k=1}^\infty P(X\geq k) &=& \quad P(X\geq 1) \quad=\quad P(X=1)&+&P(X=2)&+&P(X=3) &+& \;\dots\\
&+& \quad P(X\geq 2) &+& P(X=2) &+&P(X=3)&+& \;\dots \\ \\
&+& \quad P(X\geq 3) && &+& P(X=3)&+& \;\dots \\ \\
&+& \quad\quad\;\; \dots && &&&+& \;\dots\\
\end{eqnarray}
$$
(The rearrangement is mathematically sound because this is a series of positive terms.)
A: One of the other excellent answers here (from seanv507) has noted that this expectation rule actually follows from a stronger result that expresses the underlying random variable as an infinite sum of indicator variables.  It is possible to prove a more general result, and this can be used to get the expectation rule in the question.  If $X: \Omega \rightarrow \mathbb{N}$ (so its support is no wider than the natural numbers) then it can be shown (proof below) that:
$$X = \sum_{n=1}^{\max(X,m)} \mathbb{I}(X \geqslant n)
\quad \quad \quad
\text{for all } m \in \mathbb{N}.$$
Taking $m \rightarrow \infty$ then gives the useful result:
$$X = \sum_{n=1}^{\infty} \mathbb{I}(X \geqslant n).$$
It is worth noting that this result is stronger than the expectation rule in the question, since it gives a decomposition for the underlying random variable, and not just its moment.  As noted in the other answer, taking expectations of both sides of this equation, and applying Tonelli's theorem (to swap the order of the sum and expectation operators), gives the expectation rule in the question.  This is a standard expectation rule that is used when dealing with non-negative random variables.

The above result can be proved fairly simply.  Begin by observing that:
$$X = \underbrace{1+1+ \cdots +1}_{ X \text{ times}} + \underbrace{0+0+ \cdots +0}_{ \text{countable times}}.$$
For any $m \in \mathbb{N}$ we therefore have:
$$\begin{equation} \begin{aligned}
X &= \underbrace{1+1+ \cdots +1}_{ X \text{ times}} + \underbrace{0+0+ \cdots +0}_{ \max(0,m-X) \text{ times}} \\[6pt] 
&= \sum_{n=1}^X \mathbb{I}(X \geqslant n) + \sum_{n=1}^{\max(0,m-X)} \mathbb{I}(X \geqslant X+ n) \\[6pt]
&= \sum_{n=1}^X \mathbb{I}(X \geqslant n) + \sum_{n=X+1}^{\max(X,m)} \mathbb{I}(X \geqslant n) \\[6pt]
&= \sum_{n=1}^{\max(X,m)} \mathbb{I}(X \geqslant n) . \\[6pt] 
\end{aligned} \end{equation}.$$
