Uniform Distribution Calculator (Continuous, Probability)
In a continuous uniform distribution every value between a minimum a and a maximum b is equally likely, so probabilities are simply lengths of intervals. This uniform distribution calculator gives the probability that X falls between two values, the probability density, and the mean, variance and standard deviation.
How to use the uniform distribution calculator
Enter the minimum a and maximum b of the distribution and the interval x₁ to x₂ you are interested in. The calculator returns the probability that X falls in that interval, the constant probability density, and the mean, variance and standard deviation. For P(X ≤ x), set x₁ equal to a.
Uniform distribution formulas
f(x) = 1 ÷ (b − a) · P(x₁ ≤ X ≤ x₂) = (x₂ − x₁) ÷ (b − a)
μ = (a + b) ÷ 2 · σ² = (b − a)² ÷ 12
Example
A bus arrives at a random time uniformly between 2 and 10 minutes after you reach the stop. The chance it arrives between minute 4 and minute 7:
- P = (7 − 4) ÷ (10 − 2) = 3 ÷ 8 = 37.5%
- Density = 1 ÷ 8 = 0.125 per minute
- Mean wait = (2 + 10) ÷ 2 = 6 min, variance = 8² ÷ 12 = 5.3333, standard deviation = 2.3094 min
Cumulative probabilities (a = 2, b = 10)
| x | P(X ≤ x) | P(X > x) |
|---|---|---|
| 2 | 0.0000 | 1.0000 |
| 3 | 0.1250 | 0.8750 |
| 4 | 0.2500 | 0.7500 |
| 5 | 0.3750 | 0.6250 |
| 6 | 0.5000 | 0.5000 |
| 7 | 0.6250 | 0.3750 |
| 8 | 0.7500 | 0.2500 |
| 9 | 0.8750 | 0.1250 |
| 10 | 1.0000 | 0.0000 |
Notes
- Every interval of the same length inside [a, b] has the same probability.
- The sum of many independent uniform variables tends towards a normal distribution.
Frequently asked questions
What is the formula for a uniform distribution probability?
P(x₁ ≤ X ≤ x₂) = (x₂ − x₁) ÷ (b − a) for an interval inside [a, b]. Parts of the interval outside [a, b] have zero probability.
What are the mean and variance of a uniform distribution?
Mean = (a + b) ÷ 2, variance = (b − a)² ÷ 12, standard deviation = (b − a) ÷ √12 ≈ 0.2887 (b − a).
Where is the uniform distribution used?
For random number generators, rounding and quantisation error, waiting times when arrivals are spread evenly, and in measurement uncertainty — a ± tolerance with no other information is treated as rectangular, giving a standard uncertainty of half-width ÷ √3.
What about the discrete uniform distribution?
For n equally likely whole-number outcomes (like a die), each has probability 1/n, the mean is (a + b) ÷ 2 and the variance is (n² − 1) ÷ 12.