The Uniform Distribution

1 The Uniform Distribution

The uniform distribution is one of the simplest and most intuitive continuous probability distributions in statistics. Where many distributions — such as the normal or exponential — concentrate probability mass around particular values, the uniform distribution does the opposite: it spreads probability perfectly evenly across a defined interval. Every sub-interval of equal width within the range is equally likely to contain the outcome. This property makes the uniform distribution the natural mathematical model for situations where you genuinely have no reason to prefer one value over another within a given range.

To appreciate why this matters, consider spinning a perfectly balanced prize wheel divided into a continuous arc, or imagine a software random number generator producing a decimal between 0 and 1. In both cases, no particular output value is favoured — the mechanism is deliberately designed to be indifferent across its full range. The uniform distribution gives us the precise mathematical language to describe and calculate probabilities in exactly these kinds of scenarios.

The uniform distribution is a continuous distribution, meaning outcomes can take any real value within its range, not just isolated integers. This distinguishes it from the discrete uniform distribution (where outcomes are, for example, the six faces of a fair die). Everything discussed below refers to the continuous version, which is the form most commonly encountered in statistics and applied probability.

What Is the Uniform Distribution?

A continuous random variable X follows a uniform distribution when its probability density is the same at every point within a fixed interval and zero everywhere outside that interval. The core idea is equal likelihood across a continuous range. There is no peak, no skew, no clustering — just a flat, constant level of probability from one end of the interval to the other.

This distinguishes the uniform distribution sharply from, say, the normal distribution, which piles most probability near its mean and tapers off toward the tails, or the exponential distribution, which places high probability near zero and decays rapidly. The uniform distribution has no preferred centre and no tails — it simply occupies its interval with perfectly constant density.

Common real-world situations that the uniform distribution models well include:

In each case, the key judgment is the same: there is no reason, given available information, to believe any value in the interval is more probable than any other. When that judgment holds, the uniform distribution is the appropriate and principled choice.

Parameters of the Uniform Distribution

The uniform distribution is fully described by just two parameters:

We write X ~ U(a, b) to denote that the random variable X follows a uniform distribution on the interval [a, b]. All values strictly below a or strictly above b have zero probability of occurring — they are simply impossible outcomes under this model.

The quantity (b − a) is the width of the interval, and it plays a central role in every formula associated with the distribution. A wide interval means outcomes are spread over a large range, producing greater uncertainty; a narrow interval concentrates outcomes more tightly, reducing uncertainty. For instance, U(0, 100) represents far greater variability than U(48, 52), even though both are uniform distributions.

Consider two examples that clarify the role of parameters:

Probability Density Function (PDF)

The probability density function (PDF) mathematically describes the relative likelihood of outcomes for a continuous random variable. For the uniform distribution U(a, b), the PDF is:

f(x) = 1 / (b − a)    for a ≤ x ≤ b
f(x) = 0              otherwise

The value 1/(b − a) is a constant — it does not depend on x at all. This is precisely what makes the distribution "uniform": the density function is flat across the entire interval. Graphically, the PDF traces a horizontal rectangle: it rises vertically from 0 to the height 1/(b − a) at x = a, remains flat until x = b, and drops back to 0.

A valid PDF must satisfy the requirement that the total area under its curve equals exactly 1 (since the total probability of all outcomes must be 100%). For the uniform distribution, this is easy to verify:

Total area = height × width = [1 / (b − a)] × (b − a) = 1  ✓

No matter what values a and b take (as long as b > a), the area is always 1. This confirms the uniform distribution is always a valid probability model.

The flat rectangular shape of the PDF is also a visual confirmation of equal likelihood: because the height is constant, every sub-interval of the same width contains exactly the same area under the curve — and area under a PDF corresponds to probability. So no sub-interval of a given width is ever favoured over another.

For X ~ U(10, 30), the PDF height is 1/(30 − 10) = 1/20 = 0.05. This is a small height because the distribution is spread across a wide interval. For X ~ U(0, 1), the height is 1/(1 − 0) = 1, a taller rectangle because the interval is narrower. In both cases, area = 1.

Calculating Probabilities

For continuous distributions, probability is calculated as the area under the PDF curve over the interval of interest. Because the uniform PDF is a constant height, computing the area reduces to the simple formula for the area of a rectangle:

P(c ≤ X ≤ d) = (d − c) / (b − a)    where a ≤ c < d ≤ b

This is nothing more than the width of the sub-interval of interest divided by the total width of the distribution's range. The result is the proportion of the total interval occupied by [c, d].

An important conceptual point: because X is a continuous random variable, the probability of X taking any single exact value is zero. Mathematically, a single point has zero width and therefore zero area under the curve. This means:

P(X = c) = 0    for any specific value c

Consequently, P(c ≤ X ≤ d) = P(c < X < d) = P(c ≤ X < d) — whether endpoints are included or excluded makes no difference for continuous distributions.

Let's walk through several worked examples to make this concrete.

Example 1: A train departs exactly every 20 minutes. A passenger arrives at the station at a completely random time. Let X be the waiting time in minutes. Then X ~ U(0, 20). What is the probability the passenger waits more than 14 minutes?

P(X > 14) = (20 − 14) / (20 − 0) = 6 / 20 = 0.30

There is a 30% chance the passenger waits more than 14 minutes.

Example 2: Using the same train scenario, what is the probability the passenger waits between 5 and 12 minutes?

