# Independence, conditioning, and correlations

Suppose $X$ and $Y$ are independent random variables uniformly distributed on $[0,1]$. Suppose we consider a conditional distribution of $X$ and $Y$ on some event $C$. Is it possible that these conditional distributions are correlated?

## 2 Answers

An image generated with Python function seaborn.jointplot http://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.jointplot.html, illustrating the answer given by @grand.chat.

EDITED The graph of a joint probability density function of $$(X,Y)$$ is a surface $$z=f_{X,Y}(x,y)$$. Usually to illustrate such a distribution one displays its contour plot, that is some level lines projected onto the $$x-y$$ plane.

In our case the joint p.d.f. $$f_{X,Y|((X,Y)\in C)}$$ is equal to $$2$$ for $$(x,y)\in C$$ and zero otherwise. Hence the theoretical contour plot consists in just one contour line (the triangle of vertices $$(0,0), (0,1), (1,1)$$). But in the figure posted here it is drawn the contour plot of the estimated from data joint distribution function (I simulated $$(X,Y)|((X,Y)\in C)$$). Since this experimental joint pdf is not a constant at the points of $$C$$, you can see more contours lines, not just one.

• This is great. Thank you very much. – skyline Jun 11 '15 at 13:32
• What is the meaning of the level lines? Actually, what is this a picture of? – Did Jun 16 '15 at 20:19
• @Did I insert an Edit to explain what the plot represent. – xecafe Jun 17 '15 at 7:53
• Then I cannot understand why a nonzero proportion of the points are out of the triangle? – Did Jun 17 '15 at 12:02

Yes. Try the event $C:=\{Y>X\}$. The joint density of $(X,Y)$ conditional on $C$ is uniform on the 'upper triangle' of the unit square, so $Y$ and $X$ are positively correlated given $C$.

• is the reason they are correlated simply that, $P(X=.25)$ depends on whether $Y\geq .75$? (that is, the probability that $P(X=.25)$ is either 2 or 0 depending on where we are in the triangle (and similar for other points) – user106860 May 10 '18 at 3:37
• @user106860 Yes. One way to interpret the statement "$X$ and $Y$ are correlated" is that knowledge of the value of $Y$ affects the distribution of $X$. – grand_chat May 10 '18 at 17:09