Expectation of Continuous Uniform Distribution

Theorem
Let $X \sim \operatorname U \left[{a \,.\,.\, b}\right]$ for some $a, b \in \R$, $a \ne b$, where $\operatorname U$ is the continuous uniform distribution.

Then:


 * $\mathbb E \left[{X}\right] = \dfrac {a + b} 2$

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


 * $\displaystyle f_X \left({x}\right) = \begin{cases} \frac 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:


 * $\displaystyle \mathbb E \left[{X}\right] = \int_{-\infty}^\infty x f_X \left({x}\right) \rd x$

So:

Also see

 * Expectation of Discrete Uniform Distribution