38.8. MOMENT GENERATING FUNCTIONS 789
Then M′ (t) = npet (q+ pet)n−1 . Then let t = 0 and you get M′ (0) = np which is E (X).Also
M′′ (t) = npet (q+ pet)n−2 (q+npet)so E
(X2)= np(q+np) .
Recall the following definition.
Definition 38.8.3 The variance of X is defined as E((X−E (X))2
). The mean is defined
as E (X).
This is a measure of how spread out the distribution is.
Example 38.8.4 Find the variance of X if X is a binomial random variable.
Note that in general,
E((X−E (X))2
)= E
(X2−2XE (X)+E (X)2
)= E
(X2)−2E (X)E (X)+E (X)2
= E(X2)−E (X)2
Thus the variance of X for X a binomial random variable is np(q+np)− (np)2 = npq.
Example 38.8.5 Let X be normally distributed with parameters µ,σ2. Find the mean andvariance. In fact, show that the mean is µ and the variance is σ2. Determine the momentgenerating function.
This will be done by using a moment generating function as above. For X normallydistributed,
M (t)≡ E(etX)= ∫ ∞
−∞
1√2πσ
e−(x−µ)2
2σ2 etxdx
=1√
2πσ
∫∞
−∞
exp(− 1
2σ2
((x−(µ + tσ2))2−
(t2
σ4 +2tσ2
µ)))
dx
after simplification and completing the square. Thus this equals
exp(
12
t2σ
2 +µt)
1√2πσ
∫∞
−∞
exp(− 1
2σ2
((x−(µ + tσ2))2
))dx
Change the variable in that integral on the right. Let
1√2σ
(x−(µ + tσ2))= u
so 1√2σ
dx = du. Then the expression becomes
exp(
12
t2σ
2 +µt)
1√2πσ
∫∞
−∞
exp(−u2)dx
√2σ
= exp(
12
t2σ
2 +µt)= M (t) (38.2)