Docsity

Expected Value and Variance - Lecture Notes | MATH 329, Study notes of Probability and Statistics

Toggle sidebar
bg1
Dr. Neal, WKU
MATH 329 Expected Value and Variance
We now shall discuss how to find the average and standard deviation of a random
variable
X
.
Expected Value
Definition. The expected value (or average value, or mean ) of a discrete random
variable
X
is a weighted average given by
=E[X]=k P(X=k)
k∈Range X
∑.
Note: If
X
has a finite range {k
1
, k
2
, . . . , kn}, then its average value is
E[X]=k1×P(X=k1)+k2×P(X=k2)+.. .+kn×P(X=kn), which is always a finite
sum. But if Range X is denumerable {k
1
, k
2
, . . . , kn, . . . }, then E[X] is an infinite sum
and may or may not converge.
Example 1. (a) Roll a fair six-sided die; record the value. What is the average value?
(b) Roll a fair six-sided over and over until you roll a 3. You win $
6n
if you roll a 3 for
the first time on the
n
th roll. What are your average earnings?
(c) Roll a single six-sided die. If you roll a 1, then you get $5. If you roll a 2 or 3, then
you get $10. But if you roll a 4, 5, or 6, then you lose $20. Let
X
denote your change in
fortune. Compute E[X].
Solution. (a) Let
X
be the value of the die. Then Range X = {1, 2, 3, 4, 5, 6}, and each
value in the range occurs with probability 1/6. Thus,
E[X]=k P(X=k)
k∈Range X
∑=k×1
6
k=1
6
∑=1+2+3+4+5+6
6=3.5
.
(b) Let
X
be your earnings. Then Range X = {
6
,
62
,
63
, . . . } , and for
n≥1
we have
P(X=6n)=5
6
n−11
6
(from
n−1
losses followed by the win on the
n
th roll). Thus,
E[X]=k P(X=k)
k∈Range X
∑=6nP(X=6n)
n=1
∞
∑
=6n5
6
n−11
6
n=1
∞
∑=5n−1
n=1
∞
∑= ∞.
Although you would expect the game to end at some point at which you receive
your payoff, the average payoff is infinite.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Expected Value and Variance - Lecture Notes | MATH 329 and more Study notes Probability and Statistics in PDF only on Docsity!

MATH 329 Expected Value and Variance

We now shall discuss how to find the average and standard deviation of a random variable X.

Expected Value

Definition. The expected value (or average value, or mean ) of a discrete random variable X is a weighted average given by

= E[ X] = k P(X = k ) k ∈ Range X

Note: If X has a finite range {k 1 , k 2 ,... , kn}, then its average value is E[ X ] = k 1 × P( X = k 1 ) + k 2 × P( X = k 2 ) + .. .+ kn × P( X = kn ), which is always a finite sum. But if Range X is denumerable {k 1 , k 2 ,... , kn,... }, then E[ X ] is an infinite sum and may or may not converge.

Example 1. (a) Roll a fair six-sided die; record the value. What is the average value?

(b) Roll a fair six-sided over and over until you roll a 3. You win $ 6 n^ if you roll a 3 for the first time on the n th roll. What are your average earnings?

(c) Roll a single six-sided die. If you roll a 1, then you get $5. If you roll a 2 or 3, then you get $10. But if you roll a 4, 5, or 6, then you lose $20. Let X denote your change in fortune. Compute E[ X ].

Solution. (a) Let X be the value of the die. Then Range X = {1, 2, 3, 4, 5, 6}, and each value in the range occurs with probability 1/6. Thus,

E[ X ] = k P( X = k) k ∈ Range X

∑ =^ k^ ×^

k = 1 6

6

∑ =^

(b) Let X be your earnings. Then Range X = { 6 , 62 , 63 ,... } , and for n ≥ 1 we have

P(X = 6 n^ ) = 5 6

^

^

n− (^1 ) 6

(from n − 1 losses followed by the win on the n th roll). Thus,

E[ X ] = k P( X = k) k ∈ Range X

∑ =^6 n^ P(^ X^ =^6 n^ )

n= 1

∞

= 6 n^5 6

^

^

n− (^1 ) n= 1 6

∞

∑ =^5 n−^1

n= 1

