# Throwing the symmetric dice

We throw the symmetric dice $n$ times. Let $X$ - the number of received ones, $Y$ - the number of received sixes. Find $\text{Cov}(X,Y)$.

My solution:

We know that $\text{Cov}(X,Y)= \mathbb{E}(XY)-\mathbb{E}(X)\mathbb{E}(Y)$ and $\mathbb{E}(X)=\mathbb{E}(Y)=\frac{n}{6}$.

How can I find $\mathbb{E}(XY)$?

We first define several new random variables:

• $X_1, \cdots, X_n$, where $X_i = 1$ if $i$th throw is $1$ and $X_i = 0$ otherwise.
• $Y_1, \cdots, Y_n$, where $Y_i = 1$ if $i$th throw is $6$ and $Y_i = 0$ otherwise.

Now observe that $$X = \sum_{i=1}^n X_i \\ Y = \sum_{i=1}^n Y_i$$

And we have \begin{align} &\mathbb{E}[XY] \\ =\ &\mathbb{E}[(X_1 + \cdots + X_n)(Y_1 + \cdots + Y_n)] \\ =\ &\mathbb{E}[\sum_{i=1}^n X_iY_i + \sum_{i=1}^n\sum_{j\neq i}X_iY_j] \\ =\ &\mathbb{E}[\sum_{i=1}^n\sum_{j\neq i}X_i Y_j]\\ =\ &\sum_{i=1}^n\sum_{j\neq i}\mathbb{E}[X_iY_j] \\ =\ &\sum_{i=1}^n\sum_{j\neq i} \frac{1}{36} \\ =\ &\frac{n(n-1)}{36} \end{align}

In the third equality, since $i$th throw can not be $1$ and $6$ at the same time, we must have $X_iY_i = 0$, thus we can ignore those terms here.

Let $X_{i}$ take value $1$ if the $i$-th throw produces a one and value $0$ otherwise.

Let $Y_{i}$ take value $1$ if the $i$-th throw produces a six and value $0$ otherwise.

Then $$XY=\sum_{i=1}^{n}X_{i}\times\sum_{j=1}^{n}Y_{j}=\sum_{i=1}^{n}\sum_{j=1}^{n}X_{i}Y_{j}$$ and consequently:

$$\mathbb{E}XY=\sum_{i=1}^{n}\sum_{j=1}^{n}\mathbb{E}X_{i}Y_{j}$$ If $i\neq j$ then $X_i$ and $Y_j$ are independent, and evidently $X_iY_i=0$.

Can you take it from here?

A more direct route to find $\text{Cov}\left(X,Y\right)$: $$\text{Cov}\left(X,Y\right)=\text{Cov}\left(\sum_{i=1}^{n}X_{i},\sum_{j=1}^{n}Y_{j}\right)=\sum_{i=1}^{n}\sum_{j=1}^{n}\text{Cov}\left(X_{i},Y_{j}\right)$$

If $i\neq j$ then $\text{Cov}(X_i,Y_j)=0$ because $X_i$ and $Y_j$ are independent. So what remains is: $$\text{Cov}\left(X,Y\right)=\sum_{i=1}^{n}\text{Cov}\left(X_{i},Y_{i}\right)=n\text{Cov}\left(X_{1},Y_{1}\right)$$