Statistics › Section E · Continuous random variables › Topic E.2
The uniform distribution
The simplest story in probability is equal likelihood - every value as likely as every other. A fair die, a lottery draw, a bus equally likely to arrive anywhere in its window: uniform distributions model them all, in a discrete version for lists and a continuous version for intervals.
Flat chance
Named distributions are templates: recognise the story and the formulas follow. The simplest story of all is equal likelihood - every value as likely as every other. A fair die, a lottery ball, a random number generator, a bus equally likely to arrive anywhere in its window: uniform distributions model them all, in a discrete version for listable values and a continuous version for intervals. Few real processes are perfectly uniform, but the template is the starting point of modelling - the shape that means "we have no reason to favour any part of the range".
The discrete uniform
When each of \(k\) values is equally likely, each carries probability \(\frac{1}{k}\). A fair die's six faces each take \(\frac{1}{6}\), and the expected value is the ordinary average of the faces, \(\frac{1+2+\cdots+6}{6} = 3.5\) - the midpoint, as symmetry demands. Fair lotteries and random number generators are designed to come as close to this distribution as possible. Its variance is \(\frac{k^2 - 1}{12}\) for the values 1 to \(k\): \(\frac{35}{12} \approx 2.92\) for a die.
The continuous uniform
Spread equal likelihood across an interval and the probability table becomes a flat curve:
The height \(\frac{1}{b-a}\) is chosen so the rectangle over \([a, b]\) has area exactly 1 - the continuous total-certainty. Write \(X \sim U(a, b)\), read "uniform between \(a\) and \(b\)". Every interval of the same width inside the window is equally likely, and the endpoints' inclusion never matters, because points carry no area.
Probabilities as fractions of the window
Uniform probabilities need no calculus - just the rectangle from the density topic:
For \(x\) inside \([a, b]\), the probability of landing below \(x\) is the fraction of the window already passed. A bus arriving uniformly within 20 minutes: \(P(\text{wait} \le 5) = \frac{5}{20} = 0.25\), and \(P(4 < X < 15) = \frac{11}{20} = 0.55\). Conditions work the same way: if the bus has not come by minute 8, the rest of the window is still flat, so \(P(X > 12 \mid X > 8) = \frac{20-12}{20-8} = \frac{8}{12} \approx 0.667\).
Mean and spread
By symmetry the mean of a continuous uniform sits at the midpoint: \(\mu = \frac{a+b}{2}\). The variance is \(\frac{(b-a)^2}{12}\) - the 12 looks mysterious but is simply what the flat shape produces - so the standard deviation is \(\sigma = \frac{b-a}{\sqrt{12}}\). For a 20-minute window: \(\mu = 10\), \(\sigma^2 = \frac{400}{12} \approx 33.3\), \(\sigma \approx 5.77\) minutes. A wider window spreads the same flatness across more room, and the SD grows with the width - doubling the window multiplies the SD by 2 but the variance by 4, the scaling rule from the expected-value topic in action.
Worked example: the 20-minute bus
A commuter's bus arrives uniformly within a 20-minute window: \(X \sim U(0, 20)\). a) \(P(X \le 5) = \frac{5-0}{20-0} = 0.25\): the first quarter of the window. b) \(P(4 < X < 15) = \frac{15-4}{20} = 0.55\). c) Find \(k\) with \(P(X < k) = 0.3\): the equation \(\frac{k}{20} = 0.3\) gives \(k = 6\) minutes. d) Check: 6 minutes is 30% of 20, and the rectangle from 0 to 6 has base 6, height \(\frac{1}{20}\), area \(\frac{6}{20} = 0.3\) - consistent twice over.
Worked example: a vending machine
A machine fills cups uniformly between 190 and 210 ml: \(X \sim U(190, 210)\). a) \(P(X < 195) = \frac{195-190}{210-190} = \frac{5}{20} = 0.25\). b) The 40th percentile: find \(k\) with \(P(X < k) = 0.40\): \(\frac{k - 190}{20} = 0.40\), so \(k = 190 + 8 = 198\) ml. c) Check: 198 sits 8 ml into the 20 ml range, exactly 40% of the way - the percentile formula \(k = a + p(b-a)\) read off a flat rectangle.
Where uniform appears - and fails
Uniform models earn their keep wherever nothing favours one part of a range over another: random arrival within a known window, rounding errors (the error from rounding to the nearest whole number is usually modelled as uniform between \(-0.5\) and 0.5), lottery draws, simulations. The model fails the moment any stretch of the window becomes more likely - rush hours, wear patterns, preferences. Uniformity is an assumption to test: a histogram of observed values should look flat before the template is trusted, and a quick scan of summary numbers helps too - data whose mean sits far from the midpoint of their range are telling you the window is not flat.
Common mistakes to avoid
First, using the window's length instead of the distance into it: \(P(X < x)\) is \(\frac{x-a}{b-a}\), not \(\frac{x}{b-a}\) unless \(a = 0\). Second, quoting the variance as the SD: 33.3 is in squared minutes for the 20-minute bus, 5.77 in minutes. Third, hunting for a peak - a flat curve has none, and the mean is the midpoint by symmetry. Fourth, applying the continuous variance to a die: \(\frac{(6-1)^2}{12} \approx 2.08\), but the die's true variance is \(\frac{35}{12} \approx 2.92\). Fifth, forgetting that any exact point has probability 0, so endpoint inclusion is irrelevant. Sixth, forcing uniform onto data with a visible favourite region.
Key takeaways
Uniform means equal likelihood. Discrete: each of \(k\) values takes \(\frac{1}{k}\), and a fair die averages 3.5. Continuous: \(X \sim U(a, b)\) has flat density \(\frac{1}{b-a}\), probabilities as window fractions - \(P(X < x) = \frac{x-a}{b-a}\) - mean \(\frac{a+b}{2}\) and SD \(\frac{b-a}{\sqrt{12}}\). Percentiles read the same formula backwards: \(k = a + p(b-a)\). The template fits genuinely flat situations - random arrivals in a window, rounding error, fair draws - and should not be forced onto a range with a favoured region.
Flashcards
Flashcard
Each of k values has probability 1/k
Test your understanding
Question 1 of 5
A bus arrives uniformly within a 20-minute window. What is P(wait at most 5 minutes)?
Question 2 of 5
For X ~ U(0, 20), what are the mean and standard deviation?
Question 3 of 5
A machine fills cups uniformly between 190 and 210 ml. What is the 40th percentile?
Question 4 of 5
For X ~ U(0, 20), find k such that P(X < k) = 0.3.
Question 5 of 5
A fair die is rolled once. What is the expected value?
