Here's a question:
Tossing a fair cube 6 times.
Let $X$ = number of tosses gave 1, and let $Y$ = number of tosses gave 2.
Calculate $Cov(X, Y)$.
I know that $Cov(X, Y) = E(XY) - E(X)E(Y)$.
I need help to find $E(XY)$. What is the right way to do it?
Thanks in advance.
We could find the distribution of $XY$. Then the expectation of $XY$ can be calculated in the usual way. A fair bit of work!
Alternately, let $X_i=1$ if the $i$-th toss is a $1$, and let $X_i=0$ otherwise. Let $Y_i=1$ if the $i$-th toss is a $2$, and $0$ otherwise. Then $X=X_1+\cdots +X_6$ and $Y=Y_1+\cdots+Y_6$. So we want $$E((X_1+\cdots+X_6)(Y_1+\cdots+Y_6)).$$ Imagine expanding the product. We get a sum of terms $X_iY_i$, and of terms $X_iY_j$ where $i\ne j$.
Now use the linearity of expectation. We have $X_iY_i=0$, so the expectation of these terms is $0$.
For the $30$ terms of the shape $X_iY_j$ where $i\ne j$, note that $X_iY_j=1$ with probability $\frac{1}{36}$, so $E(X_iY_j)=\frac{1}{36}$. It follows that $E(XY)=\frac{30}{36}$.