2.3 Functions of Random Variables
Given a random variable X, one may generate other random variables by applying various transformations on X.
If Y = g(X) is a function of a random variable X, then Y is also a random variable, since it provides a numerical value for each possible outcome.
This is because every outcome in the sample space defines a numerical value x for X and hence also the numerical value y = g(x) for Y.
If X is discrete with PMF \(p_X\), then Y is also discrete, and its PMF \(p_Y\) can be calculated using the PMF of X.
In particular, to obtain \(p_Y (y)\) for any y, we add the probabilities of all values of x such that \(g(x) = y\) :
$$p_Y(y) = \sum_{\text{{x | g(x) = y}}}p_X(x).$$
Example 2.1. Let Y = IXI and let us apply the preceding formula for the PMF py to the case where
The possible values of Y are y = 0, 1, 2, 3, 4.
To compute \(p_Y (y)\) for some given value y from this range. we must add px (x) over all values x such that \(|x| = y\).
In particular. there is only one value of X that corresponds to y = 0. namely x = 0.
Thus, $$p_Y(0) = p_X(0) = \frac{1}{9}.$$
Also, there are two values of X that correspond to each y = 1, 2, 3, 4. so for example,
$$p_Y(1) = p_X(-1) + p_X(1) = \frac{2}{9}.$$
Thus, the PMF of Y is
References
Bertsekas, D. P., Tsitsiklis, J. N. (2008). Introduction to Probability Second Edition. Athena Scientific.