# Expectation of Discrete Uniform Distribution

## Theorem

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

Then the expectation of $X$ is given by:

$E \left({X}\right) = \dfrac {n+1} 2$

## Proof

From the definition of expectation:

$\displaystyle E \left({X}\right) = \sum_{x \in \Omega_X} x \Pr \left({X = x}\right)$

Thus:

 $\displaystyle E \left({X}\right)$ $=$ $\displaystyle \sum_{k=1}^n k \left({\frac 1 n}\right)$ $\quad$ Definition of discrete uniform distribution $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 n \sum_{k=1}^n k$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 n \frac {n \left({n+1}\right)} 2$ $\quad$ from Closed Form for Triangular Numbers $\quad$ $\displaystyle$ $=$ $\displaystyle \frac {n+1} 2$ $\quad$ $\quad$

$\blacksquare$