Show that X and Y given Z are not conditionally independent.

Given a fair coin and independently flip it three times.

$$$$X = \begin{cases} 1\;\text{if the first flip is H}\\ 0\;\text{if the first flip is T}\\ \end{cases},\;\;\; Y = \begin{cases} 1\;\text{if the second flip is H}\\ 0\;\text{if the second flip is T}\\ \end{cases}$$$$

$$$$Z= \begin{cases} 0\;\text{if there is no heads in the first two flips}\\ 1\;\text{if there is exactly one head in the first two flips}\\ 2\;\text{if there is exactly two heads in the first two flips} \end{cases}$$$$

Show that X and Y are not conditionally independent given Z.

My attempt:

\begin{align*} \mathbb{P}(X=x\;|\;Z=z)&=\mathbb{P}(X=0\;|\;Z=0)+\mathbb{P}(X=0\;|\;Z=1)+\mathbb{P}(X=0\;|\;Z=2)\\ &+\mathbb{P}(X=1\;|\;Z=0)+\mathbb{P}(X=1\;|\;Z=1)+\mathbb{P}(X=1\;|\;Z=2)\\ &=1+\frac{1}{2}+0+0+\frac{1}{2}+1=3 \end{align*}

Same process for Y and Z. My concern is that the probability for $$\mathbb{P}(X=x\;|\;Z=z)$$ is greater than $$1$$, which shouldn't be the case. Can someone point out what I did wrong in this case?

After I figure out these probabilities, I can show that $$\mathbb{P}(X=x,\;Y=y\;|\;Z=z)\neq\mathbb{P}(X=x\;|\;Z=z)\mathbb{P}(Y=y\;|\;Z=z)$$ to show that they are not independent.

• $\Pr(X=x\mid Z=z)$ if given a value would not be a number but rather an expression which depends on both $x$ and $z$. Whatever you thought you were doing when you "expanded" this was wrong. Feb 15, 2021 at 1:53
• As for showing they are not conditionally independent, you need to have found specific values of $x,y,z$ such that $\Pr(X=x,Y=y\mid Z=z)\neq \Pr(X=x\mid Z=z)\Pr(Y=y\mid Z=z)$. It might be the case that for some values of $x,y,z$ the equation holds... we would have needed it hold for all values if they were indeed independent. As for a hint on this... $0\neq \frac{1}{4}$ Feb 15, 2021 at 1:55

• First to point out something you did. Notice your sum was 3. This suggests that there are 3 complete, well, probability spaces in there. Indeed, you can observe that $$P(X=0|Z=0)+P(X=1|Z=0)=1+0=1$$, $$P(X=0|Z=1)+P(X=1|Z=1)=\frac 1 2+\frac 1 2=1$$, and $$P(X=0|Z=2)+P(X=1|Z=2)=0+1=1$$. Look at it for a bit and you will see that conditioned on an event, say Z=0, you range over all the possible values of X, and they sum to 1. This happens for each possible value of Z.
• To show that X and Y are not conditionally independent given Z, it suffices to find one instance such that $$P(X=x,Y=y|Z=z)\ne P(X=x|Z=z)P(Y=y|Z=z)$$. Let's choose $$P(X=1,Y=1|Z=1)=0$$
$$P(X=1|Z=1)P(Y=1|Z=1)=\frac 1 2\cdot \frac 1 2=\frac 1 4$$
• Notice that if you had tried $$P(X=0,Y=1|Z=0)=0,P(X=0|Z=0)P(Y=1|Z=0)=1*0=0$$ you would've found equivalent evaluations of the expressions. But you can't conclude that X and Y are conditionally independent given Z because you need this to hold over all possible combinations of X=x, Y=y, Z=z.