# Variance of Discrete Uniform Distribution

Jump to: navigation, search

## Theorem

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

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$
$\displaystyle \expect {X^2} = \sum_{x \mathop \in \Omega_X} x^2 \map \Pr {X = x}$

So:

 $\displaystyle \expect {X^2}$ $=$ $\displaystyle \sum_{k \mathop = 1}^n k^2 \paren {\frac 1 n}$ $\quad$ Definition of Discrete Uniform Distribution $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 n \sum_{k \mathop = 1}^n k^2$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 n \frac {n \paren {n + 1} \paren {2 n + 1} } 6$ $\quad$ Sum of Sequence of Squares $\quad$ $\displaystyle$ $=$ $\displaystyle \frac {\paren {n + 1} \paren {2 n + 1} } 6$ $\quad$ $\quad$

Then:

 $\displaystyle \var X$ $=$ $\displaystyle \expect {X^2} - \paren {\expect X}^2$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac {\paren {n + 1} \paren {2 n + 1} } 6 - \frac {\paren {n + 1}^2} 4$ $\quad$ Expectation of Discrete Uniform Distribution: $\expect X = \dfrac {n + 1} 2$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac {2 \paren {2 n^2 + 3 n + 1} - 3 \paren {n^2 + 2 n + 1} } {12}$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac {n^2 - 1} {12}$ $\quad$ $\quad$

$\blacksquare$