0
$\begingroup$

If $X$ and $Y$ are two i.i.d. Bernoulli random variables (p=0.5) and $Z := X \oplus Y$ (xor operator)

Is $Z$ independent of $X$, and are $X$ and $Y$ conditionally independent given $Z$?


I think that $Z$ is dependent on $X$, and $X$ and $Y$ are conditionally dependent given $Z$, but I'm not sure how to check this.

  • 1
    $X$ and $Y$ are binary-valued I assume?2017-01-30
  • 0
    Yes, sorry I didn't realize that was significant.2017-01-30
  • 1
    Also, the answer depends on the distribution of $X$ and $Y$2017-01-30
  • 0
    Added that to my question2017-01-30

2 Answers 2

2

To determine whether $Z$ is independent of $X$ we need to compute $P(Z|X)$ and $P(Z)$ and see if they're equal. $Z=0$ if $X=Y$ and $Z=1$ if $X\ne Y,$ so we see that $Z$ is also (unconditionally) Bernoulli with $p=1/2.$

However, say $X=0.$ Then conditional on $X=0$, $Z = 1$ if and only if $Y=1,$ so it is conditionally Bernoulli with $p=1/2.$ Similarly if $X=1,$ it is conditionally Bernoulli with $p=1/2.$ So the conditional distribution is the same as the unconditional distribution and $Z$ is independent of $X.$ (And of $Y$ by symmetry. But it's not jointly independent of $X$ and $Y$)

If we know $Z$ then knowing $X$ implies we know $Y,$ so $X$ and $Y$ are conditionally dependent given $Z.$

  • 0
    Thanks. Both answers are good, but I'm going to accept this one because it's a little easier to follow as a probability novice.2017-01-30
  • 0
    @Jake Do you see also why the answer to the first part would be different if $p\ne 1/2$? (I think the other answer shows that.)2017-01-30
  • 0
    I follow the math, but Ill probably need to think about it for a bit until it makes sense to me intuitively.2017-01-30
  • 1
    @Jake My reasoning would break down if it weren't. Say $p=2/3.$ Then if you knew $X=0$ then $Z$ would be $1$ with probability $2/3$ whereas if $X=1$ then $Z=1$ with probability $1/3.$ So knowing $X$ gives you information about the distribution of $Z.$ ( And unconditionally (if you don't know $X$ or $Y$) then $Z=1$ with probability $4/9.$ )2017-01-30
1

Assuming that $X$, $Y$ and $Z$ have $\{0, 1\}$ as their support (you can extend to a more general case reasonably easily):

$\begin{eqnarray}P(Z = 0) & = & P(X = 0, Y = 1) + P(X = 1, Y = 0) \\ & = & P(X = 0)P(Y = 1) + P(X = 1)P(Y = 0) \\ & = & 2 \times P(X = 0)\left(1 - P(X = 0)\right) \\ & = & 2p_0(1-p_0)\end{eqnarray}$

Where $p_0 = P(X = 0) = P(Y = 0) = 1 - P(X = 1) = 1 - P(Y = 1)$, since they are iid.

$\begin{eqnarray}P(Z = 0 | X = 0) & = & P(Z = 0 | X = 0, Y = 0)P(Y = 0) + P(Z = 0 | X = 0, Y = 1)P(Y = 1) \\ & = & 0 \times P(Y = 0) + 1 \times P(Y = 1) \\ & = & P(Y = 1) \\ & = & P(X = 1) \\ & = & 1 - P(X = 0) \\ & = & 1 - p_0 \end{eqnarray}$

So the two are only equal if $2p_0(1 - p_0) = 1 - p_0$, which happens if $p_0 = \frac{1}{2}$ or $p_0 = 1$. In the latter case, $Z$ is always 0, so it is independent of $X$ and $Y$. In the former (which you've now edited to say is the case in question), you flip two coins. Then, if the second coin is tails, you turn the first coin over. Finally, you record the side the first coin is on. It doesn't matter which side the first coin initially lands on, it has an equal chance of being flipped over or not, so the final result is independent of the first coin's initial flip.