What does $E[XY]$ mean?

We should separate the meaning of $E(XY)$ from whatever devices we use to compute the expectation.

What does $XY$ mean? It is a random variable. In our particular example, imagine the following game. We roll a fair die and a fair coin. If the die shows $k$ and the coin shows Head, we get $(k)(1)$ dollars. If the die shows $k$ and the coin shows Tail, we get $(k)(0)$ dollars, that is, $0$.

The random variable $XY$ is the amount of money we get. It takes on values $0,1,2,3,\dots,6$, with various probabilities, it has a certain distribution. Then $E(XY)$ is the expected value (mean) of $XY$, in the usual sense.

In this case, $\Pr(XY=0)=\frac{1}{2}$, and $\Pr(XY=n)=\frac{1}{12}$ for $n=1,2,\dots, 6$. Now we can compute $E(XY)$. We have $$E(XY)=\frac{1}{2}(0)+\frac{1}{12}(1)+\frac{1}{12}(2)+\cdots+\frac{1}{12}(6).$$

But in this case, there is a shortcut. Since $X$ and $Y$ are independent, we have $E(XY)=E(X)E(Y)$, and therefore there is no need to find the distribution of $XY$.


$XY$ denotes a new random variable. You could call it $Z$ if you want, and work out its distribution. Then $E[XY]$ just means $E[Z]$.

So in your case, since $X$ takes the discrete uniform distribution on $\left\{1, 2, 3, 4, 5, 6\right\}$ and $Y$ takes the discrete uniform distribution on $\left\{0, 1\right\}$, the product $XY$ takes values in $\left\{0, 1, 2, 3, 4, 5, 6\right\}$. $XY$ does NOT have a uniform distribution, though. See if you can work out its distribution directly.

Hint: $$P(XY=0)=P(X=0\,\text{or}\,Y=0)=P(Y=0)=\frac{1}{2}$$ And $$P(XY=1)=P(X=1\,\text{and}\,Y=1)=P(X=1)\cdot P(Y=1)=\frac{1}{6}\cdot\frac{1}{2}=\frac{1}{12}$$ And so on. (I've assumed $X$ and $Y$ are independent.)