0
$\begingroup$

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?

$\endgroup$
0

3 Answers 3

5
$\begingroup$

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\}$.

$\endgroup$
1
$\begingroup$

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)$$

$\endgroup$
5
  • $\begingroup$ how did you prove $E(X)$? I did it by integrating $\int_a^b x\frac{1}{b-a}dx$ but as you said, the variance should be discrete so how do I consider the sum to prove the same thing? $\endgroup$ Commented Aug 5, 2021 at 23:52
  • $\begingroup$ OH I see what you did. Why does a simple shift make it valid? $\endgroup$ Commented Aug 5, 2021 at 23:54
  • $\begingroup$ @user71207 : because $V(X+a)=V(X)$ $\endgroup$ Commented Aug 6, 2021 at 3:56
  • $\begingroup$ Wait... but isn't this using the CONTINUOUS distribution and simply shifting it? How is THAT still valid if we are to prove for the discrete case? $\endgroup$ Commented Aug 7, 2021 at 2:13
  • $\begingroup$ @user71207 : a shift does not affect the variance of a rv. This is always valid and it is very easy to prove. By the way did you forget to accept my answer? $\endgroup$ Commented Aug 7, 2021 at 4:49
0
$\begingroup$

To derive the variance of a discrete uniform random variable $Y\sim U\{a,a+1,\dots,b\}$, note that if $V\sim U[0,1)$ and independent of $Y$, then $X=Y+V\sim U[a,b+1)$. By additivity of variance of independent random variables, we have $$ \operatorname{Var}X = \operatorname{Var}Y+\operatorname{Var}V $$ and since $\operatorname{Var}V=1/12$ and $\operatorname{Var}(X)=(b+1-a)^2/12$, $$ \operatorname{Var} Y=\frac{(b+1-a)^2-1}{12}. $$

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.