If $Var(X)=0$ then is $X$ a constant?
We know that the variance of a constant is $0$. Is the converse also true? Can we say that if the variance of some random variable is $0$ it is a constant?
Solution 1:
If $\text{Var }X = 0$:
First, as $\text{Var }X < \infty$, both $E[X]$ and $E[X^2] $ exist.
$$ E[(X-E[X])^2] = 0 $$ and as $(X-E[X])^2 \ge 0$ this implies $P((X-E[X])^2 \neq 0) = 0$. In other words, $$ X = E[X] \text{ a.s.} $$
Alternative:
one always has
$$ E[X^2] \ge E[X]^2 $$ because of the Cauchy-Schwarz inequality (with $X$ and $1$). If $$ 0 = \text{Var }X =E[X^2] - E[X]^2 $$then using the equality case: $$ \exists \lambda \ \ \ X = \lambda \times 1 \text{ a.s.} $$
Solution 2:
Let $f\geq 0$ be a measurable function on $X$ with $\int_X f = 0$. We claim that $f$ is zero a.e. Suppose that this is not the case. For each $\epsilon > 0$, the set $U_\epsilon = f^{-1}(\epsilon, \infty)$ is measurable. Since $f^{-1}(0, \infty) = \bigcup_{n=1}^\infty U_{1/n}$, some $U_\epsilon$ must have measure $\mu > 0$. Thus $\int_X f \geq \int_{U_\epsilon} f \geq \epsilon \mu > 0$.
Thus if $X$ is a random variable with variance $\operatorname{Var}(X) = E[(X - E[X])^2] =0$, then $X -E[X]$ must vanish almost surely.