∞

Although you would expect the game to end at some point at which you receive your payoff, the average payoff is infinite.

(c) We have Range X = {–20, 5, 10} with the pdf of X given by

f (−20) = P( X = −20) = 3 6

f (5) = P( X = 5) = 1 6

f (10) = P(X = 10) = 2 6

Thus, E[ X ] = k P( X = k) k ∈ Range X

∑ = −^20 ×^

+ 5 × 1

+ 10 × 2

Conditional Average

Definition. Let A be an event with P(A) > 0. The conditional average of a discrete random variable X given A is defined by

E[ X A] = k P( X = k A) k ∈ Range X

∑ =^ k P^ ({^ X^ P=(^ kA})^ ∩^ A)

k ∈Range X

P( A)

k P ( {X = k} ∩ A)

k ∈ Range X

Theorem 1. (Law of Total Average) Suppose non-null events A 1 , A 2 ,... form a partition of Ω. That is, the events are disjoint and their union is all of Ω. Then for any discrete random variable X , we have

E[ X ] = E[ X A 1 ] × P( A 1 ) + E[ X A 2 ] × P(A 2 ) + ... = E[ X Ai ] i

∑ ×^ P(Ai ).

Proof. Using properties of series and the probability measure P , we have

E[ X Ai ] i

∑ ×^ P(^ Ai )^ =^ k P(^ X^ =^ k^ Ai )

k

i

∑ ×^ P(^ Ai )

= k P^ (^ (X^ =^ k^ )∩^ Ai)

∑ i ∑k P(Ai )

× P(Ai )

= k P ( (X = k )∩ Ai)

k

i

= k P ( (X = k )∩ Ai)

i

k

∑ rearrange the sum

= k P ( ( X = k) ∩ Ai)

i

k

= k P ( X = k )∩ Ai i

U

k

∑ by disjointness of partition

= k P X( = k) k

∑ =^ E[^ X^ ].

Theorem 2. (i) The expected value of a constant is that constant: E[c ] = c.

(ii) Expected value is a linear operator on discrete random variables; that is, constants factor out of an expected value and the expected value of a sum is the sum of the expected values:

E[c X ] = cE [ X ] and E[ X + Y ] = E[ X] + E[Y ].

(iii) If X ≥ 0, then E[ X ] ≥ 0. In particular, E[ Z^2 ] ≥ 0 for any random variable Z.

Proof. (i) Let X = c with probability 1. Then E[c ] = c × P( X = c) = c × 1 = c.

(ii) If c = 0, then E[c X ] = E[0] = 0 = 0 × E[ X]. Otherwise, if X has range with distinct values {k 1 , k 2 ,... }, then c X has range with distinct values {c k 1 , c k 2 ,... } and P(X = cki ) = P(X = ki ). Hence,

E[c X ] = c k P( X = ck ) k ∈ Range X

∑ =^ c^ k P(^ X^ =^ k^ )

k ∈ Range X

∑ =^ c E[^ X^ ].

Next, let X have range with distinct values {k 1 , k 2 ,... } and let Y have range with distinct values {l 1 , l 2 ,... }. Then the range of X + Y is the collection of possible sums {k 1 + l 1 , k 1 + l 2 ,... , k 2 + l 1 , k 2 + l 2 ,... , k (^) j + l 1 , k (^) j + l 2 ,... } (with some of these values possibly repeating). Then

E[ X + Y ] = k P( X + Y = k

∑ k^ )

= (ki + lj ) P( X = ki ,Y = l (^) j ) j

i

= (^) ( ki P( X = ki , Y = lj ) + lj P( X = ki ,Y = lj )) j

i

= ki P( X = ki ,Y = lj ) j

i

∑ +^ lj P(^ X^ =^ ki ,^ Y^ =^ lj )

j

i

= ki P( X = ki , Y = lj ) j

i

∑ +^ l^ j P(^ X^ =^ ki )^ P(Y^ =^ lj X^ =^ ki )

j

i

= ki P {X = ki ∩ Y = l (^) j} j

U

i

∑ +^ P(^ X^ =^ ki )^ l^ j P(Y^ =^ lj X^ =^ ki )

j

i

= ki P X( = ki)

i

