Expectation of Continuous Uniform Distribution

Theorem
Let $a, b \in \R$ such that $a < b$.

Let $X \sim \ContinuousUniform a b$ be the continuous uniform distribution over $\closedint a b$.

Then:


 * $\expect X = \dfrac {a + b} 2$

Proof
From the definition of the continuous uniform distribution, $X$ has probability density function:


 * $\map {f_X} x = \begin {cases} \dfrac 1 {b - a} & : a \le x \le b \\ 0 & : \text {otherwise} \end {cases}$

From the definition of the expected value of a continuous random variable:


 * $\ds \expect X = \int_{-\infty}^\infty x \map {f_X} x \rd x$

So:

Also see

 * Variance of Continuous Uniform Distribution


 * Expectation of Discrete Uniform Distribution