Computing $E(XY)$ for finding $Cov(X,Y)$ Consider tossing a cubic die once and let $n$ be the smallest number of dots that appear on top. Define two random variables $X$ and $Y$ such that: 


*

*$X=1$ if $n \in \left \{1,2  \right \}$, $X=2$ if $n \in \left \{3,4  \right \}$ and $X=3$ if $n \in \left \{5,6  \right \}$ and 

*$Y=0$ if $n \in \left \{3,6  \right \}$, $Y=1$ if $n \in \left \{1,4  \right \}$, and $Y=2$ if $n \in \left \{2,5  \right \}$
Find the $cov(X,Y)$.
The support of $X$ is $\left \{1,2,3  \right \}$ and the support of $Y$ is $\left \{0,1,2  \right \}$. 
The marginal probabilities are $f_{x}(X=1)=\frac{1}{3}$, $f_{x}(X=2)=\frac{1}{3}$, and $f_{x}(X=3)=\frac{1}{3}$ and the same for $Y=\left \{ 0,1,2 \right \}$
I have found $E(Y)=\frac{1}{3} (0) + \frac{1}{3} (1) + \frac{1}{3} (2) = 1$ and $E(X)=2$.
The formula for $Cov(X,Y) = E[(X-E(X))(Y-E(Y))]$, so I have $$Cov(X,Y) = E[(X-2)(Y-1)]=E[XY - X - 2Y +2]=E[XY]-E[X]-2E[Y]+2= E[XY] -2-2+2= E[XY] - 2.$$ 
EDIT: I was stuck on the $E[XY]$ part but have an answer now.

I think I've figured it out. The support of $E(XY) = \left \{0,1,2,3,4,6  \right \}$.
So $E(XY) = \frac{1}{3} (0) + \frac{1}{3} (1) +\frac{1}{3} (2) + \frac{1}{3} (3) + 0 + 0 = 2$
So $Cov(X,Y) = 2-2=0$. 
