Proof:Random variables satisfy distributivity

From CS2800 wiki
If [math]X [/math], [math]Y [/math], and [math]Z [/math] are random variables on a probability measure [math](\href{/cs2800/wiki/index.php/S}{S},\href{/cs2800/wiki/index.php/Pr}{Pr}) [/math], then [math]X(Y + Z) = XY + XZ [/math].
Proof:
Choose an arbitrary [math]s \href{/cs2800/wiki/index.php/%E2%88%88}{∈} \href{/cs2800/wiki/index.php/S}{S} [/math]. We have

[math]\begin{align*} \left(X(Y + Z)\right)(s) &= X(s)\left(Y+Z\right)(s) && \href{/cs2800/wiki/index.php/%C2%B7_(random_variables)}{\text{by definition of ·}} \\ &= X(s)\left(Y(s) + Z(s)\right) && \href{/cs2800/wiki/index.php/%2B_(random_variables)}{\text{by definition of +}} \\ &= X(s)Y(s) + X(s)Z(s) && \href{/cs2800/wiki/index.php/Arithmetic}{arithmetic} \\ &= (XY)(s) + (XZ)(s) && \href{/cs2800/wiki/index.php/%C2%B7_(random_variables)}{\text{by definition of ·}} \\ &= (XY + XZ)(s) && \href{/cs2800/wiki/index.php/%2B_(random_variables)}{\text{by definition of +}} \\ \end{align*} [/math]

Thus [math]X(Y+Z) \href{/cs2800/wiki/index.php/Equality_(functions)}{=} XY + XZ [/math].