Skip to content

Discrete Uniform Distribution

Definition

Let A={a1,…,an}A=\{a_1,\ldots,a_n\} be a nonempty finite set of distinct real values. A variable is discrete uniform on AA if pX(ai)=1/np_X(a_i)=1/n for each ii and its PMF is zero outside AA.

The course's integer-range case has A={a,a+1,…,b}A=\{a,a+1,\ldots,b\}, where a≤ba\le b are integers, and

pX(k)=1b−a+1,k=a,…,b.p_X(k)=\frac{1}{b-a+1},\qquad k=a,\ldots,b.

The mean and variance formulas below apply to this consecutive-integer case; for an arbitrary finite set, average its listed values and squared deviations.


Interpretation

A discrete uniform variable picks one value from a finite set, with every value equally likely. It is the random-variable form of naive probability, as for a fair die or a random integer from a range.

Six equal probability bars of height 1/6 for the faces of a fair die, with the mean 3.5 marked.

The figure shows a fair die, A={1,…,6}A=\{1,\ldots,6\}: six bars of equal height 16\tfrac{1}{6}. The dashed line at 3.53.5 marks the mean from the Key Results; it lies at the centre because the bars are placed symmetrically, and it is not itself a possible value. The variance 35/1235/12 in the figure is the formula (n2−1)/12(n^2-1)/12 with n=6n=6 values.

Only the number of values matters for the probabilities: each mass is 1/n1/n, and the probability of a set of values is the number of points of AA in that set divided by nn. For the integer range a,…,ba,\ldots,b there are n=b−a+1n=b-a+1 values, which is where the denominator in the PMF comes from; a common slip is to count b−ab-a values, but {3,…,7}\{3,\ldots,7\} has 55 values, not 44.

A sum of uniform variables need not be uniform: the total of two fair dice takes the 1111 values 2,…,122,\ldots,12, but 77 arises from six of the 3636 equally likely pairs and 22 only from (1,1)(1,1) (see sum of independent random variables). The uniform distribution on an interval is the continuous counterpart, spreading probability evenly over an interval instead of over finitely many points.


Key Results

  • EX=(a+b)/2\mathbb{E}X=(a+b)/2.
  • Var⁡(X)=((b−a+1)2−1)/12\operatorname{Var}(X)=((b-a+1)^2-1)/12.

Examples

  • A fair die has mean 3.53.5 and variance 35/1235/12.
  • A uniform integer on {−2,−1,0,1,2}\{-2,-1,0,1,2\} has P(X≥1)=2/5\mathbb{P}(X\ge1)=2/5 and mean 00.

Prerequisites

Sources

Aliases: Dunif, discrete uniform random variable, discrete uniform

Last updated: 27 October 2026 11:52