MathsFurther Statistics 2 › The continuous uniform distribution

The continuous uniform distribution

A flat density on an interval, which sounds too simple to be worth a name. It is the model for rounding error and waiting time, and its mean and variance come out of the general formulae in three lines.

Builds on Mean, variance and skewness and Density and distribution functions.

IN THIS TOPIC

  • Write down the density and distribution function of U(a, b) and read probabilities off as lengths.
  • Derive its mean and variance from the general integrals.

COMMON MISCONCEPTION

The variance of the uniform distribution on a to b is (b − a)²/4, since the range is b − a.

A rectangle of area one

If X is equally likely to fall anywhere in [a, b] then the density must be flat, and its area must be 1, so its height is 1/(b − a). Integrating gives a straight ramp for the distribution function, and the ramp is only the middle of it. F is a function of every real x, so all three branches are part of the answer:

F(x)=0 for x<a,x-ab-a for axb,1 for x>b\text{F}(x) = 0 \text{ for } x < a, \qquad \frac{x - a}{b - a} \text{ for } a \le x \le b, \qquad 1 \text{ for } x > bNOT IN THE BOOKLET — LEARN IT

The two flat branches are what make it a distribution function at all: F runs to 0 far to the left and to 1 far to the right, and the ramp already gives 0 at a and 1 at b, so both joins are continuous. Quoting the ramp alone leaves F undefined outside [a, b].

The booklet gives the uniform density, mean and variance but not this ramp, so learn it or rebuild it by integrating the flat density. Probabilities are therefore proportions of length, so P(c < X < d) is (d − c)/(b − a) for any interval inside the range. Rounding to the nearest unit gives an error modelled by U(−0.5, 0.5). A wait for a service that arrives every T minutes, joined at a random moment, is modelled by U(0, T).

The continuous uniform density on 2 to 8: a rectangle of height one sixth, with probability read off as width283 to 51/6P(3 < X < 5) = 2 × 1/6 = 1/3
FIG. 1The flat density on 2 to 8 with a strip shaded: probability is width times height, so it is proportional to length.

WORKED EXAMPLE

Reading off a uniform model

X follows U(2, 8). Find P(3 < X < 5) and P(X > 7).

The height is 1/6, so P(3 < X < 5) = 2 × 1/6 = 1/3.

P(X > 7) = 1 × 1/6 = 1/6. No integration was needed. With a flat density, lengths do all the work.

Mean and variance, derived

Symmetry puts the mean at the midpoint, and the integral confirms it. The variance takes one more line:

E(X)=a+b2,Var(X)=(b-a)212\text{E}(X) = \frac{a + b}{2}, \qquad \text{Var}(X) = \frac{(b - a)^{2}}{12}IN THE FORMULAE BOOKLET

Both sit in the booklet's table of standard continuous distributions, on the Uniform row, so check the 12 there rather than trusting your memory of it. The 12 is not a 4. The range is b − a, but the spread about the mean is much smaller than the range itself. Dividing by 4 would make the standard deviation half the range; the true figure is about 29% of it.

The distribution function of the uniform distribution on 2 to 8: a straight ramp from 0 to 1128mean 5variance = 36/12 = 3
FIG. 2The distribution function of the uniform model as a straight ramp, with its midpoint sitting above the mean.

GUIDED PRACTICE

Deriving the variance

For X following U(a, b), show that Var(X) = (b − a)²/12, and evaluate the mean and standard deviation for U(2, 8).

Show the working

E(X²) = ∫ x²/(b − a) dx from a to b = (b³ − a³)/[3(b − a)] = (a² + ab + b²)/3, using the difference of cubes.

Subtracting [(a + b)/2]² = (a² + 2ab + b²)/4 gives (4a² + 4ab + 4b² − 3a² − 6ab − 3b²)/12 = (a² − 2ab + b²)/12.

That is (b − a)²/12, as required.

For U(2, 8): mean 5, variance 36/12 = 3, and standard deviation √3 ≈ 1.73.

ASSESSMENT FOCUS

  • State the height of the density as 1/(b − a) before using it. Marks are given for it on its own.
  • Write F(x) piecewise, with 0 below a and 1 above b as well as the ramp between them.
  • The variance divides by 12. Check it against the rough rule that the standard deviation is about 29% of the range.

CHECK YOURSELF

X follows U(0, 10). Find P(X > 6.5) and the standard deviation.

Show a hint

A length over the range, then the variance formula.

Show the answer

P(X > 6.5) = 3.5/10 = 0.35. Var(X) = 100/12 = 8.33, so the standard deviation is 2.89 to three significant figures.

U(a, b) has density 1/(b − a) on the interval, and a distribution function in three branches: 0 below a, (x − a)/(b − a) on it, 1 above b, so probability is proportion of length.

Its mean is the midpoint (a + b)/2 and its variance is (b − a)²/12, a standard deviation of about 29% of the range.

WORKBOOK

Printable practice for this topic: original exam-style questions with room to work, and a fully worked answer book. Free to use; please do not redistribute or sell.

6 questions on this topicAnswer them one at a time and mark yourself against the worked answer.Practise this topic

Or read them with their worked answers on the the continuous uniform distribution questions page.

CHECK YOUR PROGRESS

Rate how confident you feel with each objective for this lesson. Ratings are saved in this browser, on this device, unless you sign in.

  • Write down the density and distribution function of U(a, b) and read probabilities off as lengths.
  • Derive its mean and variance from the general integrals.

Open the full revision checklist to see every objective in the course in one place.