# Proving two random variables are uncorrelated but not independent

I'm trying to find two random variables that are not independent -

there exist $a$ and $b$ such that $P(X=a \land Y=b)\neq P(X=a)P(Y=b)$

but, $\mathbb{E}[XY]=\mathbb{E}[X] \mathbb{E}[Y]$

I'm trying to understand some of the examples of this that I have seen, but they almost always define two random variables $X$ and $Y$ either in terms of each other, or in terms of a third random variable. This seems to be at odds with the formal definition of a random variable that I am accustomed to. That is, if we have a probability space $(\Omega,P)$, then a random variable $X$ is a mapping $X:\Omega \rightarrow \mathbb{R}$ (or some other space, but let's use $\mathbb{R}$ for simplicity).

So to say something like $\Omega=\{-1,0,1\}$ $P$ is uniform, $X(a)=a$ for all $a\in\Omega$ and $Y=X^{2}$ doesn't seem like an example, since $Y$ does not formally meet the definition of a random variable.

I'm also unsure of what values I would even sum over in computing $\mathbb{E}[XY]$ for this case. any help would be great.

• Why is $Y^2$ not a random variable? Also, when you write $\mathbb{E}[X,Y]$ do you mean $\mathbb{E}[XY]$, i.e. the expectation of the product? Because that is how one would usually state uncorrelation: $\mathbb{E}[XY]=\mathbb{E}[X]\mathbb{E}[Y]$. – Furrer Oct 26 '16 at 21:42
• @Furrer yes, I fixed the expectation I had... I am asking why $Y$ is a random variable. Why is it okay to define random variables in terms of one another? – mm8511 Oct 26 '16 at 21:48
• I have given the answer to that question below. – Furrer Oct 26 '16 at 21:59
• @Furrer, Right, I guess what I am asking is whether or not the value of $Y$ is determined by $X$ i.e. is $P(X=0,Y=1)=0$? If so, then how does$Y(\omega)$ as a function make any sense? – mm8511 Oct 26 '16 at 22:05
• You are absolutely right. Thinking about $Y$ as a function in this manner is not very useful. If you learn about continuous random variables based on measure theory, you will notice that one usually does not consider the structure of $\Omega$ itself. It is in a sense given by the goddess of fortune. What we need to know is not which $\omega$'s result in a certain outcome of $X$, i.e. we do not need to know the exact structure of the mapping, we only need to know the probabilities of the outcome occurring i.e. the distribution of $X$. – Furrer Oct 26 '16 at 22:13

Your example is fine. $Y$ is a random variable, because $Y$ is a mapping from the probability space to $\mathbb{R}$ given by $Y(\omega)=X^2(\omega)=\omega^2$ for $\omega\in\Omega$. Thus most of the examples you have seen hold.
• But in this case, why would these two random variables not be independent? Can $X=1$ and $Y=0$? or must $Y$ also be 1? – mm8511 Oct 26 '16 at 21:51
• Let us first assume in your example that $X$ is uniform on $\Omega$, i.e. each event is equally likely, that is $P(X=-1)=P(X=0)=P(X=1)$. Then $\mathbb{E}[X]=0$ and $\mathbb{E}[XY]=\mathbb{E}[X^3] = 0$, such that the variables are uncorrelated (we don't even have to consider $\mathbb{E}[Y]$ - nice). But they are not independent. As you suggest, take the events $(X=0)$ and $(Y=1)$. Then $P(X=0, Y=1)=P(X=0,X^2=1)=0$ while $P(X=0)P(Y=1)=1/3 \cdot P(X^2 = 1) = 1/3 \cdot 2/3 = 2/9$. – Furrer Oct 26 '16 at 22:04
• One usually says that the correlation only is able to detect linear dependency between random variables. In this case $Y$ clearly depends on $X$ - but not in a linear way. Also: A random variable is not just a mapping from $\Omega$ to say $\mathbb{R}$. It is a mapping from the probability space to say $\mathbb{R}$. As such it is not central to specify the mapping itself but the probabilities of the events attached to the random variable. E.g. the example works the exactly same way if I use $\Omega = \{-2,0,2\}$. – Furrer Oct 26 '16 at 22:08