# Conditional Expectation Question

Suppose $p(0,0)=\frac{1}{18}$, $p(0,1)=\frac{3}{18}$, $p(1,0)=\frac{4}{18}$, $p(1,1)=\frac{3}{18}$, $p(2,0)=\frac{6}{18}$, $p(2,1)=\frac{1}{18}$.

Does $E[X|Y]= E[X]$ and $E[Y]= E[Y|X]$?

-
What is left to explain after the answers you received here? – Did Apr 28 '12 at 15:18

Well, $E[X|Y]$ is a random variable and $E[X]$ is a number, so no...

But it is true that $E[X]=E[E[X|Y]]$ and $E[Y]=E[E[Y|X]]$; a formula which holds more generally for jointly distributed random variables $X$ and $Y$.

Let's verify this for the random variables $X$ and $Y$ in your question. Here, $X$ refers to the first coordinate of your joint mass function and $Y$ refers to the second coordinate.

First let's figure out what values $X$ takes and it's marginal distribution.

Looking at your joint mass function $p(x,y)$, we see that $X$ takes the values $0$, $1$, and $2$.

To find the marginal distribution of $X$ we need to calculate the probability that $X$ takes on a specific value: \eqalign{ p_X(0)=P[X=0]&=\textstyle P[X=0 ,Y=0]+P[X=0,Y=1]= {1\over 18}+{3\over18}={4\over 18}\cr p_X(1)=P[X=1]&=\textstyle P[X=1 ,Y=0]+P[X=1,Y=1]= {4\over 18}+{3\over18}={7\over 18}\cr p_X(2)=P[X=2]&=\textstyle P[X=2 ,Y=0]+P[X=2,Y=1]= {6\over 18}+{1\over18}={7\over 18}. }

As a check of our work, note $p_X(0)+p_X(1)+p_X(2)=1$, as it should.

While we have everything in hand let's find $E[X]$: $$\tag{1} E[X]=0\cdot{4\over18}+1\cdot{7\over18}+2\cdot{7\over18}={14\over18}.$$

Now on to $Y$:

$Y$ takes the values $0$, and $1$.

The marginal distribution of $Y$ is: \eqalign{ p_Y(0)=P[Y=0]&=\textstyle P[Y=0 ,X=0]+P[Y=0,X=1]+P[Y=0,X=2]\cr &= {1\over 18}+{4\over18}+ {6\over 18}\cr & ={11\over18}\cr p_Y(1)=P[Y=1]&=\textstyle P[Y=1 ,X=0]+P[Y=1,X=1]+P[Y=0,X=2]\cr &= {3\over 18}+{3\over18}+ {1\over 18}\cr & ={7\over18}.\cr }

Note $p_Y(0)+p_Y(1) =1$, as it should.

The expectation of $Y$ is $$E[Y]=0\cdot{11\over18}+1\cdot{7\over18} ={7\over18}.$$

Note that if you wrote the joint mass function in tabular form $$\matrix{ X\backslash Y & 0&1 \cr 0\ \ \ \ \ &{1\over18}&{3\over18} \cr 1\ \ \ \ \ &{4\over18} &{3\over18} \cr \cr 2\ \ \ \ \ &{6\over18} &{1\over18} }$$ Then the marginal distribution of $X$ is given by row sums of the table and the marginal distribution of $Y$ is given by the column sums of the table.

Now on to the random variable $E[X|Y]$. Note that $E[X|Y]$ is a function of the random variable $Y$. The value of $E[X|Y]$ at $y$ is by definition $E[X|Y=y]$. The quantity $E[X|Y=y]$ is called the conditional expectation of $X$ given $Y$ and its value at $Y=y$ is defined to be $$E[X|Y=y] =\sum_x xP[X=x|Y=y]=\sum_x x{p(x,y)\over p_Y(y)}.$$ Note also that to find, for example $P[X=0|Y=1]$, you can go to the table and take the $(0,1)$ entry (which is $p(0,1)$) and divide by the column sum for column 1 (this gives $p_Y(1)$).

We have

\eqalign{ \Bbb E[X|Y=0]&= 0\cdot P[X=0|Y=0]+1\cdot P[X=1|Y=0]+2\cdot P[X=2|Y=0]\cr &=0+{p(1,0)\over p_Y(0)}+{p(2,0)\over p_Y(0)}\cr &={4/18\over11/18}+{6/18\over11/18}\cr &={10\over11}. }

\eqalign{ \Bbb E[X|Y=1]&= 0\cdot P[X=0|Y=1]+1\cdot P[X=1|Y=1]+2\cdot P[X=2|Y=1]\cr &=0+{p(1,1)\over p_Y(1)}+{p(2,1)\over p_Y(1)}\cr &={3/18\over7/18}+{1/18\over7/18}\cr &={4\over7}. }

Now, since $E[X|Y]$ is a function of the random variable $Y$: \eqalign{ E[E[X|Y]]&= \sum_y E[X|Y=y]\cdot P[Y=y]\cr &= E[X|Y=0]\cdot P[Y=0]+ E[X|Y=1]\cdot P[Y=1] \cr &={10\over11}\cdot {11\over18}+{4\over7}\cdot{7\over18}={14\over18}; } the same value as found in $(1)$, as claimed.

I'll leave the verification that $E[Y]=E[E[Y|X]]$ as an exercise.

-

Use the fact that $E[X] = E(E[X|Y])$ and $E[Y] = E(E[Y|X])$.

-