Random Variable has Zero Variance iff Almost Surely Constant

Theorem
Let $X$ be a random variable such that $\expect {X^2}$ exists.

Then $\var X = 0$ there exists $c \in \R$ with $\map \Pr {X = c} = 1$.

That is, $X$ is almost surely constant.

Sufficient Condition
Suppose that there exists some $c \in \R$ with $\map \Pr {X = c} = 1$.

From Expectation of Almost Surely Constant Random Variable:


 * $\expect X = c$

Let $\map \supp X$ be the support of $X$.

Since $\map \Pr {X = c} = 1$, we have:


 * $\map \supp X = \set c$

We therefore have:

Hence, from Variance as Expectation of Square minus Square of Expectation:

Necessary Condition
Suppose now that $\var X = 0$.

By definition of variance:


 * $\expect {\paren {X - \expect X}^2} = 0$

From Condition for Expectation of Non-Negative Random Variable to be Zero:


 * $\map \Pr {\paren {X - \expect X}^2 = 0} = 1$

That is:


 * $\map \Pr {X - \expect X = 0} = 1$

giving:


 * $\map \Pr {X = \expect X} = 1$

Setting $c = \expect X \in \R$, we see that we have $c \in \R$ such that:


 * $\map \Pr {X = c} = 1$