The Continuous Uniform distribution describes a Continuous Random Variable where all possible values within a specified range \([a, b]\) are equally likely.
It represents complete uncertainty within the bounds \(a\) and \(b\); no single value or sub-interval within the range is favored over another of the same size.
Think of it as randomly picking a real number from a fixed interval.
The PDF is constant within the interval \([a, b]\) and zero elsewhere. The height of the constant value must make the total area under the curve equal to 1.
$$
f(x) = \begin{cases} \frac{1}{b-a} & \text{if } a \le x \le b \ 0 & \text{otherwise} \end{cases}
$$
The width of the interval is \((b-a)\). The height \(\frac{1}{b-a}\) ensures the area (width \(\times\) height) is \((b-a) \times \frac{1}{b-a} = 1\).
The CDF\(F(x) = P(X \le x)\) represents the accumulated probability up to \(x\).
$$
F(x) = \begin{cases} 0 & \text{if } x < a \ \frac{x-a}{b-a} & \text{if } a \le x \le b \ 1 & \text{if } x > b \end{cases}
$$
Intuition: The CDF increases linearly from 0 at \(x=a\) to 1 at \(x=b\). The proportion of the interval covered up to \(x\) is \(\frac{x-a}{b-a}\).
The probability of \(X\) falling within a sub-interval \([c, d]\) (where \(a \le c \le d \le b\)) is the area under the PDF from \(c\) to \(d\):
$$ P(c \le X \le d) = \int_c^d \frac{1}{b-a} \, dx = \frac{d-c}{b-a} $$
This is simply the ratio of the length of the sub-interval \((d-c)\) to the length of the total interval \((b-a)\).
The Standard Uniform Distribution is a special case where \(a=0\) and \(b=1\), denoted \(U(0, 1)\). This is fundamental in computer science for generating random numbers. Pseudo-random number generators often produce values that approximate a \(U(0, 1)\) distribution.
Random variables from any continuous distribution can be generated using a \(U(0, 1)\) generator and the Inverse Transform Sampling method based on the target distribution's CDF. If \(U \sim U(0,1)\), then \(X = F^{-1}(U)\) has CDF \(F\).
Used as a non-informative prior distribution in Bayesian Statistics in some contexts.
The [[11_Beta_Distribution|Beta distribution]] with \(\alpha=1, \beta=1\) reduces to \(U(0,1)\).