Show that $\mathbb{E}X^2<\infty$ if and only if $\sum_{n=1}^\infty n\cdot\mathbb{P}(|X|>n)<\infty$. Show that $\mathbb{E}X^2<\infty$ if and only if $\sum_{n=1}^\infty n\cdot\mathbb{P}(|X|>n)<\infty$.
I'm quite stuck on this question. So far my idea has been to try to rearrange these two quantities into forms that are more comparable to each other. So far I have
\begin{align*}
\sum_{n=1}^\infty n\mathbb{P}(|X|>n)&=\sum_{n=1}^\infty n\sum_{k=n+1}^\infty (\mathbb{P}(X=n)+\mathbb{P}(X=-n))\\
&=\sum_{n=1}^\infty \sum_{k=n+1}^\infty n(\mathbb{P}(X=n)+\mathbb{P}(X=-n))
\end{align*}
and
\begin{align*}
\mathbb{E}X^2&=\sum_{n=-\infty}^\infty n^2\mathbb{P}(X=n)\\
&=\sum_{n=1}^\infty n^2(\mathbb{P}(X=n)+\mathbb{P}(X=-n))\\
&=\sum_{n=1}^\infty n\cdot n(\mathbb{P}(X=n)+\mathbb{P}(X=-n))\\
&=\sum_{n=1}^\infty\sum_{k=1}^n n(\mathbb{P}(X=n)+\mathbb{P}(X=-n)).
\end{align*}
From here, the two quantities are in pretty similary forms, where the first one looks like it is summing the tail, and the first one is summing the beginning (who knows a better term?). But I cannot see how to draw the if and only if from this. Maybe this is the wrong approach entirely, and I am missing some key theorem or something. Anybody know what I can do here? Any help appreciated.
 A: Firstly, we prove the following Robin's identity:
Let $(\Omega,\mathcal{F},P)$ be a probability space and let $X:\Omega\rightarrow[0,\infty)$
be a non-negative random variable. Then, for any $p\in[1,\infty)$,
$$
\int X^{p}dP=\int_{0}^{\infty}px^{p-1}P\left([X>x]\right)dx=\int_{0}^{\infty}px^{p-1}P\left([X\geq x]\right)dx.
$$
Proof: Let $A=\{(x,\omega)\in[0,\infty)\times\Omega\mid X(\omega)>x\}$.
We show that $A$ is jointly measurable, i.e., $A\in\mathcal{B}([0,\infty))\otimes\mathcal{F}$.
Observe that
\begin{eqnarray*}
A & = & \bigcup_{r\in\mathbb{Q}}\{(x,\omega)\mid X(\omega)>r>x\}\\
 & = & \bigcup_{r\in\mathbb{Q}}\left(\{(x,\omega)\mid X(\omega)>r\}\cap\{(x,\omega)\mid r>x\}\right)\\
 & = & \bigcup_{r\in\mathbb{Q}}\left([0,\infty)\times X^{-1}\left((r,\infty)\right)\cap[0,r)\times\Omega\right)\\
 & \in & \mathcal{B}([0,\infty))\otimes\mathcal{F}.
\end{eqnarray*}
Let $B=\{(x,\omega)\in[0,\infty)\times\Omega\mid X(\omega)\geq x\}$.
Note that $B^{c}=\{(x,\omega)\mid X(\omega)<x\}$ which can be proved
jointly measurable in a similar way. Therefore $B$ is jointly measurable.
By Tonelli-Fubini Theorem, we have that
$$
\int\left(\int_{0}^{\infty}px^{p-1}1_{A}(x,\omega)\,d\lambda(x)\right)dP(\omega)=\int_{0}^{\infty}\left(\int px^{p-1}1_{A}(x,\omega)\,dP(\omega)\right)d\lambda(x),
$$
where $\lambda$ is the Lebesgue measure on $[0,\infty)$. Observe
that
\begin{eqnarray*}
\int\left(\int_{0}^{\infty}px^{p-1}1_{A}(x,\omega)\,d\lambda(x)\right)dP(\omega) & = & \int\left(\int_{0}^{\infty}1_{[0,X(\omega))}(x)px^{p-1}dx\right)dP(\omega)\\
 & = & \int X^{p}dP.
