The continuous uniform distribution is a continuous probability distribution in which all outcomes in a bounded interval are equally likely. It is the simplest continuous distribution and the continuous analogue of the Discrete Uniform Distribution.
A random variable \(X\) follows a continuous uniform distribution on the interval \([a, b]\) with \(a < b\) if
\[
X \sim \text{Uniform}(a, b) \quad \text{or}
\quad X \sim U(a, b).
\]
The most common case is the standard uniform distribution on \([0, 1]\), denoted \(U(0, 1)\).
Interpretation: The constant value \(\frac{1}{b-a}\) ensures that the density integrates to \(1\) over \([a, b]\); no value in the interval is preferred over any other.
Plotting code
import numpy as npimport matplotlib.pyplot as pltimport seaborn as snssns.set_style('whitegrid')sns.set_palette('Set2')a, b =0.0, 1.0x = np.linspace(a -0.5, b +0.5, 500)y = np.where((x >= a) & (x <= b), 1/ (b - a), 0.0)fig, ax = plt.subplots(figsize=(7, 4))ax.plot(x, y, color='#4c72b0', lw=2)ax.fill_between(x, y, color='#4c72b0', alpha=0.2)ax.axvline((a + b) /2, color='#c44e52', ls='--', lw=1.5, label=r'$\mathbb{E}[X]$')ax.set_xlabel('$x$')ax.set_ylabel('$f(x)$')ax.set_title(r'Uniform density $U(0,\ 1)$')ax.set_ylim(0, 1.4)ax.legend()plt.show()
Density of the standard uniform \(U(0, 1)\).
The cumulative distribution function is
\[
F(x) = \begin{cases}
0 & x < a, \\[2pt]
\dfrac{x - a}{b - a} & a \leq x \leq b, \\[4pt]
1 & x > b.
\end{cases}
\]
3 Key Properties
The expectation and variance of \(X \sim \text{Uniform}(a, b)\) are
If \(X \sim \text{Uniform}(a, b)\) and \(Y = cX + d\) with \(c > 0\), then
\[
Y \sim \text{Uniform}(ca + d, cb + d).
\]
In particular, if \(X \sim U(0, 1)\) then \((b - a)X + a \sim U(a, b)\).
If \(U_1, \ldots, U_n\) are i.i.d. \(U(0, 1)\) with order statistics \(U_{(1)} \leq \cdots \leq U_{(n)}\), then the \(k\)-th order statistic follows a Beta Distribution:
Beta Distribution:\(U(0, 1) = \text{Beta}(1, 1)\), and order statistics of uniforms are Beta distributed.
Inverse transform sampling: If \(F\) is a continuous CDF and \(U \sim U(0, 1)\), then \(F^{-1}(U)\) has distribution \(F\) — the basis for simulating any Random Variable Transformations.
7 Examples and Applications
\(U(0, 1)\) is the foundation for generating samples from any distribution via inverse transform sampling.
If an event is equally likely to occur at any time in a fixed window, its arrival time is modelled as \(\text{Uniform}(a, b)\).
A measurement known only to lie within a specified tolerance band, with no further information, is often modelled as uniform over that band.