#### Example 3.1.7.

Let \(X\) be uniform on the interval \([a, b]\text{.}\) So \(X\) has the pdf \(f(x) = \frac{1}{b - a}\text{.}\) We might reasonably expect that the average value of \(X\) would be the midpoint of the interval. Let’s check that:
\begin{align*} \E(X) \amp = \int_a^b x f(x)\ dx \\ \amp = \int_a^b \frac{x}{b - a} \ dx \\ \amp = \frac{1}{b-a} \left(\frac{x^2}{2}\right)\bigg|_a^b \\ \amp = \frac{1}{b-a} \left( \frac{b^2}{2} - \frac{a^2}{2} \right) \\ \amp = \frac{1}{b - a}\left( \frac{(b - a)(b + a)}{2}\right) \\ \amp = \frac{a + b}{2}. \end{align*}
🔗
🔗
in-context