STAT 111

STAT 111
Chapter 7
Functions of Random
Variables
Frequently, in statistics, one encounters the need to derive the
probability distribution of a function of one or more random
variables. Suppose first, that X is a discrete random variable
with probability distribution fx(x) and suppose further that
Y=g(X) defines a one-to-one transformation between the
values of X and Y(this condition implies that there exists an
inverse(
function g-1 such that g-1(y)=X, which can be obtained by
solving the original defining relation for x. When considering
random variables, we usually write g-1 (Y)=X. For one-toone transformation we have the following theorem.
Note that a function Y=g(X) is a one-to-one if each value
assumed by y only a single value of X is obtained.
2
Theorem
Suppose that X is a discrete random variable with
probability distribution fx(x).
Let Y=g(X) define a one-to-one transformation between
the values of X and Y.
Then the probability distribution of Y is
ƒy ( y ) = ƒx [g-1 (y )]
3
Example
Let X be a random variable with the following distribution
x
f(x)
2
1/8
4
1/8
6
1/4
8
1/2
Find the probability distribution of the random variable Y=3X,
As X takes the values 2,4,6,8, y takes the values 6,12,18,24,
which implies that Y ,Defines a one -to-one transformation .
From Y = 3 X  g-1 (y ) =X = Y / 3
fY ( 6 ) = fx( 6 / 3 ) = fx(2) = 1 / 8
Similarly fy ( 12 ) = fx(12/3 ) = fx(4)=1/8 and so on .
The probability distribution of Y is
y
f(y)
6
1/8
12
1/8
18
1/4
24
1/2
4
Example
Let X be a geometric random variable with probability distribution
ƒx(x) = 3
( 1 ) x-1
x = 1 , 2 ,3 , …..
4
4
Find the probability distribution of the random variable Y=X2.
Y=X2 is not generally a 1-1 transformation, however if the range of X
consists only a non-negative numbers, then the transformation is
1-1 (in this example, as x takes the values 1,2,3,..., y takes 1,4,9,...)
From Y= X2 we have
X=
√ y
= g-1 (y) => ƒx ( √ y
 3  1 
) =   
 4  4 
y 1
y= 1 , 4 , 9 , ….
5
Example
Let X has the binomial random variable with probability distribution
x
ƒ(x( =
3
x
2
3
3-x
1
3
x =0,1,2,3
Find the probability distribution of the random variable Y=X2
As x takes 0,1,2,3 y takes 0,1,4,9
6
To derive the probability distribution of a function of more than one
random variables, that is, given n random variables X1,X2,...,X n and
need to find the distribution of Y=g(X1,X2,...,Xn). One
straightforward method is by using the following theorem.
Theorem
Let X1,X2,…,Xn be n random variables defined on (S,P).
Let Y=g(X1,X2,...,Xn )be a function of X1X2,...,Xn and let y є R(Y(.
Then
f(y) = P(Y = y)= ∑ f ( x1 , x2 …,xn)
x1 , x2 ,… , xn
Where
Ay = { (x1 , x2 , … , xn ) є R ( X ) : g ( x1 , x2 ,… , xn ) = y }
7
Example Let the joint distribution of X and Y be given as
xy
f(x,y) = —
36
x = 1,2,3
and
Find
1.The probability mass function of Z =
y = 1,2,3
X
Y
Solution:
The first step is to determine the range of the random ,
variable involved, i.e as x,y
X
takes the values x=l,2,3, y= 1,2,3 , then Z =
Y
takes the values 1,
1 , 1 , 2 ,1 , 2 , 3 , 3 , 1
2
3
3
2
8
Then P( Z = 1 ) = P ( X = 1 , Y = 3 ) = 3 = 1
3
36 12
P ( Z = 1 ) = P ( X = 1 ,Y = 1 ) + P ( X = 2 , Y = 2 ) +P ( X = 3 ,Y = 3 ) = 14
36
= 7
18
and so on
Z
1/3
1/2
2/3
1
3/2
2
3
Sum
f(z)
1/12
1/18
1/6
7/18
1/6
1/18
1/12
1
9

2- The probability mass function of M=XY
m
1
2
3
f(m)
1/36
4/36
6/36
4
6
9
4/36 12/36 9/36
Sum
1
3- The probability mass function of T=X+Y
t
2
3
4
5
6
Sum
f(t)
1/36
4/36
10/36
12/36
9/36
1
10
4- The probability mass function of U=X – Y
u
-2
-1
0
1
2
Sum
f(u)
3/36
8/36
14/36
8/36
3/36
1
11
Sum of Independent Random Variables
*. Let X and Y be independent random variables where
X~bin(n,p) and Y~bin(m,p), Then the distribution of X+Y is
bin(n+m,p),
*. Let X and Y be independent random variables where X~P(λ) and
Y~P(ϒ(, Then the distribution of X+Y is P(λ+ϒ).
12
Example 1
Let X and Y be independent random variables
where X~bin(2,0.6) and Y~bin(5,0.6), let Z=X+Y
1.P(Z>3)
2.P(3<Z<5)
3.fz(2)=P(Z=2)
4.P(Z<5)
13
Example
Let X and Y be independent random
variables where X~Poisson(3) and
Y~Poisson(2), let W=X+Y
Find:
P(W<2)
P(3<W<5)
fw(2)=P(W=2)
14