2

Have two independent RV's $X$ and $Y$ sampled uniformly from $[0,1]$ and $C = (X-Y)^2$. Want $V(C$).

Rewrote as $V((X-Y)^2) = V(X^2) - 4V(X)V(Y) + V(Y^2)$ but that's too messy. Is it correct to write $\int_0^1\int_0^1 (x-\mu)^2\cdot f(,y) \cdot dxdy = \int_0^1\int_0^1 (x-1/12)^2\cdot f(x,y) \cdot dxdy$ ? Bit unsure how to evalute further.

Been awhile since I took a probability course so appreciate the help

SS'
  • 153
  • 5

2 Answers2

2

Your variance formulations are wrong. First of all $var(XY) \neq var(X)var(Y)$ in general, even if they're independent. And, You cannot write $var(X^2+2XY+Y^2)$ as $var(X^2)+var(2XY)+var(Y^2)$ because, $2XY$ and $X^2$ are dependent.

And, the expressions are not too messy, the key thing is $E[X^n]$, which is $\int_{0}^1x^ndx=\frac{1}{n+1}$.

$var(C)=E[C^2]-E[C]^2$, and

$E[C]=E[X^2]-2E[X]E[Y]+E[Y^2]$ $= 2E[X^2]- 2E[X]^2$ $=2var(X)$. Note that $X$ and $Y$ have the same statistical properties, so $E[Y^n]=E[X^n]$.

$E[C^2]=E[(X-Y)^4]=2E[X^4]-8E[X^3]E[X]+6E[X^2]^2$,

which are easy to calculate.

gunes
  • 57,205
0

I was going to work this work this out analytically but @gunes provided that already and this question here provides the final answer.

So I've chosen just to provide a numerical verification since this question never showed the distribution of $C$.

I estimate $\text{Var}(C) \approx 0.0384$ using 85k samples. Further computation produced $\text{Var}(C) \in [0.0382, 0.0396]$ with 95% confidence. Of course, based on this question we know the answer to be $\text{Var}(C)=\frac{7}{180}$.

Distribution of C

Variance of C