Chapter Four 4. Functions of Random Variables
Chapter Four 4. Functions of Random Variables
Introduction
It is often the case that we know the probability distribution of the random variable X and we
are interested in determining the probability distribution of some function of X. For example,
given the distribution of X, we may be interested to determine the distribution of the mean of X.
The type of problem considered in this chapter is as follows: Given the random variable X with known
distribution and a function H, how do we find the probability distribution of a random variable
Y = H(X)? The transformation process is presented in the following diagram.
Note that Y is a real valued function of the random variable X with domain Rx and range Ry.
Thus, the function Y itself is also a random variable.
More formally, let E be an experiment, S be a sample space associated with E and X be a random
varaible defined on S. Suppose that Y = H (X) is a real valued function of X, then Y = H(X) is also
a random variable since for every s ∈ S, a value of Y is determined, say y = H(X(s)). As before,
we call Rx the range space of X, the set of all possible values of the function X. Similarly, we
define RY the range space of Y, the set of all possible values of the function Y.
Examlple
1. Let X be a random variable that represents the radius of a circle. Consider another variable Y that
represents the area of a circle. Clearly, Y is a function of X, and their functional relationship is
presented as Y=X2.
2. In standard statistical methods, the result of statistical hypothesis testing, estimation, or even statistical
graphics does not involve a single random variable but, rather, functions of one or more random variables.
As a result, statistical inference requires the distributions of these functions. For example, the use of
averages of random variables is common. In addition, sums and more general linear combinations are
important. We are often interested in the distribution of sums of squares of random variables, particularly
in the use of analysis of variance techniques.
Page 1 of 6
4.1. Equivalent events
Definition: Let C be an event associated with the range space of Y, RY, i.e. C . Moreover, let
be defined as B = {x ∶ H(x)C}. Then B and C are equivalent events. Meaning, each
and every element in C is a function of a corresponding element in B.
Note
Mathematically, if for all H(x) C, we can find event B such that B = {x Rx: H(x) C}
then BC.
When we speak of equivalent events (in the above sense), these events are associated
with different sample spaces.
Example
1. Suppose that ( ) = . Then the events ={ >2 } = { > 4 } are equivalent.
Thus, for if Y = X , then {X > 2} occurs if and only if {Y > 4}occurs.
2. Consider an experiment of tossing a coin twice. Let X be a random variable indicating a count for
heads. Let B= {1} be an event with respect to Rx. Then find an event A such that A B.
Definition: Suppose X is a random variable defined on the sample space S and Rx be its range
space. Let Y=H(X) be a random variable with range space Ry. Then for any event R , P(C) is
defined as: P(C) = P{x R : H(x) C}
In words : The probability of an event associated with the range space of Y is defined as the
probability of the equivalent event (in terms of X).
In other words, we can evaluate probabilities involving events associated with the function of the
random variable X if the p.d.f of X is known and if it is possible to determine the equivalent
event.Note that if B and C are equivalent events, then P (B) = P (C).
e -x if x 0
Example 2: Let X be a continuous random variable with p.d.f. f ( x)
0 Otherwise
X 1
Suppose that a random variable Y is defined by Y . If = {Y: Y 7}, find P(C).
2
Page 2 of 6
Solution:
It can be seen that RX= { X: X > 0} and RY= {Y: Y > 1/2}, which implies that CRY.
X 1
Y 7 7 X 15
2
1 1 3
8(x - ) if x
f ( x) 4 4 4
0 Otherwise
Remark: The other procedure for finding probabilit ies associated with Y is to find p .d.f of Y
fro m the known p .d.f of X.
If X is discrete rando m variable and Y=H(X), then it fo llows immediately that Y is also a
discrete random variable. That is, if the possible values of X are x1,x2,…,xn then the possible
values of Y are H(x1),H(x2),…,H(xn).
Example 1: Let X assumes three values: -1, 0, and 1 with probabilities 1/3, 1/2, and 1/6 respectively.
Then find the probability distributions for:
i) Y = 3X + 1
ii) Y = X3+ 5
Page 3 of 6
2. Suppose that X has the following probability distribution:
x: -2 -1 0 1 2 3 4
P(X=x): 0.1 0.2 0.1 0.1 0.1 0.2 0.2
Find the probability distribution of Y = 2X - 2
Note
It may happen that several values of X lead to the same value of Y. In other words, the relation
between X and Y may not necessarily be One-to- One, as the following examples illustrate.
Example
1. Recall the first example where X assumes three values: -1, 0, and 1. If Y = X,2 then find the possible
values and their corresponding probabilities for Y.
2
2. Consider the second example given above, and suppose that Y = X + 2. Then the possible values
of Y are 2, 3, 6, 11 and 18 with probabilities 0.1, 0.3, 0.2, 0.2 and 0.2 respectively. For example,
Y = 3 corresponds to not only one possible value in the range space of X but it refers to two possible
values, namely x = -1 and x = 1. Accordingly P(Y=3) = P(X=-1) + P(X=1) = 0.2 + 0.1
Definition
1. Suppose that X is a discrete random variable with probability function P(X=x). Then the probability
distribution of Y = H(X) is given by P(Y=y) = P(H(X) = y) = {P(X = xi)} where H(xi) = y
2. Suppose that X is a discrete random variable with probability funtion f(x). Let Y = H(X) define a
one-to-one transformation between the values of X and Y so that the equation y = H(x) can be uniquely
solved for x in terms of y, say x = w(y). Then the probability distribution of Y is g(y) = f[w(y)].
-1 0 1 2
( = ) 7 8 4 11
30 30 30 30
a) Y=X2 b)Y=2X+5
Example 2: Let X be a discrete random variable having the possible values 1, 2, 3, . . . , n, . .. and
suppose that P(X = x) = . Find the probability distribution of Y if
1
=
−1
X may assume all real values while Y is defined to be +1 if > 0 and -1 if < 0. In order to
obtain the probability distribution of Y, simply determine the equivalent event (in the range
Page 4 of 6
space Rx) corresponding to the different values of Y. In the above case, ( = 1) = ( > 0)
and ( = −1) = ( ≤ 0).
g( ) = ( = )= ( )
In this section, our interest is to determine the Probability Density Function of a function of
a continuous random variable. Let X be a continuous random variable and Y be another random
variable which is a function of X. That is Y=H(X). Moreover, assume that the random variable Y
is a continuous random variable. To find or determine the p.d.f of Y=H(X), we follow the
steps below.
x
if 0 x 2
f ( x) 2
0 Otherwise
1 if 0 x 1
Exercise: Let a rando m variable X has a densit y function f ( x) . Let
0 Otherwise
H(X)=ex. Then find the p.d.f of Y=H(X).
Solution:
Page 5 of 6
The other method of obtaining ( ).
−1 −1
( )= ( ≤ )= ≤ = ,
3 3
Where F is the cdf of X; that is
( ) = ( ≤ ).
In order to calculate the derivative of G, ( ), we use the chain rule for differentiation as
follows:
( )=
−1
( )= ( ) ; ℎ =
3
Hence
1 1 −1 1 2
( )= ( )∗ = ( )∗ =2∗ ∗ = ( − 1)
3 3 3 3 9
Theorem: Let X be a continuous random variable with pdf , where ( ) > 0 for < <
. suppose that = ( ) is a strictly monotone (increasing or decreasing) function of . Assume
that this function is differentiable ( and hence continuous) for all . Then the random variable Y
defined as = ( ) has a pdf g given by,
-1
( ) = (H (y)) ∗ H (y) ℎ H (y) = x
Example
x 0 < x < 1
1. Let X be a random variable with pdf: f(x) =
otherwise
-x
Find the pdf of Y = e