5

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.

gung - Reinstate Monica
  • 132,789
  • 81
  • 357
  • 650
meet
  • 53
  • 5
  • 2
    The formula you quote *can* be used. Please explain why you are "unable to get a solution" with it. – whuber Mar 23 '17 at 21:59
  • @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? – meet Mar 23 '17 at 22:24

1 Answers1

5

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
Antoni Parellada
  • 23,430
  • 15
  • 100
  • 197
  • 3
    +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. – whuber Mar 24 '17 at 02:21
  • 1
    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.$ – whuber Mar 24 '17 at 02:46
  • @whuber Yes, you are right. I would've given up if it hadn't been for the triangular distribution life saver... – Antoni Parellada Mar 24 '17 at 02:48
  • @AntoniParellada Thank you both so much for the help. I kind of used a different method to do it and perhaps that is why I didn't manage to get it. But really thank you so much for the help :) – meet Mar 24 '17 at 10:44
  • 1
    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](http://stats.stackexchange.com/a/43075/919) $$\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}.$$ – whuber Mar 24 '17 at 11:52
  • @whuber It is a shame that your two comments are not part of a great (and *the* accepted) answer. I am thinking you are being nice, but please don't hesitate on my account. – Antoni Parellada Mar 24 '17 at 12:21
  • Antoni, please feel free to incorporate any of these comments in edits to your answer. – whuber Mar 24 '17 at 12:27
  • @whuber How could you write down the answer from the cf of $U-U'$? I can't follow that last step. – COOLSerdash Mar 25 '17 at 19:45
  • 1
    @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. – whuber Mar 25 '17 at 21:50