A deck of cards contains a total of 20 cards with 12 yellow cards, 4 purple cards and 4 red cards. We draw five cards without replacement. Let X be the number of purple cards drawn and Y be the number of yellow cards drawn.
What is the Cov (X,Y)?
So I obviously know the formula is E[xy]-E[x]E[y] and I know $P(x,y,z)=\frac{\binom{4}{x} \binom{12}{y} \binom{4}{z}}{\binom{20}{5}}$.
Now I have that $E[xy]$=$$\sum_{x}\sum_{y} \frac{\binom{4}{x} \binom{12}{y} \binom{4}{5-x-y}}{\binom{20}{5}}(xy)$$.
The problem is I don't know how to sum this. Is there a more simple calculation or if there is not how would I sum this?
Meanwhile for $E[x]E[y]$ since I believe this is hypergeometric I just did $E[x]=\frac{5(4)}{20}$ and $E[y]=\frac{5(12)}{20}$
If somebody can help me with the sum that would be appreciated!
Use indicator functions. Label the card in the hand 1 to 5 and let $X_i$ and $Y_i$ indicate whether card $i$ is purple or yellow, respectively.
$$\begin{align}\mathsf E(X)&=\sum_{i=1}^5\mathsf E(X_i)\\&=5\cdot\tfrac 4{20}\\&=1\\[2ex]\mathsf E(Y)&=\sum_{j=1}^5\mathsf E(Y_j)\\[1ex]&=3\\[2ex]\mathsf E(XY)&=\sum_{i=1}^5\sum_{j=1}^5\mathsf E(X_iY_j)\\[1ex]&=\sum_{i=1}^5\mathsf E(X_iY_i)+\sum_{i=1}^5\sum_{j=1}^5\mathsf E(X_i)\,\mathsf E(Y_j)\,\mathbf 1_{i\neq j}\\[1ex]&~~\vdots\end{align}$$