Quant Memo
Foundational

The Uniform Distribution

The "no information" distribution — every outcome in a range is equally likely, so the density is a flat rectangle. It is the humble seed from which every other random draw is grown on a computer.

Prerequisites: Random Variables & Distributions

The uniform distribution is the simplest continuous distribution there is: every value inside some interval is exactly as likely as every other, and nothing outside the interval can happen. Picture spinning a well-balanced pointer, or a random number generator handing you a value between 0 and 1, no spot is favoured. Because it plays no favourites, it's the natural model for "I know the range but nothing more," and it's the raw material every simulation starts from.

For a continuous uniform on the interval [a,b][a, b], the density is a flat plateau. To make the total area equal 1, the height must be one over the width:

f(x)=1ba,axb.f(x) = \frac{1}{b - a}, \qquad a \le x \le b .

Here aa and bb are the lower and upper ends of the range, and bab - a is the width. Widen the interval and the rectangle gets shorter; narrow it and it gets taller, always enclosing an area of exactly 1.

mean = (a+b)/2 a b height = 1/(b−a) value x →
A flat plateau of probability: inside [a, b] every value is equally likely, outside it nothing happens. The mean sits dead centre, and the shorter-and-wider the rectangle, the more spread out the outcomes.

Centre and spread

Because the shape is a symmetric rectangle, the mean is simply the midpoint, and the variance has a tidy closed form:

E[X]=a+b2,Var(X)=(ba)212.E[X] = \frac{a + b}{2}, \qquad \operatorname{Var}(X) = \frac{(b - a)^2}{12} .

The mean is obvious, the middle of the range. The variance being width-squared over twelve is a fact worth memorising: it turns up constantly, for example when you approximate rounding error (a rounded number is off by a uniform amount, giving the "quantisation noise" variance).

Everything about a continuous uniform comes from its two endpoints: mean is the midpoint (a+b)/2(a+b)/2, and variance is (ba)2/12(b-a)^2 / 12. The flat density means outcomes carry the least possible structure, maximum uncertainty for a fixed range.

The seed of all randomness

Here's the uniform's secret importance. Almost every random draw your computer makes, normal, exponential, whatever, is manufactured from uniform draws. The trick is the inverse-transform method: generate a uniform UU on [0,1][0,1], then feed it through the inverse of the target distribution's cumulative function. For the The Exponential Distribution, for instance, X=1λln(1U)X = -\tfrac{1}{\lambda}\ln(1 - U) turns a flat uniform into an exponential wait. So the unassuming rectangle is the foundation under Monte Carlo Integration and every simulation you'll ever run.

Any distribution can be sampled from a single Uniform(0,1) draw UU: compute X=F1(U)X = F^{-1}(U), where F1F^{-1} is the inverse of the target's cumulative distribution. It's why the uniform is the atom of every random-number generator.

Worked example

A shuttle is equally likely to arrive at any moment in the next 10 minutes, model its arrival time as uniform on [0,10][0, 10].

  • Average wait: E[X]=(0+10)/2=5E[X] = (0 + 10)/2 = 5 minutes.
  • Spread: Var(X)=(100)2/12=100/128.33\operatorname{Var}(X) = (10 - 0)^2 / 12 = 100/12 \approx 8.33, so the standard deviation is 8.332.89\sqrt{8.33} \approx 2.89 minutes.
  • Chance you wait more than 7 minutes: the favourable region is the interval [7,10][7, 10], of width 3, out of a total width of 10,
P(X>7)=10710=0.30.P(X > 7) = \frac{10 - 7}{10} = 0.30 .

For a continuous uniform, probabilities are just lengths: the chance of landing in any sub-interval is that sub-interval's width divided by the total width. No integration required, you're measuring a slice of the rectangle.

Where it misleads

  • "Random" is ambiguous. "Pick a random chord of a circle" has several equally reasonable uniform setups that give different answers (Bertrand's paradox). Always pin down what is being drawn uniformly.
  • Discrete vs continuous. A die is discrete uniform (six equal lumps); a spinner is continuous uniform. The mean formula is the same midpoint, but the discrete variance is (n21)/12(n^2 - 1)/12, not (ba)2/12(b-a)^2/12.
  • Flat is a strong claim. Real "anything in a range" quantities usually aren't perfectly flat, most values cluster somewhere. Uniform is the honest choice only when you genuinely have no reason to prefer any value.

The uniform is the plainest of the Common Distributions, the launchpad for Order Statistics (the min, max, and median of several uniform draws have elegant formulas), and, via inverse-transform sampling, the engine behind Monte Carlo Integration.

Related concepts

Practice in interviews

Further reading

  • Blitzstein & Hwang, Introduction to Probability, ch. 5
  • Ross, A First Course in Probability
ShareTwitterLinkedIn