∑ +^ P(^ X^ =^ ki )E[Y^ X^ =^ ki ]

i

= E[ X] + E[Y ].

(iii) Assume that every value k in the range of X is non-negative. Because P(X = k ) also is non-negative for every k , we have E[ X ] = k P( X = k ) k ∈ RangeX

∑ ≥^ 0.

Example 3. Find the average sum when rolling two dice.

Solution. (Hard way) Let X 1 be the value of one die and let X 2 be the value of the other die. The sum X 1 + X 2 has range {2, 3, 4,... , 12}. Then,

E[ X 1 + X 2 ] = k k= 2

12

∑ P(^ X 1 +^ X 2 =^ k)

= 2 × 1

+ 3 × 2

+... + 7 × 6

+ .. .+ 12 × 1

(Easier) By linearity we have E[ X 1 + X 2 ] = E[X 1 ] + E[ X 2 ] = 3.5 + 3.5 = 7.

Variance and Standard Deviation

Definition. Let X be a random variable with = E[ X] being finite. The variance of X is then defined by

(^2) = Var X( ) = E (^) [ (X − E[ X]) (^2) ] = E (^) [ ( X − ) (^2) ]

= (k − )^2 P( X = k ) k ∈ RangeX

Because the random variable ( X − E[ X ])^2 is non-negative, its expected value is non- negative. That is, Var X(^ ) ≥ 0. Thus, we can define the standard deviation of X by = Var(X).

The formal definition of variance is rarely used in practice. When computing the variance of a discrete random variable, it is more common to use the following result:

Theorem 3. Let X be a discrete random variable. Then Var X( ) = E[X 2 ]− ( E X[ ])^2.

E[X ] = k × 1

n − m + 1

k = m

n

n − m + 1

k k = 1

n

∑ −^ k

k = 1

m− 1

n − m + 1

n(n + 1) 2

− (m^ −^ 1)m 2

^

n − m + 1

n^2 − m^2 + n + m 2

n − m + 1

(n + m )(n − m) + n + m 2

^

n − m + 1

(n + m )(n − m + 1) 2

^

= m^ +^ n 2

The variance of X is given by

Var X( ) = E[X^2 ] − ( E[ X])^2

= k^2 P( X = k) k=m

n

∑ −^ m^2 +^ n

^

^

2 = 1 n − m + 1

k 2 k = m

n

∑ −^ m^2 +^ n

^

^

2

n − m + 1

n(n + 1)(2 n + 1) 6

− (m^ −^ 1)^ m^ (2^ m^ −^ 1) 6

^

 −^

m + n 2

^

^

2

= (n^ −^ m^ )(n^ −^ m^ +^ 2) 12

Independent Random Variables

Intuitively, we think of random variables X and Y as being independent when their values are not affected by each other. That is, the fact that X = a has no bearing on whether Y = b , and vice versa. We formally define independence as follows:

Definition. Random variables X 1 , X 2 ,... , Xn are independent if and only if

P ({ Xi 1 = a 1 } ∩ {Xi 2 = a 2 } ∩ ... ∩{Xik = ak}) = P X( i j = aj)

j= 1

k

for all possible subsequences Xi 1 ,.. ., Xik.

Example 6. Flip a coin 3 times. Let Xi count the number of Heads on the i th flip. Then Xi is either 1 or 0 and the Xi are independent, and the probability of getting 3 Heads in a row is

P(X 1 = 1 ∩ X 2 = 1 ∩ X 3 = 1) = P( X 1 = 1) × P(X 2 = 1) × P(X 3 = 1) = 1 2

× 1

× 1

Note : For convenience, we often write P(Xi = a ∩ Xj = b) as P(Xi = a, X (^) j = b) , and we denote that X and Y are independent by X ⊥ Y.

Theorem 4. Let X and Y be independent. Then E[ X Y ] = E[ X] × E[Y ].

Proof. Let X have range with distinct values {k 1 , k 2 ,... } and let Y have range with distinct values {l 1 , l 2 ,... }. Then the range of X Y is the collection of possible products {k 1 l 1 , k 1 l 2 ,... , k 2 l 1 , k 2 l 2 ,... , k (^) j l 1 , k (^) j l 2 ,... } Then,