\end{eqnarray*}
On the other hand,
\begin{eqnarray*}
\int_{0}^{\infty}\left(\int px^{p-1}1_{A}(x,\omega)\,dP(\omega)\right)d\lambda(x) & = & \int_{0}^{\infty}px^{p-1}P\left([X>x]\right)dx.
\end{eqnarray*}
This shows that $\int X^{p}dP=\int_{0}^{\infty}px^{p-1}P\left([X>x]\right)dx$.
By replacing $A$ with $B$ and applying Tonelli-Fubini Theorem again,
we have
$$
\int X^{p}dP=\int_{0}^{\infty}px^{p-1}P\left([X\geq x]\right)dx.
$$

We go back to your question. By replacing $X$ with $|X|$, without
loss of generality, we may assume that $X\geq0$. Suppose that $\int X^{2}dP<\infty$.
Then
\begin{eqnarray*}
\int_{0}^{\infty}xP\left([X>x]\right)dx & = & \frac{1}{2}\int X^{2}dP<\infty.
\end{eqnarray*}
By Monotone Convergence Theorem, we have
\begin{eqnarray*}
\int_{0}^{\infty}xP\left([X>x]\right)dx & = & \int_{0}^{\infty}\sum_{k=0}^{\infty}1_{[k,k+1)}(x)\cdot xP\left([X>x]\right)dx\\
 & = & \sum_{k=0}^{\infty}\int_{k}^{k+1}xP\left([X>x]\right)dx\\
 & \geq & \sum_{k=0}^{\infty}\int_{k}^{k+1}kP\left([X>k+1]\right)dx\\
 & = & \sum_{k=0}^{\infty}kP\left([X>k+1]\right).
\end{eqnarray*}
That is, $\sum_{k=0}^{\infty}kP\left([X>k+1]\right)<\infty$. Observe
that
\begin{eqnarray*}
\sum_{k=0}^{\infty}(k+1)P\left([X>k+1]\right) & = & \sum_{k=0}^{\infty}kP\left([X>k+1]\right)+\sum_{k=0}^{\infty}P\left([X>k+1]\right)\\
 & \leq & \sum_{k=0}^{\infty}kP\left([X>k+1]\right)+ 1 +\sum_{k=0}^{\infty}kP\left([X>k+1]\right) \\
 & < & \infty.
\end{eqnarray*}
Hence, $\int X^{2}dP<\infty\Rightarrow\sum_{n=1}^{\infty}nP\left([X>n]\right)<\infty$.
Conversely, suppose that $\sum_{n=1}^{\infty}nP\left([X>n]\right)<\infty$.
Note that
\begin{eqnarray*}
\int_{0}^{\infty}xP\left([X>x]\right)dx & = & \sum_{k=0}^{\infty}\int_{k}^{k+1}xP\left([X>x]\right)dx\\
 & \leq & \sum_{k=0}^{\infty}\int_{k}^{k+1}(k+1)P\left([X>k]\right)dx\\
 & = & \sum_{k=0}^{\infty}(k+1)P\left([X>k]\right)\\
 & \leq & 1+ \sum_{k=0}^{\infty}2k\cdot P\left([X>k]\right)\\
 & = & 1+ 2\sum_{k=0}^{\infty}k\cdot P\left([X>k]\right)\\
 & < & \infty.
\end{eqnarray*}
This shows that $\sum_{n=1}^{\infty}nP\left([X>n]\right)<\infty\Rightarrow\int X^{2}dP<\infty$.
A: Hint: if $X$ is positive, then $$\sum_{n \in \mathbf{N}} n P(X > n) = \sum_{n \in \mathbf{N}} \sum_{k > n} nP(X = k) = \sum_{k \in \mathbf{N}} \sum_{n < k} n P(X = k) = \sum_{k \in \mathbf{N}} \dfrac{k(k-1)}{2} P(X = k)$$
A: Firstly, we have that
\begin{align*}
\mathbb{E}X^2&=\sum_{k=-\infty}^\infty k^2\mathbb{P}(X=k)\\
&=\sum_{k=1}^\infty k^2(\mathbb{P}(X=k)+\mathbb{P}(X=-k)).
\end{align*}
We also have that
\begin{align*}
\sum_{n=1}^\infty n\mathbb{P}(|X|>n)&=\sum_{n=1}^\infty\sum_{k=n+1}^\infty n(\mathbb{P}(X=k)+\mathbb{P}(X=-k))\\
&=\sum_{k=2}^\infty(\mathbb{P}(X=k)+\mathbb{P}(X=-k))\sum_{n=1}^{k-1}n\\
&=\sum_{k=2}^\infty\frac{k(k-1)}2(\mathbb{P}(X=k)+\mathbb{P}(X=-k)).\\
\end{align*}
And now the if and only if is obvious.
