[Math] Is it possible that two independent variables become dependent conditioning on a third random variable

independenceprobabilityprobability theory

Is that possible that random variables $X$ and $Y$ are independent but they are no longer independent if condition on another random variable $Z$? Is there a mathematical example and an approximate real life example for it? What does it mean intuitively that two random variables are independent but condition on another random variable, these two old random variables suddenly have relation?

I was thinking about the following real life example.
Say a doctor wants to know if a new medicine is effective of reduce the blood pressure of the population (for all men and women). Let $Y_{1i}$ be the random variable represents the distribution of the blood pressure of the population if they all take the medicine and $Y_{0i}$ be the random variable represents the distribution of the blood pressure of the population if they all did not take the medicine. Let $D_i$ be the random outcome of the $i^{th}$ coin flip. So if it is head, then subject $i$ takes the medicine and if it is tail, then subject $i$ drinks pure water. So in this case, $D_i$ is independent of $Y_{1i}$, i.e., learning the value of $D_i$ does not help you to know better about the distribution of $Y_{1i}$. But now, what if I tell you subject $i$ is male, then condition on this information, will $D_i$ and $Y_{1i}$ be independent?

Best Answer

Suppose that we flip a fair coin twice, and let $X,Y$ be the indicator random variables that the first or second flip is heads. Then $X$ and $Y$ are independent.

However, if $Z=X+Y$, then $X$ and $Y$ are not independent conditioned on $Z$, since for instance $$ \mathbb{P}(X=1,Y=1\mid Z=1)=0 $$ while $$ \mathbb{P}(X=1\mid Z=1)\mathbb{P}(Y=1\mid Z=1)=\frac{1}{2}\cdot\frac{1}{2}=\frac{1}{4}$$

Related Question