Computing cov of 2 binomial random variables we drop a normal cube 20 times.
X - is the number of even values
Y - is the number of times the cube landed on 3.
As much as I understand:
$$X\sim B(20, \frac{1}{2}) \\Y \sim B(20, \frac{1}{6} )$$
How can I compute $E[XY]$?
 A: The problem
Let $Z = (1,2,3,4,5,6)$ denote the sides of the cube (die).
For a sample of size $n=1$:

*

*If $Z=1$, then:  $(X=0, Y=0)$

*If $Z=2$, then:  $(X=1, Y=0)$

*If $Z=3$, then:  $(X=0, Y=1)$

*If $Z=4$, then:  $(X=1, Y=0)$

*If $Z=5$, then:  $(X=0, Y=0)$

*If $Z=6$, then:  $(X=1, Y=0)$
Note that there are only 3 possible $(X,Y)$ outcomes. In summary, given a sample of size $n=1$, the joint pmf of $(X,Y)$, say $f(x,y)$, is:

(source: tri.org.au)
Here are two alternative ways of proceeding, for any general number of draws $n$:
Method 1: Moments of moments
Let $(X_1, Y_1), \dots, (X_n,Y_n))$ denote a sample of size $n$ (i.e. $n$ throws). Using power sum notation, let $s_{r,t}=\sum _{i=1}^n X_i^r Y_i^t$. Then, our problem is to find:
$$E\big[{\sum_{i=1}^n X_i} {\sum_{i=1}^n Y_i} \big] = E\big[s_{1,0} s_{0,1}\big]$$
This is just a moments of moments problem. In particular, we seek the 1st Raw Moment of $(s_{1,0} s_{0,1})$, and the solution is immediately given by:

(source: tri.org.au)
for any distribution whose moments exist, where I am using the RawMomentToRaw function from the mathStatica software package. The solution is expressed in terms of the raw product moments of the population $\acute{\mu}_{r,s}=E\left[X^r Y^s\right]$. In the case of our joint pmf $f(x,y)$ given above, the solution is:

(source: tri.org.au)
... or manually:  $\acute{\mu}_{1,0}=E\left[X \right] = \frac12$, and $\acute{\mu}_{0,1}=E\left[Y \right] = \frac16$, and $\acute{\mu}_{1,1}=E\left[X Y\right] = 0$, and substitute into sol to yield:  $\frac{1}{12} n (n-1)$.
Method 2: pgf method
Given joint pmf $f(x,y)$ above, the bivariate probability generating function (pgf) $E[t_1^X t_2^Y]$ is:

(source: tri.org.au)
where I am using the Expect function from mathStatica to automate (but easy enough by hand too).
For a sample of size $n$:
Consider now a sample of size $n$. The joint variables of interest are now: $(\sum_{i=1}^n X_i, \sum_{i=1}^n Y_i)$. Then, the bivariate pgf for the sum $S$, given $n$ throws, is:
$$\begin{align*}\displaystyle \text{pgfS} &=  E\big[t_1^{\sum_{i=1}^n X_i} t_2^{\sum_{i=1}^n Y_i}\big] 
\\&=  E\big[(t_1^{X_1} t_2^{Y_1}) (t_1^{X_2} t_2^{Y_2})  \dots  (t_1^{X_n} t_2^{Y_n})\big]  
\\&=  E\big[t_1^{X_1} t_2^{Y_1} \big] E\big[t_1^{X_2} t_2^{Y_2} \big] \times \dots \times E\big[t_1^{X_n} t_2^{Y_n} \big]  \quad \quad \text{          (since } (X_i,Y_i) \text{ is independent of } (X_j,Y_j) )
\\ &= 6^{-n} (2 + 3t_1 + t_2)^n \quad  \quad \quad \quad \quad \quad \text{(by identicality) }\end{align*}$$
We can use the pgf as a factorial moment generating function which provides an immediate solution, namely that:
$$E\big[{\sum_{i=1}^n X_i} {\sum_{i=1}^n Y_i} \big] = \frac{\partial ^{2} pgfS}{\partial t_1 \partial t_2}|_{\overset{\rightharpoonup }{t}=\overset{\rightharpoonup }{1}} = \frac{1}{12} n (n-1)$$
In the case of $n = 20$, the answer is thus:  $\frac{95}{3}$.
Notes

*

*As disclosure, I should add that I am one of the authors of the software used above.

A: Let $X_k$ be the number of even numbers appearing on the $k$th trial, so that
$$
X_k=\begin{cases} 1 & \text{with probability }1/2, \\ 0 & \text{with probability }1/2. \end{cases}
$$
Let $Y_k$ be the number of $3$s appearing on the $k$th trial, so that
$$
Y_k=\begin{cases} 1 & \text{with probability }1/6, \\ 0 & \text{with probability }5/6. \end{cases}
$$
Then $X_kY_k$ is always $0$, since one always gets either a non-even number or a non-$3$.  So
$$
\operatorname{cov}(X_k, Y_k) = \mathbb E(X_k Y_k) - \mathbb E(X_k)\mathbb E(Y_k) = 0 - \frac 1 2 \cdot \frac 1 6 = -\frac{1}{12}.
$$
Since the $20$ trials are independent, we have
$$
\operatorname{cov}(X,Y)=\operatorname{cov}\left(\sum_{k=1}^{20}X_k, \sum_{k=1}^{20} Y_k\right) = \sum_{k=1}^{20} \operatorname{cov}(X_k , Y_k) = 20\cdot\left(-\frac{1}{12}\right).
$$
So
$$
\frac{-5}{3}=\frac{-20}{12}=\operatorname{cov}(X,Y)=\mathbb E(XY) - \mathbb E(X)\mathbb E(Y) = \mathbb E(XY) - 10\cdot\frac{20}{6}.
$$
From that you can deduce $\mathbb E(XY)$.  But if your purpose is just to find $\operatorname{cov}(X,Y)$, I'd do it the way I did it above rather than by any method that relies on finding $\mathbb E(XY)$.