E[ X Y ] = k P(X Y = k

∑ k^ )^ =^ ki lj P(X^ =^ ki ,^ Y^ =^ lj )

j

i

= ki l (^) j P( X = ki ) × P(Y = lj ) j

 by indep. i

= ki P( X = ki ) × l (^) j P(Y = lj ) j

i

= ki P( X = ki ) lj P(Y = l (^) j ) j

i

∑ =^ (^ ki P(^ X^ =^ ki )^ ×^ E[Y^ ])

i

= E[Y ] × ki P( X = ki ) i

= E[Y ] × E[ X] = E[ X ] × E[Y ].

Note : By induction, the previous result easily extends to a finite sequence. That is, if random variables X 1 , X 2 ,... , Xn are independent, then

E[ X 1 X 2... Xn ] = E[ X 1 ] × E[ X 2 ] ×. .. × E[Xn].

Example 7. (a) Roll two dice. What is the average product of the two values?

(b) Roll one die. Square the result. What is the average square? How does it compare with the square of the average roll?

Proofs. (i) Var(a) = E[a^2 ] − ( E[a])^2 = a^2 − (a)^2 = 0.

(ii) Var(a X ) = E[( aX )^2 ] − (E[aX ])^2 = E[a^2 X^2 ] − (aE [X ])^2 = a^2 E[ X^2 ] − a^2 ( E[ X ])^2 = a^2 ( E[ X^2 ] − ( E[X ])^2 )

= a^2 Var( X ).

(iii) Var( X + b) = E (^) [ ( ( X + b) − E[ X + b])^2 ] = E (^) [ (^ X + b − E[ X] − b)^2 ] = E (^) [ ( ( X − E[X ])^2 ] = Var( X).

(iv) Simply combine Properties (ii) and (iii).

(v) E[( X + Y )^2 ] = E[ X^2 + 2 XY + Y 2 ] = E[ X^2 ] + 2 E[ XY] + E[Y 2 ] = E[ X^2 ] + 2 E[ X ]E[Y ] + E[Y^2 ] by independence

Hence, Var( X + Y ) = E[( X + Y )^2 ] − E[ X + Y ]^2 = E[ X^2 ] + 2 E[X ]E[Y ] + E[Y 2 ] − (^ E[ X ] + E[Y ])^2 = E[ X^2 ] + 2 E[X ]E[Y ] + E[Y 2 ] − (^) ( E[ X ]^2 + 2 E[ X ]E[Y ] + E[Y ]^2 )

= E[ X^2 ] − E[ X]^2 + E[Y 2 ] − E[Y ]^2 = Var(X ) + Var(Y ).

Note : If X and Y are independent, then Var( X − Y ) = Var( X ) + Var(Y ) by Properties (v) and (ii).

By induction, Property (v) extends to a finite sequence. That is, if random variables X 1 , X 2 ,... , Xn are independent, then

Var( X 1 + X 2 + .. .+ Xn ) = Var( X 1 ) + Var(X 2 ) +. .. + Var(Xn).

Exercises

  1. Draw one card from a standard deck. If you draw a number card (2 through 10), then X will be 10. If you draw a face card, then X will be 20. If you draw an Ace, then X will be 30. Compute the mean and standard deviation of X.
  2. You make a bet for which you win with probability p and lose with probability q = 1 − p, where 0 < p < 1. If you win, you gain $a and if you lose then you drop $b. Let X be your change in fortune so that X is either + a or − b.

(a) Derive E[ X ].

(b) The casino wants E[ X ] ≤ 0. Use your formula for E[ X ] from (a) to solve for what the payoff a should be to maintain the inequality E[ X ] ≤ 0.

  1. Roll two fair six-sided dice and let ( 1 , 2 ) denote the resulting pair. Define a random variable X by X (( 1 , 2 )) = 1 − 2. Compute the mean and standard deviation of X.
  2. The Fibonacci sequence {Fn} is defined by

F 1 = 1 , F 2 = 1 , and Fn = Fn− 1 + Fn− 2 for n ≥ 3.

Let S be sum of the first six Fibonacci numbers. A biased six-sided die is such that the probability of rolling the value i is Fi / S for i = 1,2,. .., 6. Roll this die and let X be the value. Compute the mean and standard deviation of X.