What Is Uniform Distribution?
A continuous uniform distribution assigns the same density 1/(b − a) to every value between a and b. Probabilities are therefore proportional to length: P(x₁ ≤ X ≤ x₂) = (x₂ − x₁) ÷ (b − a).
Enter the limits and the value or range you need. The calculator returns the probability, the mean (a + b)/2, the variance (b − a)²/12, the standard deviation and the density, and draws the flat density with your region shaded.
Below you will find the formulas, variables, a worked bus-wait example and answers to common questions about continuous versus discrete uniform distributions.
How to Use the Uniform Distribution Calculator
- Enter the lower and upper limits a and b.
- Choose ≤, > or between.
- Enter x (and x₂).
- Read the probability, mean and variance.
Uniform Distribution Formula
Density
Probability of a range
Mean and variance
Uniform Distribution Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| a | Lower limit | |
| b | Upper limit | must exceed a |
| f(x) | Density | 1 ÷ (b − a) |
| E[X] | Mean | (a + b) ÷ 2 |
Uniform Distribution Worked Example
A bus arrives at a random time within a 20-minute window, so X is uniform on [0, 20]. The chance you wait between 5 and 12 minutes is (12 − 5) ÷ 20 = 0.35. The mean wait is 10 minutes and the variance is 20² ÷ 12 = 33.33, a standard deviation of 5.77 minutes.
With the example values loaded in the calculator above, the steps are:
- Density f(x) = 1 ÷ (b − a) = 1 ÷ (20 − 0) = 0.05 for a ≤ x ≤ b.
- P = (x₂ − x₁) ÷ (b − a), clipped to [a, b] = 0.35.
- Mean = (a + b) ÷ 2 = 10; variance = (b − a)² ÷ 12 = 33.333333.
Result: P(5 ≤ X ≤ 12) = 0.35; Mean (a + b)/2 = 10.
How to Read a Uniform Probability
In a uniform distribution every value between a and b is equally likely, so probability is just the share of the interval. If a bus arrives at a random time in a 20-minute window, the chance you wait between 5 and 12 minutes is (12 − 5) ÷ 20 = 0.35.
The mean is the midpoint, (a + b) ÷ 2 = 10 minutes. The variance is (b − a)² ÷ 12 = 33.3, giving a standard deviation near 5.77 minutes. The density is flat at 1 ÷ (b − a), which is 0.05 per minute here.
Where Uniform Distribution Is Used
Waiting times
Find the chance a wait falls in a given range when arrival is random within a window.
Random numbers
Check results for random numbers drawn between two limits.
Rounding error
Model rounding error as uniform over one unit.
Teaching
See the flat density and the formulas for mean and variance.
Common Uniform Distribution Mistakes to Avoid
- The model is continuous. The probability of any single exact value is 0.
- Probability is the length of your range divided by b − a. Clip your range to [a, b] first.
- The mean and median are both the midpoint, which is a quick check.
- Use a discrete uniform for whole-number outcomes such as a die roll.
Uniform Distribution Terms and Definitions
- Uniform distribution
- A distribution where every value in an interval is equally likely.
- Density
- The constant height 1/(b − a) of the flat curve.
Uniform Distribution FAQs
How do you find probability for a uniform distribution?
Divide the length of your interval by the length of the whole range: P(x₁ ≤ X ≤ x₂) = (x₂ − x₁) ÷ (b − a). For a range of 5 to 12 within [0, 20] this is 7 ÷ 20 = 0.35.
What is the mean of a uniform distribution?
It is (a + b) ÷ 2, the midpoint of the interval. For [0, 20] the mean is 10.
What is the variance of a uniform distribution?
It is (b − a)² ÷ 12. For [0, 20] that is 400 ÷ 12 ≈ 33.33, so the standard deviation is about 5.77.
What is the difference between continuous and discrete uniform?
A continuous uniform allows any real number in the interval, with a flat density. A discrete uniform has a finite set of equally likely values, such as the faces of a die, each with probability 1 ÷ n.