Chapter 4: Mathematical Expectation: X XF X E
Chapter 4: Mathematical Expectation: X XF X E
Definition 4.1
= E ( x) = xf ( x)
x
If X is discrete, and
= E ( x) = xf ( x)dx
−
Example 4.1
ANS:
Let x represent the number of good headlights in the sample. The
probability distribution of x is
4 3
−
f ( x) =
x 3 x
7 , X = 0, 1, 2, 3.
3
ANS:
The random variable of interest is Y, the amount the gambler can win;
and the possible values of Y are $5 if event E1 = {HHH, TTT} occurs
and -$3 if event
Let X be the random variable that denotes the life in hours of a traffic
light. The probability density function is
20000
, x 100
f ( x) = x 3
0, elsewhere
ANS:
20000 20000
= E ( X ) = x 3 dx = 2
dx =200
100
x 100
x
Theorem 4.1
g ( x ) = E ( g ( x)) = g ( x) f ( x)
x
If X is discrete, and
g ( x ) = E ( g ( x)) = g ( x) f ( x)dx
−
If X is continuous.
Example 4.4
Suppose that the number of X that pass though a car wash between
4:00 pm and 5:00 pm on any sunny Friday has the following
probability distribution:
X 4 5 6 7 8 9
P(X=x) 1/12 1/12 ¼ 1/4 1/6 1/6
Let g(x) = 2x-1 represent the amount of money in dollars, paid to the
attendant by the manager. Find the attendant’s expected earnings for
this particular time period.
ANS:
9
E ( g ( x)) = E (2 x − 1) = (2 x − 1) f ( x)
x=4
Example 4.5
x2
f ( x) = 3 , − 1 x 2
0, elsewhere
ANS:
(4 x + 3) x 2
2 2
1
E (4 x + 3) = dx = (4 x 3 + 3x 2 )dx =8
−1
3 3 −1
Definition 4.2
g ( x , y ) = E ( g ( x, y )) = g ( x, y ) f ( x, y )
x y
If X and Y are discrete, and
g ( x , y ) = E ( g ( x, y )) = g ( x, y) f ( x, y)dx
−−
Example 4.6
2 2
E ( xy) = xyf ( x, y ) = (0)(0) f (0,0) + (0)(1) f (0,1) + .. + (2)(0) f (2,0) +
x =0 y
.. + (1)(1) f (1,1) = 3 / 14
Example 4.7
Find E(y/x) for the density function
x(1 + 3 y 2 )
, 0 x 2, 0 y 1
f ( x, y ) = 4
0, elsewhere
ANS:
y (1 + 3 y 2 ) y + 3y3
1 2 1
5
E ( y / x) = dxdy = dy =
0 0
4 0
2 8
Tutorial
1. In a gambling game a woman is paid $3 if she draws a jack or
a queen and $5 if she draws a king or an ace from an ordinary deck
of 52 playing cards. If she draws any other card, she loses. How
much should she pay to play if the game is fair?
f(x,y) x
2 4
1 0.10 0.15
y 3 0.20 0.30
5 0.10 0.15
X 0 1 2 3
f(x) 1/10 3/10 2/5 1/5
Definition 4.3
2 = E (x − )2 = (x − )2 f ( x) if X is discrete, and
x
(x − )
= E (x − ) =
2 2 2
f ( x)dx if X is continuous
−
x 1 2 3
f(x) 0.3 0.4 0.3
x 0 1 2 3 4
f(x) 0.2 0.1 0.3 0.3 0.1
ANS:
For company A:
3
= ( x − 2) 2 f ( x) = (1 − 2) 2 (0.3) + (2 − 2) 2 (0.4) + (3 − 2) 2 (0.3) = 0.6
2
A
x =1
For company b:
4
= ( x − 2) 2 f ( x) = (0 − 2) 2 (0.2) + (1 − 2) 2 (0.1) + (2 − 2) 2 (0.3) + (3 − 2) 2 (0.3)
2
B
x =0
+ (4 − 2) 2 (0.1) = 1.6
Theorem 4.2
The variance of a random variable X is
2 = E(x 2 ) − 2
Example 4.9
X 0 1 2 3
f(x) 0.51 0.38 0.10 0.01
ANS:
= E ( x) = 0(0.51) + 1(0.38) + 2(0.10 ) + 3(0.01) = 0.61
E ( x 2 ) = 0(0.51) + 1(0.38) + 4(0.10 ) + 9(0.01) = 0.87
2 = 0.87 − (0.61) 2 = 0.4979
Example 4.10
The weekly demand for petrol, in thousands lf liters, from a local
chain of efficiency stores, is a continuous random variable X having
the probability density
2( x − 1) 1 x 2
f ( x) =
0 elsewhere
Find the mean and variance of X
ANS:
2
5
= E ( x) = 2 x( x − 1)dx =
1
3
2
17
E ( x 2 ) = 2 x 2 ( x − 1)dx =
1
6
17 5 2 1
2 = −( ) =
6 3 18
Theorem 4.3
g2( X ) = E (g ( X ) − g ( X ) )2 = (g ( X ) − g ( X ) )2 f ( x)
x
if X is discrete, and
(g ( X ) − )
= E (g ( X ) − g ( X ) ) =
2 2 2
g(X ) g(X ) f ( x)dx
−
if X is continuous
Example 4.11
X 0 1 2 3
f(x) 1/4 1/8 1/2 1/8
ANS:
3
2 X +3 = E (2 X + 3) = (2 x + 3) f ( x) = 6
x =0
22X +3 = E ((2 X + 3) − 2 x +3 )2 = E (2 X + 3 − 6) 2
3
= E (4 X − 12 X + 9) = (4 X 2 − 12 X + 9) f ( x) = 4
2
x =0
Example 4.12
x2
f ( x) = 3 , − 1 x 2
0, elsewhere
Find the variance of the random variable g(X)=4X+3
ANS:
(4 x + 3) x 2
2 2
1
E (4 x + 3) = dx = (4 x 3 + 3x 2 )dx =8
−1
3 3 −1
42X +3 = E ((4 X + 3) − 8)2 = E (4 X − 5) 2
2 2
x3 1 51
= (4 x − 5) 2
dx = (16 x 4 − 40 x 3 + 25 x 2 )dx =
−1
3 3 −1 5
Definition 4.4
XY = E( X − X )(Y − Y ) = ( x − x )( y − y ) f ( x, y )
x y
If X and Y are discrete, and
XY = E( X − X )(Y − Y ) = (x − x )( y − y ) f ( x, y )dxdy
−−
If X and Y are continuous.
Theorem 4.4
XY = E XY − x y
Example 4.13
ANS:
2
5 15 3 3
x = xg ( x) = 0 + 1 + 2 =
x =0 14 28 28 4
2
5 3 1 1
y = yh( y) = 0 + 1 + 2 =
x =0 7 28 2
28
3 3 1 9
XY = EXY − x y = − = −
14 4 2 56
Example 4.14
The fraction X of male car racers and the fraction Y of female car
racers who compete in car racing competition are described by the
joint density function.
8 xy, 0 y x 1
f ( x, y ) =
0, elsewhere
ANS:
4x3 , 0 x 1
g ( x) =
0, elsewhere
4 y (1 − y 2 ), 0 y 1
h( y ) =
0, elsewhere
1 1
4 8
x = E ( X ) = 4 x dx =
4
and y = E (Y ) = 4 y 2 (1 − y 2 )dx =
0
5 0
15
1 1
4
E ( XY ) = 8 x 2 y 2 dxdy =
0 0
9
4 4 8
XY = EXY − x y = −
4
=
9 5 15 225
Tutorial:
X 2 3 4 5 6
f(x) 0.01 0.25 0.4 0.3 0.04
x 0 x 1
f ( x ) = 2 − x 1 x 2
0
elsewhere
Find the variance of X.
f(x,y) X
1 2 3
1 0.05 0.05 0.1
y 2 0.05 0.1 0.35
3 0 0.2 0.1
2(1 − x), 0 x 1
f ( x) =
0, elsewhere
Theorem 4.5
E (aX + b) = aE ( X ) + b
Corollary 4.1
E (b ) = b
Corollary 4.2
E (aX ) = aE ( X )
Example 4.15
ANS:
E(2X-1) = 2E(X) – 1
9
1 1 1 41
= E ( X ) = xf ( x) = 4 + 5 + .... + 9 =
x=4 12 12 6 6
41
2 X −1 = 2 − 1 = 12.67
6
Example 4.16
ANS:
E (4 X + 3) = 4 E ( X ) + 3
2
x2 2 3
x 5
E ( X ) = x dx = dx =
−1
3 −1
3 4
5
E (4 X + 3) = 4 + 3 = 8
4
Theorem 4.6
E g ( X ) h( X ) = E g ( X ) E h( X )
Example 4.17
X 0 1 2 3
f(x) 1/3 1/2 0 1/6
ANS:
( )
E ( X − 1) 2 = E X 2 − 2 X + 1 = E ( X 2 ) − 2 E ( X ) + E (1)
E ( X − 1) 2 = 2 − (2)(1) + 1 = 1
Example 4.18
2( x − 1), 1 x 2
f ( x, y ) =
0, elsewhere
ANS:
( )
E X 2 + X − 2 = E ( X 2 ) + E ( X ) − E (2)
E (2 ) = 2
2 2
E ( X ) = 2 x( x − 1)dx = 2 ( x 2 − x)dx =
5
1 1
3
( ) = 2x
2 2
17
E X 2 2
( x − 1)dx = 2 ( x 3 − x 2 )dx =
1 1
6
(
E X 2 + X −2 = ) 17 5
+ −2=
6 3
5
2
E g ( X , Y ) h( X , Y ) = E g ( X , Y ) E h( X , Y )
Corollary 4.3
E g ( X ) h(Y ) = E g ( X ) E h(Y )
Corollary 4.4
Corollary 4.5
XY = 0
Theorem 4.8
E XY = E X E Y
Example 4.19
x(1 + 3 y 2 )
, 0 x 2,0 y 1
f ( x, y ) = 4
0, elsewhere
ANS:
x 2 y (1 + 3 y 2 )
1 2 1 2
E ( XY ) = xyf ( x, y )dxdy = dxdy
0 0 0 0
4
x =2
x 3 y (1 + 3 y 2 ) 2 y (1 + 3 y 2 )
1 1
5
= dy = dy =
0
12 x =0 0
3 6
x 2 (1 + 3 y 2 )
1 2 1 2
E ( X ) = xf ( x, y )dxdy = dxdy
0 0 0 0
4
x=2
x 3 (1 + 3 y 2 ) 2(1 + 3 y 2 )
1 1
4
= dy = dy =
0
12 x =0 0
3 3
xy(1 + 3 y 2 )
1 2 1 2
E (Y ) = yf ( x, y )dxdy = dxdy
0 0 0 0
4
x =2
x 2 y (1 + 3 y 2 ) y (1 + 3 y 2 )
1 1
5
= dy = dy =
0
8 x =0 0
2 8
Hence
4 5 5
E ( X )E (Y ) = = = E ( XY )
3 8 6
Theorem 4.9
aX
2
+b = a X = a
2 2 2 2
Corollary 4.6
X2 +b = X2 = 2
Corollary 4.7
aX
2
= a 2 X2 = a 2 2
Theorem 4.10
aX
2
+ bY = a X + b Y + 2ab XY
2 2 2 2
Corollary 4.8
aX
2
+ bY = a X + b Y
2 2 2 2
Corollary 4.9
aX
2
−bY = a X + b Y
2 2 2 2
Example 4.20
ANS:
Tutorial
X -3 6 9
f(x) 1/6 1/2 1/3
Find E(X) and E(X ) and then, using these values, evaluate
2
E((2X+1) 2).
2
( x + 2 y ), 0 x 1,1 y 2
f ( x, y ) = 7
0, elsewhere
X
Find the expected value of g ( X , Y ) = 3 + X Y
2
Y
4. Suppose that a grocery store purchases 5 cartons of skim milk
at wholesale price of $1.20 per carton and retails the milk at
$1.65 per carton. After the expiration date, the unsold milk is
removed from the shelf and the grocer receives a credit from
the distributor equal to three-fourths of the wholesale price. If
the probability distribution of the random variable X, the
number of cartons that are sold from this lot, is
X 0 1 2 3 4 5
f(x) 1/15 2/15 2/15 3/15 4/15 3/15
Find the expected profit