Mean and Variance of the Discrete Uniform Distribution

Compute the expected value and variance of a discrete uniform random variable on a set of consecutive integers using closed-form formulas.

Step 1 of 119%

Tutorial

Mean of a Discrete Uniform Distribution

Suppose XX is a discrete uniform random variable on the consecutive integers {a,a+1,a+2,,b},\{a, a+1, a+2, \ldots, b\}, so that each of the n=ba+1n = b - a + 1 values has probability 1n.\dfrac{1}{n}.

The mean of XX is the midpoint of the smallest and largest values:

μ=E[X]=a+b2\mu = E[X] = \dfrac{a+b}{2}

For example, if XX is the result of rolling a fair six-sided die, then XX is discrete uniform on {1,2,3,4,5,6},\{1, 2, 3, 4, 5, 6\}, and

E[X]=1+62=72=3.5.E[X] = \dfrac{1+6}{2} = \dfrac{7}{2} = 3.5.
navigate · Enter open · Esc close · ⌘K/Ctrl K toggle