I have a problem from my textbook:
Let $A$ and $B$ be independent events. Show that $X = I_A + I_B$ and $Y=|I_A − I_B|$ are uncorrelated. Are $X$ and $Y$ independent?
I've managed to shown that they're uncorrelated by solving for $Cov(X,Y)$. This was shown to be $0$, thus uncorrelated. However, I'm struggling to show whether they're independent or not.
If we also let $p(A) := p$, we can try to find $f_{X,Y}(x,y)$. Thereafter, we can try to solve for $f_X$ and $f_Y$ separately, and check for independence. However, I don't really know how to form $f_{X,Y}$, so I started the other way around.
$$ f_X(x) = \left\{\begin{matrix} 2p(1-p), \quad x = 0,2 \\ p^2+(1-p)^2,\quad x = 1 \end{matrix}\right.$$
$$ f_Y(y) = \left\{\begin{matrix} 2p(1-p), \quad y = 1 \\ p^2+(1-p)^2, \quad y = 0 \end{matrix}\right.$$
But how do we find $f_{X,Y}(x,y)$ here really?
Thank you for any help.
Your computation of $f_X$ is wrong. You seem to assume that $P(B)=P(A)$ , I don't know why.
Let instead $p=P(A)$, $q=p(B)$
Then $$\begin{align} P(X=0) &=(1-p)(1-q) \\ P(X=1) &=(1-p)q + (1-q)p \\ P(X=2) &=p\,q \\ \end{align} $$ and
$$\begin{align} P(Y=0) &=p q + (1-p)(1-q) \\ P(Y=1) &= (1-p)q + (1-q)p \\ \end{align} $$
You can also compute the joint probability, and check that $P(X Y) \ne P(X)P(Y)$. But that's really not needed.
Just noticing that $X= 1 \iff Y=1$ tells you that the $X,Y$ are not independent.
Namely, $P(X=1 , Y=0)=0$. But $P(X=1) P(Y=0) > 0$. Hence you've found a pair such that $P(X Y) \ne P(X)P(Y)$, they are not independent.