Probability
3. Continuous Distributions
Continuous Uniform

Uniform Distribution (Continuous)

🧱

The Continuous Uniform distribution is the simplest of all continuous distributions. It models a scenario where every single possible decimal value within a specific range has the exact same probability density.

Core Concepts

If a random variable XX follows a Continuous Uniform distribution, we write:

XU(a,b)X \sim \mathcal{U}(a, b)

Where:

  • aa is the minimum possible value.
  • bb is the maximum possible value.

Probability Density Function (PDF)

Because every value is equally likely, the PDF is a completely flat horizontal line between aa and bb. Because the total area under the line must equal exactly 11, the height of the line is simply 11 divided by the width of the interval.

f(x)={1bafor axb0for x<a or x>bf(x) = \begin{cases} \frac{1}{b - a} & \text{for } a \le x \le b \\ 0 & \text{for } x < a \text{ or } x > b \end{cases}

Cumulative Distribution Function (CDF)

The CDF grows perfectly linearly (like a straight ramp) from 00 to 11 between aa and bb.

F(x)={0for x<axabafor axb1for x>bF(x) = \begin{cases} 0 & \text{for } x < a \\ \frac{x - a}{b - a} & \text{for } a \le x \le b \\ 1 & \text{for } x > b \end{cases}

Key Metrics

  • Expected Value (Mean): E[X]=a+b2E[X] = \frac{a + b}{2} (Exactly in the middle)
  • Variance: Var(X)=(ba)212\text{Var}(X) = \frac{(b - a)^2}{12}

Real-World Examples

  1. Random Number Generators: The foundational Math.random() function in programming languages generates a continuous uniform distribution between 00 and 11.
  2. Waiting for a Train: If a train comes exactly every 20 minutes, and you arrive at the station at a completely random time, your wait time is uniformly distributed between 00 and 2020 minutes.

Interactive Visualization

Use the sliders below to adjust the minimum (aa) and maximum (bb) boundaries. Notice how the total width changes, and in response, the height (density) perfectly scales up or down to ensure the total area of the pink rectangle remains exactly 1.01.0.

Continuous Uniform Distribution

A flat density on [a, b] (all values equally likely).

Minimum (a)
1
Maximum (b)
5

Test Your Knowledge

Example: Continuous Waiting Time

A subway train arrives precisely every 15 minutes. If you arrive at the station at a totally random time, your waiting time XX is uniformly distributed between 0 and 15. What is the probability you have to wait more than 10 minutes?

View Step-by-Step Solution

This is a Continuous Uniform Distribution U(0,15)U(0, 15).

The PDF is f(x)=1ba=1150=115f(x) = \frac{1}{b-a} = \frac{1}{15-0} = \frac{1}{15}

We want P(X>10)P(X > 10), which is the area under the curve from 10 to 15: Base×Height=(1510)×115=5×115=515=13\text{Base} \times \text{Height} = (15 - 10) \times \frac{1}{15} = 5 \times \frac{1}{15} = \frac{5}{15} = \frac{1}{3}

There is a 33.3% chance you will wait more than 10 minutes.