Lecture Notes ApSc 3115/6115:
Engineering Analysis III
Chapter 7: Expectation and Variance
Version: 5/30/2014
Text Book:
A Modern Introduction to Probability and Statistics,
7 Expectation and Variance
7.1 Expected Valuesá
______________________________________
• , Random variables are complicated objects containing a lot of information on the experiments that are modeled by them.
• Typically, random variables are summarized by two numbers:
: also called , gives the center
The expected value the expectation or mean
- in the sense of average value - of the distribution of the random variable.
The variance: a measure of spread of the distribution of the random variable.
Example Expected Value: An oil company needs 10 drill bits in an exploration project. Suppose that it is known that drill bits will last # $, , or % hours with
probabilities . !Þ" !Þ(, , and !Þ# How long can we expect the exploration to
7 Expectation and Variance
7.1 Expected Valuesá
______________________________________
One drill bit lasts on average: !Þ" ‚ # !Þ( ‚ $ !Þ# ‚ % œ $Þ"hours 10 drill bits Ê Exploration can continue (on average) for hours$"
But could be as short as "! ‚ # œ #!hours or as long as "! ‚ % œ %!hours!
• Mathematical Fact: For large 8, drill bits last around 8 8 ‚ $Þ" hours.
Definition: The expectation of a discrete random variable \ taking the values + ß + ß á" # and with probability mass function is the number: À
IÒ\Ó œ + T Ð\ œ + Ñ œ + :Ð+ Ñ
3 3
3 3 3 3
7 Expectation and Variance
7.1 Expected Valuesá
______________________________________
Quick exercise 7.1: Let be the discrete random variable that takes the values ,\ " # % ), , , and , each with probability "' "Î&. Compute the expectation of .\Solution QE7.1: IÒ\Ó œ " † &" # † "& % † &" ) † "& "' † "& œ $"& œ 'Þ#Þ
• Additional Interpetation:
Expected Value is the center of gravity or the balancing point
of the probability distribution. For the random variable
associated with the drill bit, this is illustrated in Figure 7.1.
7 Expectation and Variance
7.1 Expected Valuesá
______________________________________
• How to define the expected value of a continuous random variable?
Suppose is a RV on \ Ò!ß "Ó and we want to estimate/calculate IÒ\Ó.
Step 1: Approximate by \ ]8 with outcomes !ß ß á ß8" 8"8 ß " and probabilities
T Ð] œ 5Ñ œ T Ð5 " Ÿ \ Ÿ 5Ñ Ê IÒ] Ó œ 5T Ð] œ 5ÑÞ 8 8 8 8 8 8 8 8 5œ! 8 Step 2: For large , we know 8 T Ð5"8 Ÿ \ Ÿ Ñ ¸ 0 Ð Ñ Ê85 81 85
IÒ] Ó œ 5T Ð] œ 5Ñ ¸ 5 0 Ð Ñ Þ5 8 8 8 8 8 8 8 5œ! 5œ! 8 8 1
Step 3: Now set IÒ\Ó œ
8 Ä ∞lim 5œ! 8 ! " 5 5 80 Ð Ñ8 8 œ B0 ÐBÑ.BÞ 1
7 Expectation and Variance
7.1 Expected Valuesá
______________________________________
Definition: The expectation expected value or mean of a continuousß random variable \ is the number ÀIÒ\Ó œ B0 ÐBÑ.B
∞ ∞
7 Expectation and Variance
7.1 Expected Valuesá
______________________________________
Quick exercise 7.2: Compute the expectation of a random variable that isYuniformly distributed over Ò#ß &Ó.
Solution QE 7.2: 0 Ð?Ñ œ ß ? − Ò#ß &Ó"$ and elsewhere. Hence,!
IÒY Ó œ ? † .? œ" " "† ? œ " ? œ #& % œ #" œ $ Þ" $ $ # ' ' ' ' # # & # # # # & &
which is the balancing point! Y µ Y Ð ß Ñ Ê IÒY Ó œα " α "# . • The expected value of a random variable may not exist!
M œ B0 ÐBÑ.B œ B0 ÐBÑ.B B0 ÐBÑ.B œ M M M !ß M !Þ
∞ ∞ !
∞ ! ∞
,
7 Expectation and Variance
7.1 Expected Valuesá
______________________________________
Example: The Cauchy distribution 0 ÐBÑ œ 1Ð"B Ñ" # ß ∞ B ∞ÞM œ B † " .B œ " Ð" B Ñ œ ∞ Ð" B Ñ # M œ B † " .B œ " Ð" B Ñ œ ∞ Ð" B Ñ # # ! ∞ # ∞ ! # ∞ ! # ! ∞ 1 1 1 1 ln ln
• The expected value may be of infinite value! When M is finite, but isM
infinite, the expected value is infinite.
Example: A distribution that has an infinite expectation the Pareto is
7 Expectation and Variance
7.2 Three Examplesá
______________________________________
\ ´ The number of weeks until success µ K/9Ð:Ñß where : œ "!%.Definition: The expectation of a geometric distribution.
\ µ K/9Ð:Ñ Ê IÒ\Ó œ 5 ‚ T Ð\ œ 5Ñ œ 5Ð" :Ñ : œ " : 5œ" 5œ" ∞ ∞ 5"
• The geometric distribution If you buy a lottery ticket every week and you have a chance of in " "!ß !!!of winning the jackpot, what is the expected
number of weeks you have to buy tickets before you get the jackpot?
Answer: "!ß !!! weeks (almost two centuries ;-) !!!).
•
5œ" 5œ"
∞ ∞
5" " 5" "
: Ð"BÑ
7 Expectation and Variance
7.2 Three Examplesá______________________________________
5œ" 5œ" ∞ ∞ 5" 5" # # 5:Ð" :Ñ œ : 5Ð" :Ñ œ : " œ : œ " Ò" Ð" :ÑÓ : :• The exponential distribution: Recall the chemical reactor example in chapter 5. X ´ Residence time in min. µ IB:Ð!Þ#&Ñ Ê ÒX Ó œ %E minutes.
Definition: The expectation of an exponential distribution.
\ µ IB:Ð Ñ Ê IÒ\Ó œ- ! ∞ B B /- .B œ "
Definition: The expectation of a normal distribution.
\ µ R Ð ß. 5#Ñ Ê IÒ\Ó œ B " / Ð Ñ .B œ .
∞
"#
B. #
7 Expectation and Variance
7.3 The change-of-variable formulaá
______________________________________
Example: Suppose a construction company builds square buildings with width and depth \ß \ µ Y Ò!ß "!Ó. Suppose we have for the price of a buildingT ÀT œ G ‚ \ ß# where is the price per square meter a constant)G Ð Þ
Annual revenue is proportional to, the average building size IÒ] Ó, where ] œ \#. Thus, we first have to determine the distribution of ] œ \#,
\ − Ò!ß "!Ó Ê ] œ \ − Ò!ß "!!ÓÞ# J ÐCÑ œ T Ð] Ÿ CÑ œ T Ð\ Ÿ CÑ œ T Ð\ Ÿ CÑ œ Cß \ µ Y Ò!ß "!ÓÞ "! # recall 0 ÐCÑ œ . J ÐCÑ œ . C œ " " œ " "
7 Expectation and Variance
7.3 The change-of-variable formulaá
______________________________________
IÒ\ Ó œ IÒ] Ó œ C " " .C œ " C.C œ #! C #! # ! ! "!! "!!
#! $
" #
C
$#
œ $$ 7
"
$
"!! ! #Conclusion: Annual Revenue ¸
$$ ‚"$ (# buildings per year) ‚ (price per 7 ÑÞ#
• Observation: \ µ Y Ò!ß "!Óß IÒ\Ó œ & IÒ\ Ó Á IÒ\Ó † IÒ\Ó œ #&7 Þ # # • Alternative Method to evaluate IÒ\ Ó À# Realize that buildings with area B#
get build with the same frequency as buildings with width Thus, recallingBÞ \ µ Y Ð!ß "!Ñ one has: IÒ\ Ó œ B 0 ÐBÑ.B œ B " .B œ "! # "! # "! # \
"! $
" "
B
$
"!œ $$ 7
"
$
#7 Expectation and Variance
7.3 The change-of-variable formulaá
______________________________________
Definition: The change of variable formula. Let be a rv and \ 1 À ‘ Ä Þ‘
\ + ß á ß + Ê IÒ1Ð\ÑÓ œ 1Ð+ ÑT Ð\ œ + Ñ œ 1Ð+ Ñ:Ð+ Ñ \ \ µ 0 Ð † Ñ Ê IÒ1Ð\ÑÓ œ 1ÐBÑ0 ÐBÑ.B discrete on continuous, " 8 3 3 3 3 3 3 ∞ ∞
Quick exercise 7.3: Let \ µ F/<Ð:ÑÞCompute IÒ# ÓÞ\
Solution QE 7.3:
T Ð\ œ !Ñ œ " :ß T Ð\ œ "Ñ œ :Þ Thus:
7 Expectation and Variance
7.3 The change-of-variable formulaá
______________________________________
• Suppose 1ÐBÑ œ +B ,ß +ß , − ‘ and is a continuous RV\ Þ IÒ1Ð\ÑÓ œ IÒ+\ ,Ó œ œ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ 1ÐBÑ0 ÐBÑ.B Ð+B ,Ñ0 ÐBÑ.B œ + B0 ÐBÑ.B , 0 ÐBÑ.B œ +IÒ\Ó ,
Same applies when is a discrete RV!\
• AnExpected value of linear transformation of random variable : \
operation that occurs very often in practice is a change of units, e.g., changing from Fahrenheit to Celsius, from minutes to hours, etc.
7 Expectation and Variance
7.4 Varianceá
______________________________________
• Suppose you are offered an opportunity for an investment at the cost of $&!!
whose expected return is $500. Seems an OK opportunity.
What if we have for payoff $ %, $5 % ? What if we have for payoff $ %, $1000 % ?
] À T Ð] œ %&!Ñ œ &! T Ð] œ &!Ñ œ &! ] À T Ð] œ !Ñ œ &! T Ð] œ Ñ œ &!
" " "
# # #
Clearly, the spread (around the mean) makes you feel different. Usually this is measured by the expected squared deviation from the mean.
Definition: The variance Z +<Ð\Ñof a random variable is the number\ À
Z +<Ð\Ñ œ IÒÐ\ IÒ\ÓÑ Ó œ IÒ\ Ó ÐIÒ\ÓÑ# # #
Note that: Z +<Ð\Ñ !Þ
7 Expectation and Variance
7.4 Varianceá
______________________________________
Quick exercise 7.4:Calculate the mean and variance for and ]" ]#Payoff $ %, $5 % ?
Payoff $ %, $1000 % ?
] À T Ð] œ %&!Ñ œ &! T Ð] œ &!Ñ œ &! ] À T Ð] œ !Ñ œ &! T Ð] œ Ñ œ &!
" " "
# # #
Solution QE 7.4:
IÒ] Ó œ %&! † T Ð] œ %&!Ñ &&! † T Ð] œ &!Ñ œ %&! &&! œ &!! # IÒ] Ó œ ! † T Ð] œ !Ñ "!!! † T Ð] œ "!!!Ñ œ ! "!!! œ &!! # " " " # " " $ $5 $ $ $ $
Z +<Ð] Ñ œ Ð%&! &!!Ñ † T Ð] œ %&!Ñ Ð&&! &!!Ñ † T Ð] œ &!Ñ œ #&!! #&!! œ #&!! Ê W>ÞH/@Ð\Ñ œ &!Þ
# Z +<Ð] Ñ œ Ð! &!!Ñ † T Ð] œ !Ñ Ð"!!! &!!Ñ † T Ð] œ "! " # " # " # # " # " $ $5 $ $ $ !!Ñ
7 Expectation and Variance
7.4 Varianceá
______________________________________
Z +<Ð\Ñ œ IÒÐ\ IÒ\ÓÑ Ó œ IÒ\ #IÒ\Ó † \ ÐIÒ\ÓÑ Ó œ IÒ\ Ó IÒ#IÒ\Ó † \Ó IÒÐIÒ\ÓÑ Ó
IÒ\Ó † IÒ\Ó ÐIÒ\ÓÑ œ IÒ\ Ó ÐIÒ\ÓÑ
# # #
# #
# # #
œ IÒ\ Ó ##
An alternative expression for the variance: For any random variable \ À
Z +<Ð\Ñ œ IÒ\ Ó ÐIÒ\ÓÑ# #
• Variance of a normal distribution:
Definition: The expectation of a normal distribution.
7 Expectation and Variance
7.4 Varianceá
______________________________________
Recall Example : \ ´ Time a drill bit lastsÞT Ð\ œ #Ñ œ !Þ"ß T Ð\ œ $Ñ œ !Þ(ß T Ð\ œ %Ñ !Þ"Þ IÒ\Ó œ !Þ" ‚ # !Þ( ‚ $ !Þ# ‚ % œ $Þ" hours
Method 1: Z +<Ð\Ñ œ IÒ\ ÐIÒ\ÓÑ Ó#
Z +<Ð\Ñ œ Ð# $Þ"Ñ † !Þ" Ð$ $Þ"Ñ † !Þ( Ð% $Þ"Ñ † !Þ# œ Ð "Þ"Ñ † !Þ" Ð !Þ"Ñ † !Þ( Ð!Þ*Ñ † !Þ# œ "Þ#" † !Þ" !Þ!" † !Þ( !Þ)" † !Þ# œ œ !Þ"#" !Þ!!( !Þ"'# œ ! # # # # # # Þ#*
Method 2: Z +<Ð\Ñ œ IÒ\ Ó ÐIÒ\ÓÑ# #
Z +<Ð\Ñ œ Ð#Ñ † !Þ" Ð$Ñ † !Þ( Ð%Ñ † !Þ# Ð$Þ"Ñ œ % † !Þ" * † !Þ( "' † !Þ# *Þ'"
7 Expectation and Variance
7.4 Varianceá
______________________________________
Expectation and Variance under a change of units: For any random random variable and any real numbers and \ + , À
IÒ+\ ,Ó œ +IÒ\Ó , Z +<Ð+\ ,Ñ œ + Z +<Ð\Ñ#
Without calculation, why is Z +<Ð\Ñ not affected above by ?,
Z +<Ð+\ ,Ñ œ IÒ Ð+\ ,Ñ IÒ+\ ,Ó Ó œ IÒ +\ , +IÒ\Ó , Ó œ IÒ +\ , +IÒ\Ó , Ó
IÒ +\ +IÒ\Ó Ó œ IÒ+ \ IÒ\Ó Ó + IÒ \ IÒ\Ó Ó œ + Z +<Ð\Ñ Ð Ñ Ð Ñ Ð Ñ Ð Ñ Ð Ñ Ð Ñ # # # # # # # # # Ð Ñ œ œ