Originally Posted by

**synclastica_86** Thanks for all the help all. I know this might sound stupid, it's the first time that I did any kind of stats, but I thought Fubini's Theorem is used on integrals in vector calculus. How did you turn that into the 2 sums? I understand the reasoning behind what moo did the first time the most. Am I wrong to think so?

What Moo did is also "Fubini" (interchanging sums) but for a finite sum; in this case we don't say Fubini because it is always true by simple properties of the sum.

Let me repeat what Moo wrote in a pretty way:

$\displaystyle \begin{aligned}

1-F_X(0) &=\sum_{j=1}^\infty p(j)= &p(1)+ &p(2)+&p(3)+\dots+p(n)+\dots \hfill \\

1-F_X(1) &=\sum_{j=2}^\infty p(j)=& &p(2)+&p(3)+\dots+p(n)+\dots \hfill \\

1-F_X(2) &=\sum_{j=3}^\infty p(j)= & & &p(3)+\dots+p(n)+\dots \hfill \\

\vdots \hfill & & & & \hfill \\

\end{aligned}$

If you sum line after line (there are infinitely many), you get $\displaystyle \sum_{k=0}^\infty (1-F_X(k))$.

If you sum column after column, you get $\displaystyle 1p(1)+2p(2)+3p(3)+\cdots = \sum_{k=1}^\infty k p(k)$.

In order to justify why these sums are the same, you need a theorem. Fubini theorem holds for double integrals indeed, but there is a very similar theorem for double sums, and I think it is customary to call it Fubini as well.

Anyway, this theorem says that if we have nonnegative numbers $\displaystyle a_{ij}\geq 0$ (like in this case), then we can interchange the sum signs (whether the sum is finite or not):

$\displaystyle \sum_i\sum_j a_{ij}=\sum_j\sum_i a_{ij}$.

This amounts to adding the columns or the lines in the previous sketch.

NB: The theorem also gives a condition for doing the same in case there are negative numbers:

if $\displaystyle \sum_i \sum_j |a_{ij}|<\infty$, then $\displaystyle \sum_i \sum_j a_{ij} = \sum_j \sum_i a_{ij}$.

--

You may prefer not to use this theorem about double series and sum only $\displaystyle n+1$ lines of the previous sketch to get the equality Moo gives:

$\displaystyle \sum_{k=0}^n (1-F_X(k))=\left[\sum_{k=1}^n kp(k)\right]+(n+1) \sum_{k=n+1}^\infty p(k).$

Then you need to take the limit as $\displaystyle n$ tends to $\displaystyle \infty$. I gave a possible justification of the limits in the first part of my previous post.