# Thread: Expected value of a product of RV's

1. ## Expected value of a product of RV's

Hi. I need some help verifying something.

Let X, Y be discrete random variables such that 1<=X,Y<=10. Then:

$\displaystyle \mathbb{E}[XY]=\sum_{1\leq x,y\leq10}xyP(X=x\cap Y=y)$

2. Originally Posted by JoachimAgrell
Hi. I need some help verifying something.

Let X, Y be discrete random variables such that 1<=X,Y<=10. Then:

$\displaystyle \mathbb{E}[XY]=\sum_{1\leq x,y\leq10}xyP(X=x\cap Y=y)$

This is correct; it follows from $\displaystyle \displaystyle \mathbb{E}[X]=\sum xP(X=x)$ and the fact that XY is a discrete random variable.

Note that $\displaystyle P(XY=2) = P(X=1\cap Y=2) + P(X=2\cap Y=1)$ and that $\displaystyle 2P(XY=2) = 2P(X=1\cap Y=2) + 2P(X=2\cap Y=1)$, illustrating that the sum you wrote down is in fact equal to $\displaystyle \sum zP(XY=z)$ where I wrote z to avoid confusion; z ranges over the values that XY can take on.

3. Originally Posted by undefined
This is correct; it follows from $\displaystyle \displaystyle \mathbb{E}[X]=\sum xP(X=x)$ and the fact that XY is a discrete random variable.

Note that $\displaystyle P(XY=2) = P(X=1\cap Y=2) + P(X=2\cap Y=1)$ and that $\displaystyle 2P(XY=2) = 2P(X=1\cap Y=2) + 2P(X=2\cap Y=1)$, illustrating that the sum you wrote down is in fact equal to $\displaystyle \sum zP(XY=z)$ where I wrote z to avoid confusion; z ranges over the values that XY can take on.
That makes sense. Thank you.

But generally is it true that given a discrete random vector X and the set S of its values, $\displaystyle \mathbb{E}[f(\mathbf{X})]=\sum_{\mathbf{x}\in S}f(\mathbf{x})P(\mathbf{X}=\mathbf{x})$?

4. Originally Posted by JoachimAgrell
That makes sense. Thank you.

But generally is it true that given a discrete random vector X and the set S of its values, $\displaystyle \mathbb{E}[f(\mathbf{X})]=\sum_{\mathbf{x}\in S}f(\mathbf{x})P(\mathbf{X}=\mathbf{x})$?
Coincidentally, I just came across the formal statement of this recently in another thread on interestingly named math concepts. It is true, and sometimes known as the law of the unconscious statistician.

This isn't your question, but a word of caution on something semi-related: It is not correct to do things like E(|X-Y|) = |E(X)-E(Y)|.