Uniform Distribution Calculator

Uniform Distribution Calculator

For a value equally likely to be anywhere between a minimum and a maximum, find the chance it falls below, above or between given points, with its mean and spread.

P(c < X < d) = (d − c) ÷ (b − a)

For a continuous uniform distribution: every value between a and b is equally likely.

Enter the minimum, maximum and a value

What is the Uniform Distribution?

The continuous uniform distribution spreads probability evenly across an interval: every value between the minimum and maximum is equally likely. Its graph is a flat rectangle.

That makes probabilities a matter of lengths. The chance of landing in any stretch is that stretch's share of the whole interval, wherever it sits.

It describes arriving at a random moment for something on a fixed schedule, rounding errors, and the starting point of a random number generator. It's also the honest choice when all you know is a range.

Uniform Distribution Formula

As given in the NIST/SEMATECH e-Handbook, section 1.3.6.6.2. See Sources.

1. Height of the rectangle

f(x) = 1 ÷ (b − a) for a ≤ x ≤ b

2. Probability is length × height

P(X < x) = (x − a) ÷ (b − a)
P(c < X < d) = (d − c) ÷ (b − a)

Parts of an interval outside a to b add nothing.

3. Mean and spread

mean = (a + b) ÷ 2 · SD = (b − a) ÷ √12

Worked Example: Waiting for a Bus Every 12 Minutes

Given:
A bus comes exactly every 12 minutes and you arrive at a random moment. What's the chance you wait more than 8 minutes?
Step 1:
Your wait is uniform:
a = 0, b = 12
Step 2:
Share of the interval above 8:
(12 − 8) ÷ (12 − 0) = 4 ÷ 12 = 0.3333
Step 3:
Average wait and spread:
mean 6 minutes · SD = 12 ÷ √12 = 3.46 minutes
Result:
P(wait over 8 minutes) = 33.3%

One trip in three. If buses arrived at random instead of on schedule (exponential, mean 12), the average wait would double to 12 minutes, a classic surprise known as the waiting-time paradox.

Chance of a Long Wait for the Bus

A bus every 12 minutes, arriving at a random moment. The chance falls in a straight line.

Chance of waiting longer than each time for a bus every 12 minutes
Wait longer thanChance
2 minutes83.3%
4 minutes66.7%
6 minutes50%
8 minutes33.3%
10 minutes16.7%

Common Uniform Distribution Mistakes

  • Treating the density as a probability. For a range of 0 to 0.5, the height is 2. Probabilities come from areas, not heights.
  • Dividing by 12 instead of √12. The variance is (b − a)² ÷ 12; the SD is (b − a) ÷ √12.
  • Mixing up continuous and discrete. A fair die is discrete uniform on 1 to 6, with mean 3.5 but SD 1.71, not 5 ÷ √12 = 1.44.
  • Assuming uniform without reason. Most real quantities pile up somewhere. Use uniform only when every value really is equally likely, or as a deliberate "know nothing" choice.

Uniform Distribution FAQs

Does it matter whether I use < or ≤?

No. For a continuous distribution the chance of any exact value is zero, so the endpoints make no difference.

What’s the standard uniform distribution?

Uniform from 0 to 1. Random number generators produce it, and other distributions are built from it.

What happens outside the interval?

The probability is zero. A value below a has P(X < x) = 0; above b, P(X < x) = 1.

Why is the SD (b − a) ÷ √12?

The variance of a uniform interval of length L works out to L² ÷ 12 by integration, so the SD is L ÷ √12 ≈ 0.289L.

How is rounding error uniform?

Rounding to the nearest whole number leaves an error spread evenly between −0.5 and 0.5, with SD 1 ÷ √12 ≈ 0.29.

What is the discrete uniform distribution?

Equal chances over a set of separate values, like a die’s faces. Its mean is still the midpoint, but the spread formula is (n² − 1) ÷ 12 for n values one apart.

How do I find percentiles?

The pth percentile is a + p(b − a). The 90th percentile of 0 to 12 is 10.8.

What’s the sum of two uniform values?

Not uniform: it has a triangular shape, peaking in the middle. Add more and it heads towards a bell curve.

Sources

Related Tools