Tutorial 4 Expected Value, Variance and Moment Generating Function
Tutorial 4 Expected Value, Variance and Moment Generating Function
1
Expected Value
If X is a discrete random variable having a
probability mass function p(x), the expectation or
the expected value of X, is defined by
E[ X ] xp( x)
x: p ( x ) 0
E[X] is a weighted average of the possible
values that X can take on, each value being
weighted by the prob. that X assumes it.
2
Expected Value
If X is a continuous random variable having a
probability density function f(x), then the
expected value of X is defined by
E[ X ] xf ( x)dx
k 0 ( k )!
e e 4
Example 2
Calculate the expectation of a random variable
uniformly distributed over (a, b).
b
x
E[ X ] dx
a
ba
b a 2 2
2(b a )
ab
2
The expected value of a random variable uniformly
distributed over the interval (a, b) is just the
midpoint of the interval. 5
Variance
If X is a random variable with mean ,
then the variance of X is defined by
Var ( X ) E[( X ) ]
2
6
Variance
Var ( X ) E[ X ] ( E[ X ])
2 2
Var ( X ) E[( X ) 2 ]
( x ) 2 p ( x)
x
( x 2 2 x 2 ) p ( x )
x
x 2 p ( x) 2 xp( x) 2 p ( x)
x x x
E[ X 2 ] 2 2 2
E[ X 2 ] 2
7
Variance
8
Example 3
Calculate Var(X) when x represents the
outcome when a fair die is rolled.
7
E[ X ]
2
E[ X 2 ]
1 2 1 2 1 2 1 2 1 2 1
1( ) 2 ( ) 3 ( ) 4 ( ) 5 ( ) 6 ( )
6 6 6 6 6 6
91
6
91 7 2 35
Var ( X ) ( )
6 2 12
9
Moment Generating Functions
or
e tx f ( x)dx if X is continuous with density f(x)
10
Moment Generating Functions
Then,
d
M' (t) E etX
dt
d tX
E e
dt
E Xe tX
M' (0) E Xe ( 0 ) X E[X]
11
Moment Generating Functions
d
Similarly, M' ' (t) M ' (t )
dt
d
E[ XetX ]
dt
d
E[ ( XetX )]
dt
E X 2 etX
M' ' (0) E X 2 e ( 0 ) X E[X 2 ]
12
Moment Generating Functions
13
Example 4
Binomial Dist. (n,p)
M (t ) E e tX
n
n k
e p (1 p ) n k
tk
k 0 k
n
n t k
( pe ) (1 p )
nk
k 0 k
( pe 1- p)
t n
n 1
M ' (t ) n( pe 1- p)
t
pe t
14
Example 4 (con’t)
M ' (t ) n( pet 1- p) n 1 pet
M ' ' (t )
n(n 1)( pe t 1- p) n 2 ( pe t ) 2 n( pe t 1- p) n 1 pe t
Mean = M’(0) = np