# Expectation of Function of Joint Probability Mass Distribution

## Theorem

Let $\left({\Omega, \Sigma, \Pr}\right)$ be a probability space.

Let $X$ and $Y$ be discrete random variables on $\left({\Omega, \Sigma, \Pr}\right)$.

Let $E \left({X}\right)$ be the expectation of $X$.

Let $g: \R^2 \to \R$ be a real-valued function

Let $p_{X, Y}$ be the joint probability mass function of $X$ and $Y$.

$\displaystyle E \left({g \left({X, Y}\right)}\right) = \sum_{x \mathop \in \Omega_X} \sum_{y \mathop \in \Omega_Y} g \left({x, y}\right) p_{X, Y} \left({x, y}\right)$

whenever the sum is absolutely convergent.

## Proof

Let $\Omega_X = \operatorname{Im} \left({X}\right) = I_X$ and $\Omega_Y = \operatorname{Im} \left({Y}\right) = I_Y$.

Let $Z = g \left({X, Y}\right)$.

Thus $\Omega_Z = \operatorname{Im} \left({Z}\right) = g \left({I_X, I_Y}\right)$.

So:

 $\ds E \left({Z}\right)$ $=$ $\ds \sum_{z \mathop \in g \left({I_X, I_Y}\right)} z \Pr \left({Z = z}\right)$ $\ds$ $=$ $\ds \sum_{z \mathop \in g \left({I_X, I_Y}\right)} z \sum_{ {x \mathop \in I_X, y \mathop \in I_Y} \atop {g \left({x, y}\right) \mathop = z} } \Pr \left({X = x, Y = y}\right)$ Probability Mass Function of Function of Discrete Random Variable $\ds$ $=$ $\ds \sum_{x \mathop \in I_X} \sum_{y \mathop \in I_Y} g \left({x, y}\right) \Pr \left({X = x, Y = y}\right)$ $\ds$ $=$ $\ds \sum_{x \mathop \in I_X} \sum_{y \mathop \in I_Y} g \left({x, y}\right) p_{X, Y} \left({x, y}\right)$

From the definition of expectation, this last sum applies only when the last sum is absolutely convergent.

$\blacksquare$