Uniform Distribution — Definition, Formula & Examples
A uniform distribution is a probability distribution where every outcome in a given range is equally likely. For example, rolling a fair die gives each face (1 through 6) the same probability of 1/6.
A continuous uniform distribution on the interval has a constant probability density function for and otherwise. Its mean is and its variance is . A discrete uniform distribution assigns equal probability to each of distinct outcomes.
Key Formula
f(x) = \frac{1}{b - a}, \quad a \le x \le b$$
$$P(c \le X \le d) = \frac{d - c}{b - a}$$
$$\mu = \frac{a + b}{2}, \quad \sigma^2 = \frac{(b - a)^2}{12}
Where:
- = Minimum value of the distribution
- = Maximum value of the distribution
- = Probability density function (height of the rectangle)
- = Endpoints of the sub-interval you want the probability for
- = Mean (expected value)
- = Variance
How It Works
You use a uniform distribution whenever no outcome in a range is favored over another. For the continuous case, the probability of landing in any sub-interval depends only on that sub-interval's width relative to the total range. To find , you calculate . The density curve is a flat horizontal line, forming a rectangle over , which is why this is sometimes called the rectangular distribution.
Worked Example
Problem: A bus arrives at a stop every 30 minutes. You arrive at a random time. What is the probability you wait between 5 and 15 minutes? Also find the mean and standard deviation of your wait time.
Identify the distribution: Your wait time X follows a continuous uniform distribution on [0, 30] since every arrival moment in the 30-minute window is equally likely.
Find the probability: Use the formula for the probability of a sub-interval with c = 5 and d = 15.
Find the mean: The mean wait time is the midpoint of the interval.
Find the standard deviation: First compute the variance, then take the square root.
Answer: The probability of waiting between 5 and 15 minutes is . The mean wait is 15 minutes with a standard deviation of about 8.66 minutes.
Another Example
Problem: A random number generator produces integers from 1 to 8, each equally likely. What is the probability of getting a number greater than 5?
Identify outcomes: This is a discrete uniform distribution with n = 8 outcomes. Each outcome has probability 1/8.
Count favorable outcomes: The values greater than 5 are 6, 7, and 8 — that is 3 outcomes.
Answer: The probability of getting a number greater than 5 is .
Visualization
Why It Matters
The uniform distribution appears throughout AP Statistics and introductory college probability courses as a foundational model for randomness. It is the basis for random number generators used in simulations, games, and cryptography. Understanding it also builds intuition for comparing other distributions — many are defined by how they deviate from the uniform case.
Common Mistakes
Mistake: Using the probability formula outside the interval [a, b]
Correction: The density is zero outside [a, b]. If your sub-interval extends beyond the range, clip it to [a, b] before calculating. For instance, with Uniform(0, 30), P(X > 25) = (30 − 25)/(30 − 0), not (some larger value − 25)/(30).
Mistake: Confusing the density value with a probability
Correction: For a continuous uniform distribution, f(x) = 1/(b − a) is a density, not a probability. The probability of any single exact value is 0. You must integrate (multiply density by interval width) to get an actual probability.
