Show that E(X) = $\sum^{\infty}_{n=0} P(X > n)$ Show that, if X takes non negtive integet values:
$$
E(X) = \sum^{\infty}_{n=0} P(X > n)
$$
The solution is:
$$
E(X)
\!
\begin{aligned}[t]
& = \sum^{\infty}_{m=0} m * P(X = m) \\
& = \sum^{\infty}_{m=0} \underbrace{\sum^{m-1}_{n=0}}_{1}  P(X = m) \\
& = \sum^{\infty}_{m=0} \underbrace{\sum^{\infty}_{m=n+1}}_{2} P(X = m) \\
& = \sum^{\infty}_{n=0} P(X > n)
\end{aligned} 
$$
I do not get the mathematical passage that the author is making with the summation that I'm underlying.
Edit:
In the meanwhile, i propose another solution:
$$\begin{align*}
E(X)&=\sum_{n=1}^\infty nP(X=n)\\
&=P(X=1) + 2P(X=2)+3P(X=3)+\dots\\
&=\left(P(X=1)+P(X=2)+P(X=3)+\dots\right)+(P(X=2)+P(X=3)+\dots)+(P(X=3)+\dots)+\dots\\
&=P(X\geq 1) + P(X\geq2)+P(X\geq3)+\dots\\
 &=\sum^{\infty}_{n=1}P(X\geq n)\\
\end{align*}$$
Is that correct?
 A: The solution that you propose can be written in summation form this way:
$$
E(X) = \sum_{m=1}^\infty m P(X=m)
\stackrel{(1)}=\sum_{m=1}^\infty \sum_{n=1}^m P(X=m)
\stackrel{(2)}=\sum_{n=1}^\infty \sum_{m=n}^\infty P(X=m)
\stackrel{(3)}=\sum_{n=1}^\infty P(X\ge n)
$$
Step (1) is representing $mP(X=m)$ as the sum of $m$ copies of $P(X=m)$. This is what's happening in the first passage that you underlined.
Step (2) is an interchange of summation.  On the LHS of the $\stackrel{(2)}=$, the inner sum is over $n$ and the outer sum is over $m$. On the RHS of the $\stackrel{(2)}=$, the inner sum is over $m$ and the outer sum is over $n$. When we change the order of summation we must ensure that we end up visiting all possible pairs of $(m,n)$: $(1,1)$, $(2,1)$, $(2,2)$, $(3,1)$, $(3,2)$, $(3,3)$, $(4,1)$, $(4,2)$, $(4,3)$, $(4,4)$, and so on. (To see that this is true, plot these pairs as points in the $m-n$ plane. The left sum is visiting these pairs one column at a time; the right sum is visiting these pairs one row at a time.) This explains the second passage that you underlined, which is also performing an interchange of summation.
Step (3) is the same as in your solution. And of course $\sum_{n=1}^\infty P(X\ge n)$ is the same as $\sum_{n=0}^\infty P(X> n)$.
Viewed this way, your proposed solution looks a lot like the official solution. But the official solution has typographical problems with its indices.  Retaining the form of the official solution, one way to correct the problems is to write
$$E(X) = \sum_{m=0}^\infty m P(X=m)
\stackrel{(1)}=\sum_{m=\color{red} {1}}^\infty \sum_{n=0}^{m-1} P(X=m)
\stackrel{(2)}=\sum_{\color{red}{n}=0}^\infty \sum_{m=n+1}^\infty P(X=m)
\stackrel{(3)}=\sum_{n=0}^\infty P(X> n)
$$
But you should agree that the steps in your proposed solution are really the same as in the (corrected) official solution; it's just a difference in notation.
