Help with calculating the variance? I'm reading a statistics book and I don't understand the following deduction:
Let $X$ be uniformly distributed on the interval $[\mu - 0.05, \mu + 0.05]$. From here we get $E(X) = \mu$ and $Var(X) = (2\times0.05)^2/ 12 = 0.000833$. 
I don't understand how the variance was calculated... :/
 A: Let us make a more general calculation. Suppose that $X$ has uniform distribution on the interval $[a,b]$. Then $X$ has density function $\dfrac{1}{b-a}$ on $[a,b]$, and $0$ elsewhere. 
Recall that the variance of any random variable $X$ is $E(X^2)-\mu^2$, where $\mu$ is the mean of $X$.  In our case, $\mu$ is halfway between $a$ and $b$, so $\mu=\dfrac{a+b}{2}$.
We have 
$$E(X^2)=\int_a^b x^2\cdot \frac{1}{b-a}\,dx.$$
Integrate. We get $\dfrac{b^3-a^3}{3(b-a)}$, which simplifies to $\dfrac{b^2+ab+b^2}{3}$.
Now subtract $\mu^2$, that is, $\dfrac{(b+a)^2}{4}$, and simplify. We get
$$\operatorname{Var}(X)=\frac{b^2+ab+a^2}{3}-\frac{b^2+2ab+a^2}{4}=\frac{(b-a)^2}{12}.$$
A: That's just using the general formula, i.e. if $X\sim U(a,b)$ then
$$
\mathrm{Var}(X)=\frac{1}{12}(b-a)^2.
$$
Here $b=\mu+0.05$ and $a=\mu-0.05$ and hence $b-a=2\cdot 0.05$.
You can verify this formula yourself by computing the variance directly using that
$$
\mathrm{Var}(X)=E[X^2]-E[X]^2.
$$
Here $E[X^2]$ is obtained by the general formula
$$
E[X^2]=\int_a^b x^2\cdot f_X(x)\,\mathrm dx
$$
where $f_X$ denotes the density of $X$.
