> [!NOTE] Theorem > Let $(\Omega, \mathcal{F}, \mathbb{P})$ be a [[Probability Space|probability space]]. Let $X,Y$ be [[Discrete random variables|discrete real-valued random variables]] on $(\Omega, \mathcal{F}, \mathbb{P}).$ Let $p_{X,Y}$ denote the *[[Joint Probability Mass Function of Discrete Real-Valued Random Variables|joint probability mass function]]* of $X$ and $Y.$ Let $g:\mathbb{R}^{2}\to \mathbb{R}$ be a [[Real-Valued Function on Real n-Space (Multivariable Function)|real-valued function]]. Then $g(X,Y)$ is also a discrete real-valued random variable on $(\Omega, \mathcal{F}, \mathbb{P})$ and its [[Expectation of Discrete Real-Valued Random Variable|expectation]] is given by $\mathbb{E}[g(X,Y)]=\sum_{x\in D_{X}}\sum_{y\in D_{Y}} g(X,Y)\cdot p_{X,Y}(x,y)$if this some converges absolutely, and is undefined if not. The sets $D_{X}$ and $D_{Y}$ denote the [[Discrete Support of Distribution of Discrete Real-Valued Random Variable|discrete supports]] of $X$ and $Y$ respectively. **Proof**: Let $Z=g(X,Y)$. Then by [[Real-Valued Function of Discrete Real-Valued Random Variables]], $Z$ is indeed a discrete real-valued random variable on $(\Omega, \mathcal{F}, \mathbb{P}).$ Let $z \in \mathbb{R}.$ Then $\begin{align} \mathbb{P}(Z=z) &= \mathbb{P}(g(X,Y)=z) \\ &= \mathbb{P}((X,Y) \in g^{-1}(z)) \\ &= \sum_{(x,y) \in g^{-1}(z) \cap D} \mathbb{P}(X=x,Y=y) \end{align}$where $D= \{ (x,y): p_{X,Y} > 0 \}.$ The support of $Z$ is given by $D_{Z}=g(D)$ - the [[Image of a set under a function|image]] of $D$ under $g$. Finally $\begin{align} \mathbb{E}[Z] &= \sum_{z \in D_{Z}} z \cdot \mathbb{P}(Z=z) \\ &= \sum_{z \in D_{Z}}\; \sum_{(x,y) \in g^{-1}(z) \cap D} z \cdot \mathbb{P}(X=x,Y=y) \\ &= \sum_{z \in D_{Z}} \; \sum_{(x,y) \in g^{-1}(z) \cap D} g(x,y) \cdot \mathbb{P}(X=x,Y=y) \\ &= \sum_{(x,y) \in D} g(x,y) \cdot \mathbb{P}(X=x,Y=y) \\ &= \sum_{x \in D_{X}} \sum_{y\in D_{Y}} g(x,y) \cdot \mathbb{P}(X=x, Y=y) \end{align}$and the sum [[Convergent Real Series|converges absolutely]] iff $Z$ is [[Integrable Discrete Real-Valued Random Variable|integrable]]. This concludes the proof. # Applications By [[Expectation of Discrete Real-Valued Random Variable is Linear]], for all $a,b\in \mathbb{R},$ $\mathbb{E}[aX+bY]=a\mathbb{E}[X]+ b\mathbb{E}[Y].$ **Multivariate Discrete Real-Valued Random Variables**: Note this result can be inductively applied to multivariate discrete real-valued random variables. Thus, for example, $\mathbb{E}[aX+bY+cZ]=a\mathbb{E}[X]+b\mathbb{E}[Y]+c\mathbb{E}[Z].$