Solving some Integrals using Indicators and Fubini’s Theorem
1. The problem
My students sometimes (often?) find it hard to see why, for example, for a positive continuous rv
\begin{align*} \E X &= \int_0^{\infty} G(x) \d x, \\ \E{X^2} &= 2 \int_{0}^\infty x G(x) \d x. \end{align*}Here I show how to do this.
2. The solutions
We start with a discrete positive rv.
Exercise 1.
For a nonnegative discrete random variable \(X\), use an indicator function to prove that
\begin{align*} \E X = \sum_{k=0}^\infty G(k), \end{align*}where \(G(k) = \P{X > k}\).
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
Exercise 2.
For a nonnegative discrete \(X\), use an indicator function to prove that
\begin{align*} \sum_{i=0}^\infty i G(i) = \frac{\E{X^2}}2 - \frac{\E{X}}2. \end{align*}Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
Exercise 3.
For general non-negative \(X\), use an indicator function to prove that
\begin{align*} \E X = \int_0^\infty x \d F(x) = \int_0^\infty G(y) \d y, \end{align*}where \(G(x) = 1 - F(x)\).
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
Exercise 4.
Use an indicator function to prove that for a general non-negative random variable \(X\)
\begin{align*} \E{X^2} = 2 \int_0^\infty y G(y) \d y, \end{align*}where \(G(x) = 1 - F(x)\).
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
Exercise 5.
Use integration by parts to see that \(\E{X^2} = 2 \int_0^\infty y G(y) \d y\).
Hint
In \(\int_0^\infty y G(y) \d y\) integrate first the \(y\) to \(y^2/2\).
Solution
Did you actually try? Write your solution down first for comparison.
Show the solution
since \(g(y) = G'(y) = - F'(y) = - f(y)\). Note that we used \(\frac{y^2}2 G(y) \bigg|_0^\infty = 0 - 0 = 0\), which follows from our assumption that \(\E{X^2}\) exists, implying that \(\lim_{y \to \infty} y^2G(y) = 0\).
Exercise 6.
Use substitution to see that \(\E{X^2} = 2\int_0^\infty y G(y) \d y\).
Hint
Substitute \(y = \sqrt x \implies \d y = \d x/ 2 \sqrt x \implies \d x = 2 y \d y\).
Solution
Did you actually try? Write your solution down first for comparison.