Ie265 8 241116 182540

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

IE 265

• Functions of Random Variables


2

Discrete function of a discrete RV


• Suppose discrete random variable (RV) X has pmf p(x).
Given a mapping from X to discrete RV Y, Y = H(X), how
can we find the pmf of Y?

x1  p ( x1 )  p ( x 2 ), y  y1
x2 y1 
 p ( x 3 )  p ( x 5 ), y  y2
x3 p( y)  
y2 y  y3
 p ( x 4 ),
x4 y3  0 , otherwise
x5
3

Discrete function of a discrete RV


• Ex: Given the pmf of X below, find the pmf of
Y  H ( X ) | X  2 |

1 / 8, x0

3 / 8, x 1

p ( x )   3 / 8, x2
1 / 8, x3

 0, otherwise
4

Discrete function of a continuous RV


• Suppose continuous RV X has pdf f(x). Given a mapping
from X to discrete RV Y, Y = H(X), how can we find the
pmf of Y? x
2
  f ( x ) dx , y  y1
 x1
x4  x3
 f ( x ) dx ,
p ( y )   x2
y3  y  y2
x3
x2 y2  x4

  f ( x ) dx , y  y3
y1
x1
 x3
 0 , otherwise
5

Discrete function of a continuous RV


 e  x , x0
• Ex: Given the pdf of X, f ( x )  
0, x0

0, X  1/ 
find the pmf of Y  H ( X )  
1, X  1/ 
6

Continuous function of a continuous RV


Suppose continuous RV X has pdf f(x). Given a continuous
mapping, Y = H(X), how can we find the pdf of Y (which is
naturally continuous)?

Procedure:
1. Find the cdf of Y, F(y), using the mapping and f(x).
2. Differentiate F(y) to find f(y).
3. Find the range of Y.
7

Continuous function of a continuous RV


 x / 8, 0 x4
• Ex: Given the pdf of X, f ( x )  
0, otherwise

find the pdf of Y  H ( X )  2 X  8


8

Continuous function of a continuous RV


• Theorem: If X is a continuous RV with pdf f(x) > 0 for
a < x < b, and if y = H(x) is a continuous strictly increasing
or strictly decreasing function of x, then the RV Y = H(X)
has pdf
dx
f ( y)  f ( x)
dy

with x=H-1(y) expressed in terms of y.

The theorem, which is valid for the underlined special


case of H(X), eliminates the need to find F(y) in step 1 of
the procedure (particularly useful when integration is
difficult).
9

Continuous function of a continuous RV


 x / 8, 0 x4
• Ex: f ( x )  
0, otherwise

Y  H ( X )  2 X  8 is a strictly increasing function of X


10

Expected value of a function of a RV


Theorem: If h(x) is a real valued function of x
• Discrete case: If X has pmf p(x), then
E [ h ( X )]   h ( x ) p ( x )
x

• Continuous case: If X has pdf f(x), then



E [ h ( X )]   h ( x ) f ( x ) dx

11

Expected value of a function of a RV


• Ex: The # of defectives in a batch of parts has pmf

 0 . 3, x 1
 0 . 5, x2

p( x)  
 0 .2 , x3
 0 , otherwise

If the cost of having x defectives is y = h(x) = 2x2 + 1, what


is the expected cost of defectives?
12

Expected value of a function of a RV


1 x / 2
 e , x0
• Ex: Given the pdf of X, f ( x )   2
 0 , x0

find the expected value of Y  h ( X )  5 X  3


13

Properties of mean and variance


• For any random variable X and H(X) = aX + b, where a
and b are any constants:
1. E ( aX  b )  aE ( X )  b
Proof: E ( aX  b )   ( ax  b ) p ( x )
x
(similar for
  axp ( x )   bp ( x ) continuous
x x

 a  xp ( x )  b  p ( x )
case)
x x

 aE ( X )  b

Hence E(b) = b, E(aX) = aE(X).


14

Properties of mean and variance


2. Var ( X )  E ( X 2 )  [ E ( X )] 2
Proof: Var ( X )   [ x  E ( X )] 2 p ( x )
x

   
2 2
{ x 2 xE ( X ) [ E ( X )] } p( x)
x

  x 2 p ( x )  2 E ( X )  xp ( x )  [ E ( X )] 2  p ( x )
x x x

E(X 2) E(X ) 1
 E ( X 2 )  [ E ( X )] 2
15

Properties of mean and variance


3. Var ( aX  b )  a Var ( X )
2

Proof: Var ( aX  b )  E {[( aX  b )  E ( aX  b )] 2 }


 E {( aX  b ) 2  2 ( aX  b ) E ( aX  b )  [ E ( aX  b )] 2 }
( 2 aX  2 b )[ aE ( X )  b ] [ aE ( X )  b ] 2
 E {a 2 X 2  2 abX  b 2
 2 a 2 XE ( X )  2 abX  2 abE ( X )  2 b 2
 a 2 [ E ( X )] 2  2 abE ( X )  b 2 }
 E {a 2 [ X 2  2 XE ( X )  ( E ( X )) 2 ]}
 a 2 E {[ X  E ( X )] 2 }
 a 2Var ( X )
16

Properties of mean and variance


If X and Y are two independent random variables:
4. E ( X  Y )  E ( X )  E (Y )
5. Var ( X  Y )  Var ( X )  Var (Y )
17

Properties of mean and variance


4 x 3 , 0  x 1
• Ex: f ( x )  
0, otherwise

a) Find the variance of X using property 2.


b) Find the expected value and variance of Y = 2X + 3.
18

Moment generating function


• The rth moment of random variable X taken about the
origin is E(Xr) (expected value of the rth power of X).

• Moments are useful in calculating distribution


characteristics such as mean and variance, particularly
when closed form of a summation or integration cannot be
obtained, e.g.
  E ( X ) first moment
 2  Var ( X )  E ( X 2 )  [ E ( X )] 2 second moment is used
19

Moment generating function


• Moment generating function of X, E(etX), packages all
the moments of a random variable in one simple
expression
M (t )  E ( e tX )   p ( x ),
tX
e if X is discrete
x

  f ( x ) dx ,
tX
e if X is continuous


• M(t) is used to find moments of X with the help of Taylor


series expansion

(tX ) i t2X 2 t3X 3 tr X r
e tX    1  tX    
i 0 i! 2! 3! r!
20

Moment generating function


t2 t3 tr
M (t )  E ( e tX )  1  tE ( X )  E(X 2)  E(X 3)   E(X r ) 
2! 3! r!

dM 2t 3t 2 rt r 1
 E(X )  E(X ) 2
E(X )  
3
E(X r )   E(X )
dt t 0 2! 3! r!

d 2M 6t r ( r  1)t r  2
 E(X ) 
2
E(X )  
3
E(X r )   E(X 2)
dt 2 t 0
3! r!

d rM
 E(X r )
dt r t 0
21

Moment generating function


 n  x n x

   p (1  p ) , x  0,1, 2,  , n
• Ex: p ( x )   x 

0, otherwise

Find Var(X) using moment generating function.


22

Moment generating function


• Ex: An experiment has two outcomes such that
P (success )  p and P ( failure )  1  p

1, if outcome is success P ( X  1)  p


X 
0, if outcome is failure P ( X  0)  1  p

Find Var(X) using moment generating function.

You might also like