Variance of Discrete Uniform Distribution

Theorem
Let $X$ be a discrete random variable with the discrete uniform distribution with parameter $n$.

Then the variance of $X$ is given by:
 * $\var X = \dfrac {n^2 - 1} {12}$

Proof
From the definition of Variance as Expectation of Square minus Square of Expectation:
 * $\var X = \expect {X^2} - \paren {\expect X}^2$

From Expectation of Function of Discrete Random Variable:
 * $\displaystyle \expect {X^2} = \sum_{x \mathop \in \Omega_X} x^2 \map \Pr {X = x}$

So:

Then: