Q:

Linearity of expectation for infinite sums?

I have a question related to this post: Expected value of infinite sum
Is the condition listed necessary/sufficient (or both?)
For instance, I'm thinking of $X_n=\frac{1}{n}Z_n$, where $Z_n \sim$N(0,1) are iid.  It "feels like" $E\sum_{n=1}^\infty X_n$=0, but $\sum_{n=1}^\infty E|X_n|$ =$\sum_{n=1}^\infty \frac{1}{n}E|Z_n|$ =$E|Z_1|\sum_{n=1}^\infty \frac{1}{n}=\infty$.  Thus, we can't use the result listed above to justify interchanging expectation and summation.  But I was wondering if my feeling is right.

A:

The condition provided is sufficient. See Fubini Theorem and scroll down to Fubini-Tonelli Theorem. This states that says:
If $\mathbb{E}\Big[\sum\limits_{i=1}^{\infty}\big|X_i\big|\Big] < \infty$  or $\sum\limits_{i=1}^{\infty} \mathbb{E}[|X_i|] < \infty$ then we may apply Fubini Theorem and compute the double integral using iterated integrals. 
As a note, we may use Fubini-Tonelli because probability measures are $\sigma-$finite and the counting measure on $\mathbb{N}$ is $\sigma-$finite. 
Consider what happens if,
$$X_n = \left\{ \begin{array}{ll} 
(-1)^{n}\frac{1}{n} & \text{with probability} \; \frac{1}{2}\\
0 & \text{with probability} \; \frac{1}{2}
\end{array} \right.$$
Both $\mathbb{E}\Big[\sum\limits_{n=1}^{\infty}\big|X_n\big|\Big] = \infty$  and $\sum\limits_{n=1}^{\infty} \mathbb{E}[|X_n|] =\infty$ the second is an easy series result while the first can be shown using Borel-Cantelli Lemma. However, the Fubini Theorem still holds for this example. 

