# Random variable independence

Let's say I have two independent random variables $X$ and $Y$.

Because of this independence, I can evaluate (for example) the following functions:

$$f(X,Y)=X+Y$$ $$g(X,Y)=|X-Y|$$

But I can't necessarily extend this independence property and say that:

$$f(X,Y)$$ and $$g(X,Y)$$

are independent, can I (and therefore evaluate $f(X,Y)+g(X,Y)$)?

## 1 Answer

Take $X$ and $Y$ such that

$$P(X=0)=1/2, P(X=1)=1/2, P(Y=0)=1/2, P(Y=1)=1/2$$

then $$P(X+Y=2, |X-Y|=1) = 0$$

while

$$P(X+Y=2)\cdot P(|X-Y|=1) = 1/4 \cdot 1/2 = 1/8$$

So $X+Y$ and $|X-Y|$ are not independent.