We choose numbers from {2, 3} by tossing a fair coin; the coin is tossed twice. Choose 2 if the coin turns up Heads and 3 if the coin is Tails. So the possible outcomes are {(2, 2),(2, 3),(3, 2),(3, 3)}. Let X be the first number chosen (so X ∈ {2, 3}) and let Y be the product of the two chosen numbers. Compute the covariance Cov(X, Y).
So I know the formula for covariance is Cov(X,Y) = E(XY)-E(X)E(Y).
I have worked out E(X) = 2P(X=2) + 3P(X=3) = 2.5
E(Y) = 4P(X=4) + 6P(X=6) + 9(X=9) = 6.25
However I am confused as to how to find E(XY)?
Well, you do the same analysis: $XY$ can possibly be $8$, $12$, $18$ and $27$, so
\begin{align} \mathbb{E}(XY) &=8\mathbb{P}(XY=8)+12\mathbb{P}(XY=12)+18\mathbb{P}(XY=18)+27\mathbb{P}(XY=27)\\ &= \frac{8+12+18+27}{4}\\ &= \frac{65}{4} \end{align}