Discrete Uniform Distribution Explained with Worked Examples

The discrete uniform distribution on has , mean and variance .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Discrete uniform distribution means

For a fair die, : and . For : and . The probability on a die is . The formulas come from the sums and (sum of the first n integers, triangular numbers) inserted in the expectation and variance formulas.

With variance the standard deviation of a die is . The continuous analogue is the uniform distribution (the continuous uniform distribution), with variance , the limit when is large.

The sum of two dice is not uniform but triangular (sums of independent random variables), and the average of many rolls is approximately normal (the central limit theorem). Equally likely outcomes are the starting point of probability (the probability of an event).

What is it used for?

A discrete uniform variable gives every value in a list the same chance, as with a fair die.

How to use discrete uniform distribution

  1. Identify , the number of equally likely values.
  2. Each has probability .
  3. Mean , variance .
  4. Add probabilities for ranges of values.

Graph

Probabilities for a fair die: 1/6 for each face1/60123456700.050.10.150.2Probabilities for a fair die: 1/6 for each facefaceyGraph with x from 0 to 7 and y from 0 to 0.22. Shows bars (6); point 1/6 at (3, 0.1667).

The mean is 3.5 and the variance 35/12.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: die, mean

Find for a fair die.

Worked example
Answer
3.53.5
  1. Formula

Example 2: die, variance

Find for a fair die.

Worked example
Answer
2.91672.9167
  1. Formula

Example 3: n = 10, variance

Find for .

Worked example
Answer
8.258.25
  1. Formula

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

A fair die

P(X = k) = 1/6 for k = 1..6

Equally likely.

Mean

(n + 1)/2 = 3.5

For n = 6.

Variance

(n² − 1)/12 = 35/12 ≈ 2.9167

For n = 6.

Standard deviation

√2.9167 ≈ 1.7078

Spread of a die.

Word problems

If X is uniform on {1, 2, …, n}, then P(X = k) = 1/n, E(X) = (n + 1)/2 and Var(X) = (n² − 1)/12.

Probability

Find P(X = 3) for a fair die.

  1. 1/6
  2. Check: ✓0.1667.

Mean

Find E(X) for a fair die.

  1. (6 + 1)/2
  2. Check: ✓3.5.

Variance Higher

Find Var(X) for a fair die.

  1. (36 − 1)/12
  2. Check: 2.9167 ✓2.9167.

n = 10 Higher

Find the mean and variance for X uniform on 1..10.

  1. Mean5.5
  2. Variance99/12 = 8.25
  3. Check: ✓5.5 and 8.25.

Common mistakes

Using n/2 for the mean

n/2 = 3 ✗

(n + 1)/2 = 3.5 ✓

Values start at 1.

Using n²/12

36/12 = 3 ✗

(n² − 1)/12 ✓

Subtract 1.

Forgetting the values start at 1

range 0..n−1 ✗

adjust the mean ✓

Shift by 1.

Treating as continuous

density 1/n ✗

probability mass 1/n ✓

Discrete.

Exam tips

  1. P = 1/n.
  2. Mean (n + 1)/2.
  3. Var (n² − 1)/12.
  4. Values 1..n.
  5. Dice are the classic case.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. Mean for n = 10 Foundation

5.5

2. Variance for n = 4 Foundation

1.25

3. P(X = 2) for n = 8 Foundation

0.125

4. Mean for n = 100 Higher

50.5

5. Variance for n = 12 to 4 d.p. Higher

11.9167

6. SD for n = 6 to 4 d.p. Higher

1.7078

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Discrete uniform
Equal probability on finitely many values.
Probability mass function
P(X = k).
Expectation
Mean value.
Variance
Spread.
Support
Possible values.
Fair die
Uniform on 1..6.

Frequently asked questions

What is a discrete uniform distribution?

All n values equally likely.

What are its mean and variance?

(n + 1)/2 and (n² − 1)/12.

What is the variance of a die?

35/12.

How is it different from continuous uniform?

It has a finite set of values.

Which page covers E(g(X))?

expectation of a function of X.

Which page covers variance?

variance and standard deviation.

More in Advanced statistics and stochastic processes and the formula sheets.