# 連続一様分布とその平均・分散

$f(x) = \begin{cases} 0 & (x \not \in [a, b] \\ \frac{1}{b – a} & (x \in [a, b]) \end{cases}$

## 期待値

\begin{eqnarray*} \textrm{E}(X) & = & \int _ {- \infty} ^ \infty x f(x) dx \\ &= & \int _{a} ^{b} x f(x) dx \\ &= & \frac{1}{b-a} \int _{a} ^{b} x dx \\ &=& \frac{1}{b – a} \left[ \frac{x^2}{2} \right] ^b _a \\ & = & \frac{1}{b – a} \left( b^2 – a^2 \right) \\ & =& \frac{a + b}{2} \end{eqnarray*}

## 分散

\begin{eqnarray*} \textrm{V}(X) & = & \int _{-\infty} ^{\infty} f(x) \left( x – \textrm{E}(X) \right)^2 dx\\ & = & \int _{a} ^{b} f(x) \left( x – \frac{a + b}{2} \right) ^2 dx \\ & = & \frac{1}{b – a} \int _{a} ^{b} \left( x – \frac{a + b}{2} \right) ^2 dx \\ & = & \frac{1}{b – a} \left[ \frac{1}{3} \left( x – \frac{a + b}{2} \right) ^ 3 \right] _a ^ b \\ & = & \frac{1}{b – a} \left( \frac{1}{3} \left( \left( \frac{b-a}{2} \right) ^3 – \left( \frac{a – b}{2} \right) ^3 \right) \right) \\ &=& \frac{1}{b-a} \frac{1}{3} \frac{(b – a)^3}{4} \\ & = & \frac{1}{3} \frac{(b – a)^2}{4} \\ & = & \frac{(b-a)^2}{12} \end{eqnarray*}