Expected Value & Variance Lecture 16 Section 5.3

Lecture 16
Expected Value
& Variance
Section 5.3
STAT 225, Dallas Bateman, Spring 2010
1
Expected Value
• Question: How do you determine the “value”
of a game? Is it better to play Roulette than
the Lottery? We are looking for ways of
describing random variables.
STAT 225, Dallas Bateman, Spring 2010
2
Expected Value
• Definition: Expected Value
– The expected value of a random variable X with
PMF p X ( x) is given by:
E( X )   x *pX ( x)
– The expected value is a weighted average of the
possible values of X, weighted by the probabilities.
STAT 225, Dallas Bateman, Spring 2010
3
Expected Value
• We may interchangeably use the terms mean,
average, expectation, and expected value and
the notations E(X) or 
• Note: The expected value of a random variable can be
understood as the long-run-average value of the random
variable in repeated independent trials. If you are playing a
game, and X is what you win in the game, then E(X) would be
your average win if you would play the game many many
many times.
STAT 225, Dallas Bateman, Spring 2010
4
Example #1
• Let X be a random variable with PMF:
X
-1
0
1
2
• Then
p X (x)
1/3
1/4
1/4
1/6
1  1  1 1 1
E( X )  1   0    1   2   
 3  4  4  6 4
STAT 225, Dallas Bateman, Spring 2010
5
Example #1
• Draw the histogram for the PMF above and
mark where you think the “balance point” of
the histogram would be if the bars were solid
metal.
0.35
0.3
0.25
“Balance Point”
Should be right
About here
0.2
0.15
0.1
0.05
0
-1
0
STAT 225, Dallas Bateman, Spring 2010
1
2
6
E(X) Note:
• E(X) can be understood as the (physical)
“center of gravity” in the histogram, if you
consider the probability to be mass (literally).
STAT 225, Dallas Bateman, Spring 2010
7
Fundamental Expected-Value Formula
• Instead of E(X) we can also compute the
expected value of a function of X:
• Theorem: Fundamental Expected-Value
Formula
– If X is a discrete random variable with PMFp X ( x)
and g ( x) is any real valued function of X, then
E[ g ( x)]   g ( x)* pX ( x)
STAT 225, Dallas Bateman, Spring 2010
8
Example #2
• For the random variable in Example #1
compute the following
a)
1
1
1
 1  15
E ( X 2 )  (1)2    (0)2    (1)2    (2) 2     1.25
 3
4
4
 6  12
b)
1
1
1
1
(

1

3)

(0

3)

(1

3)

(2

3)
E( X  3) 
 
 
 
   3.25
3
4
4
6
c)
1
1
1
1 1
(2*

1)

(2*0)

(2*1)

(2*2)
E(2 X ) 
 
 
 
    0.5
 3
4
4
6 2
STAT 225, Dallas Bateman, Spring 2010
9
Example #2
• NOTE:
– It is true that E(X+3) = E(X) + 3
– It is true that E(2X) = 2*E(X)
– It is NOT true that E(X2) = E(X)2
STAT 225, Dallas Bateman, Spring 2010
10
Expectation in a Linear Operator
• Let X be a random variable and a, b be
constants. Then
E(aX b )  aE (X ) b
• Also, Let X1,…,Xn be random variables. Then
 n
 n
E   X i    E( X i )
 i 1  i 1
STAT 225, Dallas Bateman, Spring 2010
11
Population Mean
• Consider a finite population of size n and
random variables X defined on it. The
population mean  is defined as:
X1  X 2    X n

n
where X 1  X 2    X n are the values the
random variables takes on for the n members
of the population (data).
STAT 225, Dallas Bateman, Spring 2010
12
Expected Value as a Population Mean
• Consider a finite population and a variable
defined on it. Suppose that a member is
selected at random from the population and let
X denote the value of the variable for that
member. Then the expected value of X equal
the population mean.
STAT 225, Dallas Bateman, Spring 2010
13
Example
• Consider as the population the 20 new twobedroom apartments built in West Lafayette
during the year 2005 and as the random
variable their initial estimated rent. Then the
population mean is the average rent of a twobedroom apartment in 2005 ($550). Note, that
not all two-bedroom apartments in West
Lafayette during 2005 rented for $550. But if
we chose a unit at random, then that would be
our “best guess” for the rent.
STAT 225, Dallas Bateman, Spring 2010
14
Variance
• We now know that we can use the expected
winning to describe the value of a game. But
can one measure the risk involved in a game or
in an investment strategy?
STAT 225, Dallas Bateman, Spring 2010
15
Example:
• Suppose you are offered two investment
opportunities:
a) You invest $1 and you will gain $1 with
probability 0.5
b) You invest $1 and will gain $999,999 with
probability 0.000001
STAT 225, Dallas Bateman, Spring 2010
16
Example
• Let X be what you gain from the two
investment strategies offered above. Write
down the PMFs of X under the two strategies:
X
-1
1
p X (x)
½
½
p X (x)
X
-1
0.999999
999999 0.000001
STAT 225, Dallas Bateman, Spring 2010
17
Example:
• Let’s find E(X) for both situations:
– E ( X )  1(0.5)  1(0.5)  0
– E ( X )  1(0.999999)  999999(0.000001)  0
Are they both fair (E(X)=0)? YES
The expected values of the games are the same.
But clearly, they are not the same game. We
need another quantity to describe random
variables other than their expectation.
STAT 225, Dallas Bateman, Spring 2010
18
Variance Definition
• Let X be a discrete random variable with PMF
p X (x) . Then the variance of X is defined as
.
Var( X )  E ( X )  E ( X )
2
2
• It measures the mean squared distance of
observations on X from their mean.
STAT 225, Dallas Bateman, Spring 2010
19
Properties of Variance
• Var(X) is always non-negative (Var(X) >= 0)
• Sometimes, we’ll abbreviate: σ2
• Var(X) is a measure of the spread of the
random variable. If Var(X)=0, then the spread
is zero, i.e. all the probability is concentrated
in one point (nothing is random anymore).
• The variance is not measured in the same units
that the random variable is measure in. (This is
a disadvantage!)
STAT 225, Dallas Bateman, Spring 2010
20
Variance Example
• Going back to the previous example, let X be
what you gain from the two investment
strategies offered above.
2
2
2
[(

1)
(0.5)

(1)
(0.5)]

