Continuous Distributions

the continuous uniform distribution

Imagine a bus that you know will arrive sometime in the next ten minutes, but you have absolutely no information about when — any instant in that window is as likely as any other. That is the continuous uniform distribution: a random number that is equally happy to land anywhere on a fixed interval, with no spot preferred over its neighbours.

Write X ~ Uniform(a, b). The density is flat: f(x) = 1/(b - a) for x between a and b, and 0 outside. The height 1/(b - a) is whatever it must be so the area under the line equals 1 — over a width of (b - a), a rectangle of that height has area exactly 1. Probabilities are just lengths: P(c < X < d) = (d - c)/(b - a), the fraction of the interval that the sub-window covers. The mean sits in the middle, E[X] = (a + b)/2, and the spread is Var(X) = (b - a)^2 / 12. The cdf rises in a straight ramp from 0 at a to 1 at b.

The uniform is the simplest continuous model and the seed of all the others: a computer's random number generator produces (approximately) Uniform(0, 1) numbers, and the inverse-transform method turns those into samples from any distribution you like. One honest caution — 'uniform' here means uniform on an interval; people sometimes wrongly assume any 'random' continuous quantity is uniform, but most real measurements (heights, errors, waiting times) are not flat at all.

A meeting is set 'around 2pm' meaning the start is Uniform(1:50, 2:10), a 20-minute window. The chance it starts in the last 5 minutes (2:05 to 2:10) is (5)/(20) = 1/4. The expected start time is the midpoint, 2:00.

Over a uniform interval, every probability is just a ratio of lengths.

Because it is continuous, P(X = any single exact value) = 0; only intervals carry probability. The height 1/(b - a) is a density, not a probability — if (b - a) < 1 it exceeds 1, which is perfectly fine.

Also called
uniform distribution on [a, b]rectangular distribution均勻分配矩形分配