5
$\begingroup$

When $U$ and $U'$ are two i.i.d. uniformly distributed random variables on $[0, 1]$, show that $$\mbox{Var} \left( (U-U')^2 \right) = 0.04 $$

I tried plugging in the formula $\mbox{Var}(U^2)=E(U^4)-E(U^2)^2$ but unable to get a solution. I guess this formula cannot be used here, but I have no idea why.

$\endgroup$
2
  • 2
    $\begingroup$ The formula you quote can be used. Please explain why you are "unable to get a solution" with it. $\endgroup$
    – whuber
    Commented Mar 23, 2017 at 21:59
  • $\begingroup$ @whuber My step is to break it down to Var(U^2) + 4[E(U^2)E(U'^2)-E(U)^2E(U')^2) + Var(U'^2). However I am not able to get 0.04. Am i able to use the quoted formula for Var(U^2) since U^2 does not follow a uniform distribution anymore? $\endgroup$
    – meet
    Commented Mar 23, 2017 at 22:24

1 Answer 1

6
$\begingroup$

A way of looking at it would be to notice that $Y = U-U'$ with both $U\sim U(0,1)$ and $U'\sim U(0,1)$ follows a standard triangular distribution, which density function is

$$f_Y(y) = \begin{cases} y+1, & -1<y<0 \\[2ex] 1-y, & 0<y<1 \end{cases}$$

Here is the plot:

enter image description here

In this way,

$$\text{Var}\left[(U-U')^2\right]=\text{Var}[Y^2]= \mathbb E\left[Y^4\right]-\left[\mathbb E\left[Y^2\right]\right]^2\tag 1$$

Applying LOTUS,

$$\mathbb E[Y^2]=\int_{-1}^0y^2(y+1)\,dy+\int_0^1 y^2(1-y)dy=\frac{1}{6}$$

and

$$\mathbb E[Y^4]=\int_{-1}^0y^4(y+1)\,dy+\int_0^1 y^4(1-y)dy=\frac{1}{15}.$$

Now it's just a matter of plugging these values into $(1).$

Here is the rough-and-tumble reassurance in R:

> set.seed(0)
> u = runif(1e6)
> u_prime = runif(1e6)
> y = u - u_prime
> z = y^2
> mean(z)
[1] 0.166769
> var(z)
[1] 0.03898331
$\endgroup$
9
  • 3
    $\begingroup$ +1 If you like, you could do this entirely algebraically by expanding $$E((U-V)^4)-E((U-V)^2)^2 = E(U^4-4U^3V+6U^2V^2-4UV^3+V^4)-(E(U^2-2UV+V^2))^2,$$ using linearity of expectation and the (easy) fact that $E(U^k)=1/(k+1)$ (where I write $V$ for $U^\prime$). This drives home the realization that the result has little to do with the actual distributions of $U$ and $V$: it's just a relationship among their first four moments. $\endgroup$
    – whuber
    Commented Mar 24, 2017 at 2:21
  • 1
    $\begingroup$ Sometimes you should just be brave and not give up! The calculation is purely mechanical: $$E(U^4-4U^3V+6U^2V^2-4UV^3+V^4)\\=1/5-4(1/4)(1/2)+6(1/3)(1/3)-4(1/2)(1/4)+(1/5)=1/15$$ and $$E(U^2-2UV+V^2) = 1/3-2(1/2)(1/2)+1/3=1/6,$$ which brings us directly to the same solution you obtained, $1/15-1/6^2=7/180.$ $\endgroup$
    – whuber
    Commented Mar 24, 2017 at 2:46
  • $\begingroup$ @whuber Yes, you are right. I would've given up if it hadn't been for the triangular distribution life saver... $\endgroup$ Commented Mar 24, 2017 at 2:48
  • 1
    $\begingroup$ I'm curious what the alternative was. About the easiest way I can think of doing this starts with the characteristic function of the uniform distribution $$\psi_U(t) = \frac{e^{it}-1}{it},$$ whence the cf of $U-U^\prime$ is $$\psi_{U-U^\prime}(t)=\psi_U(t)\psi_{U^\prime}(-t)= 4\frac{\sin^2(t/2)}{t^2}=1+\frac{t^2}{12}+\frac{t^4}{360}+\cdots,$$ from which we may immediately write down the answer as $$\operatorname{Var}{((U-U^\prime)^2)}=4!\frac{1}{360}-\left(2! \frac{1}{12}\right)^2=\frac{1}{15}-\frac{1}{6^2}.$$ $\endgroup$
    – whuber
    Commented Mar 24, 2017 at 11:52
  • 1
    $\begingroup$ @COOL The absolute value of the coefficient of $t^k$, multiplied by $k!$, is the $k^\text{th}$ moment. The variance, by definition, is the expectation of the square of its argument (thus, the fourth moment of $U-U^\prime$) minus the square of the the expectation of its argument (which is the second moment of $U-U^\prime$). Putting those observations together lets you immediately write down the final formula simply by looking at the expansion of $\psi_{U-U^\prime}$ through fourth order. $\endgroup$
    – whuber
    Commented Mar 25, 2017 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.