Uniform distribution calculator

Every value between a and b is equally likely, so probability is just width times height. The rectangle makes that obvious.

P(X < 5)0.2500
05101520
Height 1/(b − a)0.05
Mean10
Variance33.3333
Std deviation5.7735

Area = width × height = 5 × 0.05 = 0.2500

Probability as a rectangle

In a continuous uniform distribution, every value between a and b is equally likely, so the density is a flat rectangle of height 1/(b − a). The total area is width × height = 1. Any probability is just the width of the shaded part times that height.

Worked example: waiting for a bus

A bus comes every 20 minutes and you turn up at a random moment, so your wait X is uniform on 0 to 20. The chance of waiting less than 5 minutes is 5 × 1/20 = 0.25. The mean wait is 10 minutes and the standard deviation is 20/√12 ≈ 5.77 minutes.

Why random number generators matter here

Computers generate uniform random numbers between 0 and 1 and transform them into every other distribution. The simulations on this site, such as the central limit theorem sampler, all start from uniform draws. Averaging several uniform values is also one of the quickest ways to watch a bell curve appear.

Still not clicking? Ask the tutor

An AI tutor that sees the numbers you entered above and explains them. It can make mistakes, so check anything important against the worked steps.

Questions students ask

What is the formula for a uniform distribution?

The density is 1 / (b − a) between a and b. So P(c < X < d) = (d − c) / (b − a) for any c and d inside the interval.

What are the mean and variance?

Mean = (a + b) / 2 and variance = (b − a)² / 12, so the standard deviation is (b − a) / √12.

What is a real example?

If a bus comes every 20 minutes and you arrive at a random time, your wait is uniform between 0 and 20 minutes, with an average of 10.

What about a discrete uniform, like a die?

A fair die gives each of 1 to 6 probability 1/6. For dice sums, see the dice probability calculator.

Keep exploring