> [!NOTE] Theorem > Let $X$ be a [[Discrete random variables|discrete real-valued random variable]]. Let $g:\mathbb{R}\to \mathbb{R}$ be a [[Real Function|real-valued function]]. Then $g(X)$ is also a discrete real-valued random variable and its [[Expectation of Discrete Real-Valued Random Variable|expectation]] is given by $\mathbb{E}[g(X)]= \sum_{x\in D_{X}}g(x)\cdot p_{X}(x),$where $p_{X}$ denotes the [[Probability Mass Function of Discrete Real-Valued Random Variable|probability mass function]] of $X$ and $D_{X}$ denotes its [[Discrete Support of Distribution of Discrete Real-Valued Random Variable|(discrete) support]]. **Proof**: Note by [[Real-Valued Function of Discrete Real-Valued Random Variables]], $g(X)$ is indeed a discrete real-valued random variable. Using [[Expectation of Real-Valued Function of Bivariate Discrete Real-Valued Random Variable]], If we take $Y=0$ and apply this theorem with $\tilde{g}(x,y)=g(x)$, we get $\begin{align} \mathbb{E}[X] &=\mathbb{E}[\tilde{g}(X,Y)] \\ &= \sum_{x \in D_{X}} \sum_{y \in D_{Y}} \tilde{g}(x,y) \cdot \mathbb{P}(X=x,Y=y) \\ &= \sum_{x \in D_{x}} g(x) \cdot \mathbb{P}(X=x) \end{align}$and the sum converges absolutely iff $\mathbb{E}[x]$ is defined.