[0]
1
a) Var(X) =
b) Var(X) =
[(1)2 (0.999999)  (999999) 2 (0.000001)]  [0]2  999, 999
STAT 225, Dallas Bateman, Spring 2010
21
Variance
• Theorem: Variance is not a linear operator!
Let X be a random variable and a,b be
constants. Then:
Var (aX  b)  a Var ( X )
2
STAT 225, Dallas Bateman, Spring 2010
22
Variance
• If X 1  X 2    X n
are independent, then:


Var   X i    Var ( X i )
 i 1  i 1
n
n
STAT 225, Dallas Bateman, Spring 2010
23
Standard Deviation
• Definition: Standard Deviation
– The standard deviation of a random variable X is
defined to be:
StdDev( X )  Var ( X )
– Sometimes we’ll abbreviate StdDev( X )     2
– Unlike the variance, the standard deviation is
measured in the same units (i.e. $, minutes, yards)
that X is measured in.
STAT 225, Dallas Bateman, Spring 2010
24
Practice Problem #1
• Family size can be represented by the random
variable X. Determine the average family size.
X
2
3
4
5
P(X) 0.17 0.47 0.26 0.10
E( X )  2(0.17)  3(0.47)  4(0.26)  5(0.10)  3.29
STAT 225, Dallas Bateman, Spring 2010
25
Practice Problem #2
• Find the expected number of aces in a poker hand.
#Aces
0
1
2
3
4
P(Ace)
 48  4 
  
 5  0   0.659
 52 
 
5
 48  4 
  
 4  1   0.299
 52 
 
5
 48  4 
  
 3  2   0.04
 52 
 
5
 48  4 
  
 2  3   0.002
 52 
 
5
 48  4 
  
 1  4   0.00002
 52 
 
5
E(# Aces) 
 0(0.659)  1(0.299)  2(0.04)  3(0.002)  4(0.00002)
 0.3846
STAT 225, Dallas Bateman, Spring 2010
26
Practice Problem #3
• Let X be a discrete random variable with PMF:
X
0
P(X) 0.4
a)
b)
c)
d)
1
0.2
2
0.3
3
0.1
Find E(X)
Find Var(X)
Find E(2X-3)
Find Var(2X-3)
STAT 225, Dallas Bateman, Spring 2010
27
Practice Problem #3
a) E( X )  0(0.4)  1(0.2)  2(0.3)  3(0.1)  1.1
2
2
2
2
2
E
(
X
)

0
(0.4)

1
(0.2)

2
(0.3)

3
(0.1)  2.3
b)
2
2
2
E
(
X
)

E
(
X
)

2.3

(1.1)
 1.09
Var ( X ) 
c) E(2 X  3)  2E( X )  3  2(1.1)  3  -0.8
2
2
d) Var (2 X  3)  Var ( X )  4(1.09)  4.36
STAT 225, Dallas Bateman, Spring 2010
28
Practice Problem #4
• Suppose X is a random variable with mean   5
and variance  2  9
2
E
((
X

1)
)
a) Find
 Var ( X  1)  E ( X  1)  Var ( X )   E ( X )  1  9  (5  1) 2 
2
2
25
b) Find the standard deviation of X.
SD( X )  Var ( X )  9  3
STAT 225, Dallas Bateman, Spring 2010
29
Practice Problem #5
• For a game, you tell a friend that if a 6-sided
die rolls a 2, you will pay her $2. If the die
rolls a 3, she will pay you $3. Any other
numbers (so 1, 4, 5, or 6) you pay her a
quarter.
• Let W be the random variable representing
your friend’s winnings.
STAT 225, Dallas Bateman, Spring 2010
30
Practice Problem #5
a) What is the probability function of W?
W
2 0.25 -3
P(W) 1/6 4/6 1/6
b) What is the expected amount of money your
friend will win?
1
4
1
E (W )  2    0.25    (3)    0
6
6
6
STAT 225, Dallas Bateman, Spring 2010
31
Practice Problem #5
c) What is the standard deviation of your
friend’s winnings?
1
24
21
E (W )  2    (0.25)    (3)    2.2083
6
6
6
2
2
Var (W )  2.2083  (0) 2  2.2083
SD(W )  Var (W )  2.2083  1.486
STAT 225, Dallas Bateman, Spring 2010
32
Practice Problem #5
d) A game is considered “fair” if the expected
value of the game is zero. Is the game fair?
Yes, the expected value is zero
(see part b)
STAT 225, Dallas Bateman, Spring 2010
33
Practice Problem #5
e) If you and your friend played this game 5
times, what would the overall expected value
and standard deviation of your friend’s
winnings be?
E(5W )  5E(W )  5  0  0
Var (5W )  25Var (W )  25(2.2083)  55.2
SD(5W )  Var (5W )  55.2  7.429
STAT 225, Dallas Bateman, Spring 2010
34