Statistics Quest

Continuous uniform distribution

The continuous uniform distribution gives every value in an interval [a, b] the same density.

f(x)=1b−a,    a≤x≤b;F(x)=x−ab−af(x) = \frac{1}{b-a}, \;\; a \le x \le b; \qquad F(x) = \frac{x-a}{b-a}
pdf and cdf on the interval
a,ba, b
lower and upper ends of the interval (a<ba < b)
xx
a value in the interval
E⁡(X)=a+b2,Var⁡(X)=(b−a)212\E(X) = \frac{a+b}{2}, \qquad \Var(X) = \frac{(b-a)^2}{12}
Mean and variance
XX
X∼Uniform(a,b)X \sim \text{Uniform}(a, b)

When to use

When every value in a range is equally likely: a random arrival time within a known window, rounding error, random numbers used in simulation. Probabilities are proportional to interval length.

How to interpret

  • P(c≤X≤d)=(d−c)/(b−a)P(c \le X \le d) = (d - c)/(b - a) for c,dc, d inside the interval.
  • The quantile is Q(p)=a+p(b−a)Q(p) = a + p(b - a).

Common mistakes

  • Dividing by 12 without squaring the width in the variance.
  • Using the continuous uniform for a die (that is the discrete uniform on 1–6).

Example

A bus arrives at a uniformly random time in the next 20 minutes. P(X≤12)=12/20=0.6P(X \le 12) = 12/20 = 0.6; the 90th percentile is 18 minutes; mean 10 minutes, SD 20/12≈5.7720/\sqrt{12} \approx 5.77 minutes.