Variance of uniform distribution having an extra $2$ term

73 Views Asked by At

For $X \sim U(a,b)$, $V(X) = \frac{(b-a)^2}{12}$, but I have seen some sources have it as $\frac{1}{12}(b-a)(b-a+2)$. In fact, a question simply asked me to prove the that variance is $\frac{1}{12}(b-a)(b-a+2)$ given the uniform distribution.

I am able to successfully prove it to be $\frac{(b-a)^2}{12}$ but I'm not sure where that $2$ term can come from. When I look online, I actually see BOTH these on google images, but no explanation of the difference.

Can someone explain?

2

There are 2 best solutions below

5
On BEST ANSWER

The difference is between two different distributions

1.

$$X\sim U(a,b)$$

2.

$$Y\sim U\{a;b\}$$

  1. is a continuous distribution and its variance is $\mathbb{V}[X]=\frac{(b-a)^2}{12}$

  2. is a discrete distribution with variance $\mathbb{V}[Y]=\frac{n^2-1}{12}=\frac{(b-a)(b-a+2)}{12}$


If you want to prove $V(Y)$ the easiest way is to consider a shifted rv

$$Y\sim U\{1;n\}$$

and calculate

$$\mathbb{E}[Y]=\frac{1}{n}\sum_{i=1}^{n} i=\frac{n+1}{2}$$

$$\mathbb{E}[Y^2]=\frac{1}{n}\sum_{i=1}^{n} i^2=\frac{(n+1)(2n+1)}{6}$$

and thus

$$\mathbb{V}[Y]=\frac{(n+1)(2n+1)}{6}-\left(\frac{n+1}{2}\right)^2=\dots=\frac{n^2-1}{12}$$

this is enough for your proof being

$$n=b-a+1$$

and thus

$$n^2-1=(b-a)(b-a+2)$$

0
On

The difference between the two formulas arises because one is the variance of the continuous uniform distribution on the interval $[a,b]$, and the other is the variance of the discrete uniform distribution on the set $\{a, a+1, \ldots, b-1, b\}$.