Uniform distribution with constant pdf on [a,b], showing cdf, mean and area interpretation

What is a Uniform Distribution?

The standard uniform distribution $U$ is a continuous random variable which is equally likely to be in any interval of the same width within the set $[0,1]$.

A general uniform distribution $X$ is equally likely to be in any interval of the same width within a set $[a,b]$ for two fixed real numbers $b>a$.

It is sometimes called the “box” distribution, as its PDF looks like a box.

Notation: $X \sim \mathcal{U}[a,b]$
Type: $ \text{Continuous} $
PDF: $ f_X(x) = \frac{1}{b-a}, \ \ a \le x \le b $
CDF: $ F_X(x) = \frac{x-a}{b-a}, \ \ a \le x \le b $
Support: $x \in [a,b] $
Mean: $\mathbb{E}(X) = \frac{a+b}{2}$
Variance: $\mathbb{V}\text{ar}(X) = \frac{(b-a)^{2}}{12} $

This should not be confused with the discrete uniform distribution, a discrete random variable equally like to take any value within the set $ \{ 1,2,\dots,n \} $. This models rolling a fair die.

Background: