Two cards are drawn without replacement from a pack of cards. The random variable $X$ measures the number of heart cards drawn, and the random variable $Y$ measures the number of club cards drawn. Find the covariance and correlation of $X$ and $Y$:
I did the following:
Y/X 0 1 2
0 (26/52)*(25/51) (13/52)*(26*51) (13/52)*(12/51)
1 (13/52)*(26*51) (13/52)*(13/51) 0
2 (13/52)*(12/51) 0 0
Now sum up the rows and the columns to get the marginal distribution. For instance $P(Y=0)= (26/52)\cdot (25/51) +2\cdot (13/52)\cdot (26\cdot 51) +(13/52)\cdot (12/51)$
With these probabilities you can calculate the expected value of $X$ and $Y$.
$E(Y)=\mu_y=0\cdot P(Y=0)+1\cdot P(Y=1)+2\cdot P(Y=2)$. Similar calculation for $\mu_x$
The covariance is
$$Cov(X,Y)=\left[\sum_{x=0}^2 \sum_{y=0}^2 x\cdot y\cdot P(X=x,Y=y)\right]-\mu_x\cdot \mu_y$$
The first four summands of the brackets are
$0\cdot 0\cdot P(X=0, Y=0)+0\cdot 1\cdot P(X=0, Y=0)+0\cdot 2\cdot P(X=0, Y=2)+1\cdot 0\cdot P(X=1, Y=0)+\ldots$
$=0\cdot 0\cdot (26/52)\cdot (25/51)+0\cdot 1\cdot 2 \cdot (13/52)\cdot (26/ 51)+0\cdot 2 \cdot (13/52)\cdot (12/51) +1\cdot 0\cdot 2\cdot (13/52)\cdot (26/ 51)+\ldots $
The correlation coefficient is
$Corr(X,Y)=\frac{Cov(X,Y)}{\sqrt{Var(X)\cdot Var(Y)}}$
with $Var(X)=\sum_{x=0}^2 P(X=x)\cdot (x-\mu_x)^2$