Find the standard deviation of $|X−Y|$

probabilitystatistics

Let $X$ and $Y$ be independent random variables with a Bernoulli Distribution $Ber(1/3)$. Find the standard deviation of $|X−Y|$.

The Standard Deviation in the square root of the variance. For a $Ber(1/3)$ the $Var(X)=Var(Y)=1/3(1-1/3)=2/9$, now how can I calculate $\sigma=\sqrt{Var(|X−Y|)}$? Because my idea was to subtract the two $Var$ but then the result will be $0$, but it should be $\frac{2\sqrt{5}}{9}$, how can I solve it?

Best Answer

\begin{equation} |X-Y|= \begin{cases} 1 & \text{iff} \quad (X=1 \quad \wedge\quad Y=0)\quad \vee \quad (X=0 \quad \wedge\quad Y=1) \\ 0 & \text{iff} \quad (X=1 \quad \wedge\quad Y=1)\quad \vee \quad (X=0 \quad \wedge\quad Y=0) \end{cases} \end{equation} So $|X-Y|$ is another Bernoulli random variable and

$Pr(|X-Y|=1)=Pr(X=1)Pr(Y=0)+Pr(X=0)Pr(Y=1)=(1/3)(2/3)+(2/3)(1/3)=4/9=p$

and then

$Var(|X-Y|)=(4/9)(5/9)=20/81 \implies SD=\sqrt{20/81}=(2\sqrt{5})/9$, as required.

Related Question