P(5 ≤ X ≤ 12) = (12 − 5) / (20 − 0) = 7 / 20 = 0.35

Example 3: For X ~ U(0, 1), what is the probability X falls between 0.25 and 0.75?

P(0.25 ≤ X ≤ 0.75) = (0.75 − 0.25) / (1 − 0) = 0.50 / 1 = 0.50

Exactly half the probability lies in the middle half of the interval — a result that perfectly reflects the uniform distribution's symmetry.

The simplicity of the formula (d − c)/(b − a) is one of the uniform distribution's most practical virtues. Unlike the normal distribution, which requires tables or software to evaluate probabilities, the uniform distribution's probabilities are always just a ratio of lengths — arithmetic that can be done by hand in seconds.

Mean and Variance of the Uniform Distribution

The mean (expected value) of a uniform distribution is simply the midpoint of the interval:

μ = (a + b) / 2

This makes intuitive sense. Because the distribution is perfectly symmetric and flat, there is no reason for the average to fall anywhere other than the exact centre of [a, b]. For X ~ U(10, 30), the mean is (10 + 30)/2 = 20. For X ~ U(0, 1), the mean is 0.5.

The variance measures how spread out the values are around the mean. For the uniform distribution:

σ² = (b − a)² / 12

The standard deviation is the square root of the variance:

σ = (b − a) / √12 = (b − a) / (2√3)

Notice that both the variance and standard deviation depend only on the width of the interval (b − a), not on where the interval is located on the number line. Shifting the entire distribution left or right (changing both a and b by the same amount) changes the mean but leaves the variance unchanged.

A wider interval produces larger variance — reflecting the greater uncertainty about where in the range an outcome will fall. Consider this comparison:

Distribution a b Width (b − a) Mean μ Variance σ² Std Dev σ
U(0, 1) 0 1 1 0.5 0.0833 0.2887
U(0, 10) 0 10 10 5.0 8.333 2.887
U(10, 30) 10 30 20 20.0 33.333 5.774
U(0, 60) 0 60 60 30.0 300.0 17.321

The divisor of 12 in the variance formula is not arbitrary — it arises from the integration of (x − μ)² multiplied by the constant PDF over the interval, and it is a fixed characteristic of the uniform distribution's shape. A useful way to remember it: the uniform distribution's variance is always one-twelfth of the square of the interval's width.

Cumulative Distribution Function (CDF)

The cumulative distribution function (CDF), written F(x), gives the probability that the random variable X takes a value less than or equal to x. It is defined for all real numbers:

F(x) = 0                    for x < a
F(x) = (x − a) / (b − a)   for a ≤ x ≤ b
F(x) = 1                    for x > b

Because the PDF is constant, the CDF accumulates probability at a constant rate, producing a linear (straight-line) increase from 0 to 1 across the interval [a, b]. This is another visual hallmark of the uniform distribution: its CDF is a straight diagonal line between the points (a, 0) and (b, 1).

The CDF is especially useful for computing probabilities of the form P(X ≤ x) without needing to integrate the PDF:

P(X ≤ x) = F(x) = (x − a) / (b − a)

And for interval probabilities, we can use the CDF directly:

P(c ≤ X ≤ d) = F(d) − F(c) = (d − a)/(b − a) − (c − a)/(b − a) = (d − c)/(b − a)

This confirms consistency with the direct probability formula given earlier.

Example: For the train waiting time X ~ U(0, 20), find P(X ≤ 8).

F(8) = (8 − 0) / (20 − 0) = 8/20 = 0.40

There is a 40% chance the passenger waits 8 minutes or less. Geometrically, this is because x = 8 is 40% of the way through the interval [0, 20], and the CDF at that point reflects exactly that fraction.

The linearity of the CDF is also a useful sanity check: the midpoint of the interval (a + b)/2 should always give F = 0.5, since exactly half the distribution lies below the mean. Verify: F(10) = (10 − 0)/(20 − 0) = 0.5. ✓

Practical Applications of the Uniform Distribution

Despite its simplicity, the uniform distribution appears in a surprisingly wide range of applied settings.

To bring together all the key properties in one place, the following table summarises the uniform distribution's characteristics:

Property Formula / Value
Notation X ~ U(a, b)
Parameters a (minimum), b (maximum), with b > a
PDF f(x) = 1/(b − a) for a ≤ x ≤ b; 0 otherwise
CDF F(x) = (x − a)/(b − a) for a ≤ x ≤ b; 0 for x < a; 1 for x > b
Mean (μ) (a + b) / 2
Variance (σ²) (b − a)² / 12
Standard Deviation (σ) (b − a) / √12
Interval Probability P(c ≤ X ≤ d) = (d − c) / (b − a)
Probability at a point P(X = c) = 0 for any specific value c
Shape of PDF Flat rectangle (constant height)
Shape of CDF Straight line from (a, 0) to (b, 1)

The uniform distribution's elegance lies in its complete transparency: every formula follows directly and obviously from the single defining property of equal likelihood across an interval. Mastering it provides not only a useful probability model in its own right but also a conceptual foundation for understanding more complex distributions and the simulation techniques that underpin modern statistics and data science.

NotesLearners should be comfortable substituting values of a and b into each formula and interpreting results in context. Emphasis on the CDF's linearity and the zero probability of point values helps bridge intuition from discrete to continuous distributions. The inverse transform sampling application is worth highlighting for learners who will encounter simulation or computational statistics.