Uniform Distribution Calculator

Uniform Distribution Calculator

Compute probabilities, statistics, and probability density for the continuous uniform distribution U(a, b). Perfect for modeling random events with equal likelihood across an interval.

Last updated: March 2026

Calculator

Minimum value (inclusive)

Maximum value (inclusive)

For P(X x₁)

For P(x₁ X x₂)

Distribution Parameters

Mean (μ)

5.0000

Variance (σ²)

8.3333

Std Dev (σ)

2.8868

PDF f(x)

0.100000

Probability Results

P(X 3)0.3000
P(X > 3)0.7000
P(3 X 7)0.4000

What is the Uniform Distribution?

The continuous uniform distribution, denoted U(a, b), models the probability of outcomes uniformly distributed over an interval [a, b]. Every value in the range has equal likelihood of occurring — this is the simplest continuous distribution.

Key Formulas:

f(x) = 1/(b−a) for a x b, else 0
μ = (a+b)/2
σ² = (b−a)²/12
P(x₁ X x₂) = (x₂−x₁)/(b−a)

The uniform distribution is useful for:

  • Modeling random events with no preferred outcomes in an interval
  • Simulation and Monte Carlo methods (random number generation)
  • Machine learning algorithms that assume uniform priors
  • Queueing and waiting time problems with uniform arrivals

How to Use Uniform Distribution

1.

Define Bounds

Specify the lower bound a and upper bound b. For example, if modeling a random waiting time between 0 and 60 seconds, set a=0 and b=60.

2.

Calculate Mean & Variance

The mean is always (a+b)/2, the midpoint. Variance increases with the interval width: σ²=(b−a)²/12. Larger intervals have greater spread.

3.

Compute Probabilities

For P(X ≤ x₁), use (x₁−a)/(b−a) if x₁ is in [a, b]. For a range P(x₁ ≤ X ≤ x₂), use (x₂−x₁)/(b−a).

4.

Interpret PDF

The PDF is constant: f(x) = 1/(b−a). This flat shape confirms equal probability density across the entire interval.

5.

Apply to Real Data

Use uniform assumptions cautiously. Real-world data often shows variation in density — test for uniformity before applying this model.

Real-World Example

Scenario: A subway train arrives uniformly at random within a 10-minute window. If you walk into the station at a random time, what's the probability you wait between 3 and 7 minutes?

Setup: Let X = waiting time in minutes. We model X ~ U(0, 10).

a = 0, b = 10

μ = (0+10)/2 = 5 minutes (expected waiting time)

σ² = (10−0)²/12 = 8.33 minutes²

σ = √8.33 ≈ 2.89 minutes

P(3 X 7) = (7−3)/(10−0) = 4/10 = 0.40 = 40%

Interpretation: There's a 40% chance you'll wait between 3 and 7 minutes. The uniform model assumes equal probability across the full 10-minute interval, so any subinterval of the same width has the same probability.

Frequently Asked Questions

How is the uniform distribution different from normal distribution?
Uniform has constant PDF (flat rectangular shape), while normal has a bell curve. Uniform models equal probability; normal is symmetric and concentrates near the mean.
Can I use uniform distribution for discrete data?
The continuous uniform U(a,b) is for real-valued intervals. For discrete cases (whole numbers), use the discrete uniform distribution, which assigns equal probability to each integer in a range.
Why is the variance (b−a)²/12?
The 12 comes from integrating (x−μ)² over the uniform PDF. For a symmetric distribution centered at μ, this formula captures spread relative to interval width.
What if my data looks more clustered than uniform?
Your data likely doesn't follow a uniform distribution. Consider other distributions (normal, exponential, beta) or test goodness-of-fit using a Kolmogorov–Smirnov test.
Can I generate random numbers from uniform distribution?
Yes. Most programming languages have built-in uniform random generators (U={0,1}). To get U(a,b): a + (b−a) × U(0,1).
What's the cumulative distribution function (CDF)?
F(x) = (x−a)/(b−a) for x in [a,b]. It gives the probability P(X ≤ x). At x=a, F=0; at x=b, F=1.

Related Tools