The continuous uniform distribution
Any value between a and b is equally likely, so the density is flat at 1/(b − a) and a probability is a length divided by the width. Move the ends a and b, then ask a question: the area it counts is shaded.
Parameters
Ask a question
Compare with
P(X ≤ 0.25) = 0.2500
P(X ≤ 0.25) = F(0.25) = 0.2500
Summary
| Measure | U(0, 1) |
|---|---|
| mean | 0.5000 |
| variance | 0.0833 |
| standard deviation | 0.2887 |
| skewness | 0.0000 |
The same in code
- Python (scipy.stats)
uniform.cdf(0.25, loc=0, scale=1)- Excel
=(0.25-0)/(1-0)
Formulas
Try this
Less than is at most
Switch the question between P(X < 3) and P(X ≤ 3) for the bug fix.
Look for: Both are 0.5000. A single point has no width, so P(X = 3) = 0 and the boundary makes no difference for a measurement.
A density above 1
Set a = 1 and b = 1.5.
Look for: The density is 2, higher than 1. A density is probability per unit of x, not a probability; the area under it is still 1.
Flat against bell-shaped
Turn on the comparison with the normal that has the same mean and standard deviation.
Look for: The normal puts more probability near the middle, and some beyond a and b, where the uniform puts none.
Percentiles in equal steps
Ask for the percentile and move q from 0.1 to 0.9.
Look for: The answer moves in equal steps, because F⁻¹(q) = a + q(b − a): with a = 1 and b = 5, every 0.1 of probability adds 0.4 hours.