TITLE: How is this step in the proof that $E[X]=\sum_{x=1}^\infty P(X\geq x)$ justified?
QUESTION [0 upvotes]: From Wikipedia,

$$\sum_{i=1}^\infty P(X\geq i)=\sum_{i=1}^\infty\sum_{j=i}^\infty P(X=j).$$Interchanging the order of summation, we have,$$\sum_{i=1}^\infty\sum_{j=i}^\infty P(X=j)=\sum_{j=1}^\infty\sum _{i=1}^jP(X=j)$$

But this isn't simply exchanging the order of summation—this is also changing one of the indices from an infinite index to a finite index. I can't follow algebraically what's going on here.

REPLY [3 votes]: No, it’s just interchanging the order of summation. The double sum $$\sum_{i\ge 1}\sum_{j\ge i}P(X=j)$$ is taken over all pairs $\langle i,j\rangle\in\Bbb Z^+\times\Bbb Z^+$ such that $j\ge i$, and the double sum $$\sum_{j\ge 1}\sum_{i=1}^jP(X=j)$$ is taken over all pairs $\langle i,j\rangle\in\Bbb Z^+\times\Bbb Z^+$ such that $i\le j$; these are the same thing.
It’s like integrating some function $f(x,y)$ over the region lying above the line $y=x$, to the right of the line $x=1$, and above the line $y=1$: interchanging the order of integration gives you the two iterated integrals
$$\int_1^\infty\int_x^\infty f(x,y)\,dydx=\int_1^\infty\int_1^y f(x,y)\,dxdy\;.$$
{"set_name": "stack_exchange", "score": 0, "question_id": 454437}