TITLE: E[XY] from table
QUESTION [6 upvotes]: This is an example from a book that I dn't really understand.
      X=1 | X=2
Y=3 | 0.3 | 0.1
Y=6 | 0.1 | 0.5

$$E(XY)=\sum_{all\;y}\sum_{all\;x}xyp_{x,y}(x,y)=8.1$$
I can't grasp how this dubble sum works.
I thought it was something lke this:
First I take the sum off all y $3*(0.3+0.1)+6*(0.1+0.5)=4.8$ and then I take the sum of all x $1*(0.3+0.1)+2*(0.1+0.5)=1.6$ then i take $x*y = 7.68$.
Clearly I was wrong. And honestly I don't even know what $p_{x,y}(x,y)$ means.

REPLY [8 votes]: You take all possible pairs $(x,y)$, and for each pair, you multiply their product $xy$ by the probability $p_{X,Y}(x,y)$ of this pair occuring, and then sum up the results.
This also answers what the meaning of $p_{X,Y}(x,y)$ is: It is the joint probability of obtaining the values $X=x$ and $Y=y$, so for instance, $p_{X,Y}(1,3) = 0.3$, as read from your table.
So it turns out that
$E[XY] = (1\cdot 3)\cdot 0.3 + (2\cdot 3)\cdot 0.1 + (1\cdot 6)\cdot 0.1 + (2\cdot 6)\cdot 0.5.$