7.2 Means and Variances of Random Variables

Download Report

Transcript 7.2 Means and Variances of Random Variables

Daniel S. Yates
The Practice of Statistics
Third Edition
Chapter 7:
Random Variables
7.2 The mean and Standard Deviation
of a Random Variable
Copyright © 2008 by W. H. Freeman & Company
Some of the examples and slides were copied from the following source:
Roxy Peck
Chris Olsen
Jay Devore
Introduction to Statistics & Data Analysis
3ed
Thompson Brooks/Cole, a part of The Thompson
Corporation
Essential Questions
• How do you calculate the mean of a discrete random
variable?
• How do you calculate the variance and standard
deviation of a discrete random variable?
• What is the law of large numbers?
• Given µX and µY, How do you calculate µa+bX and µX+Y ?
• Given X and Y are independent, how do you calculate
σ2a+bX and σ2X+Y ?
• How do you describe the shape of a linear combination
of independent Normal random variables?
Review
Review
Review
Calculating The Means of a
Discrete Random Variable
Distribution
Example 1
• A professor regularly gives multiple
choice quizzes with 5 questions. Over
time, he has found the distribution of the
number of wrong answers on his
quizzes is as follows
x
0
1
2
3
4
5
P(x)
0.25
0.35
0.20
0.15
0.04
0.01
Example Continued
• Multiply each x value by its
probability and add the results to
get mx.
x
0
1
2
3
4
5
P(x)
0.25
0.35
0.20
0.15
0.04
0.01
x•P(x)
0.00
0.35
0.40
0.45
0.16
0.05
1.41
mx = 1.41
Example – Apgar Scores
• At I min after birth and again at 5 min, each newborn child is
given a numerical rating called the Apgar score. Possible
values of the score are 0, 1, 2, …, 9, 10. A child’s score is
determined by five factors: muscle tone, skin color,
respiratory effort, strength of heartbeat, and reflex. A high
score indicates a healthy baby. Let X denote the Apgar
score at I min of a randomly selected newborn infant at a
particular hospital. The probability distribution is:
X
0
P(X) .002
1
2
3
4
5
6
7
8
9
10
.001
.002
.005
.02
.04
.17
.38
.25
.12
.01
What is the mean Apgar score at this hospital?
µX = 7.16
Calculating Variance
Example 1 Again
• A professor regularly gives multiple
choice quizzes with 5 questions. Over
time, he has found the distribution of the
number of wrong answers on his
quizzes is as follows
x
0
1
2
3
4
5
P(x)
0.25
0.35
0.20
0.15
0.04
0.01
µX = 1.41
Calculate the variance for the of X.
Example - continued
x
0
1
2
3
4
5
P(x)
0.25
0.35
0.20
0.15
0.04
0.01
x•P(x)
0.00
0.35
0.40
0.45
0.16
0.05
1.41
x-m
-1.41
-0.41
0.59
1.59
2.59
3.59
(x - m (x - m•P(x)
1.9881
0.4970
0.1681
0.0588
0.3481
0.0696
2.5281
0.3792
6.7081
0.2683
12.8881
0.1289
1.4019
Variance  X2  1.4019
Standard deviation
 x  1.4019  1.184
Example – Apgar Score Again
X
0
P(X) .002
1
2
3
4
5
6
7
8
9
10
.001
.002
.005
.02
.04
.17
.38
.25
.12
.01
µX = 7.16
Find the variance and standard deviation for the
discrete random variable X.
   X  m  P( X )  1.5684
2
2
    1.25
2
Number of Observations versus
Accurate Estimates of μ
Rules for Means and
Variances
Suppose
• Suppose we want to find the means length and
Standard Deviation of a species of grasshoppers
in a particular field. We run our survey and
establish the following distribution:
• X = the length in inches
X
P(X)
1
0.2
2
0.5
3
0.3
• Find the mean and standard deviation of X.
μX = 2.1 inches
σ2X = 0.49
σ = 0.7 inches
More Supposing
X (in.)
1
2
3
μX = 2.1 in.
P(X)
0.2
0.5
0.3
σ2X = 0.49
• Suppose we are required to report our findings
using the metric system. How does changing to
centimeters affect µX and σX ?
2.54X
2.54(1)
2.54(2)
2.54(3)
P(X)
0.2
0.5
0.3
µ2.54X = 2.54(1)(0.2) + 2.54(2)(0.5) + 2.54(3)(0.3)
= 2.54[(1)(0.2) + (2)(0.5) + (3)(0.3)] = 2.54[ 2.01]
= 2.54µx --------- Let b = 2.54, then bµx
σ22.54X = (2.54(1) – 2.54(2.1))2 (0.2) + (2.54(2) – 2.54(2.1))2 (0.5) + (2.54(3) – 2.54(2.1))2 (0.3)
= (2.54(-1.1))2 (0.2) + (2.54(-0.1))2 (0.5) + (2.54(0.9))2 (0.3)
= 2.542 ((-1.1)2 (0.2) + (-0.1)2 (0.5) + (0.9)2 (0.3)) = 2.542 (0.49)
= 2.542 σ2X
--------------- b2σ2X
Even More Supposing
• We discover after the survey that the instruments we used to
measure the grasshopper were miss calibrated. The measurements
were 0.1 inches too short. Is there a way to adjust the results
without re-doing the entire survey?
• 0.1 inches = .254 cm
.254 + 2.54X
.254 + 2.54
.254 + 5.08
.254 + 7.62
P(X)
0.2
0.5
0.3
µ.254+2.54X = (.254 + 2.54)(0.2) + (.254 + 5.08)(0.5) + (.254 + 7.62)(0.3)
= .254(.2) + .254(.5) + .254(.3) +2.54(.2) + 5.08(.5) +(7.62)(.3)
= [.254(.2) + .254(.5) + .254(.3)] +[2.54(.2) + 5.08(.5) +(7.62)(.3)]
= .254[ 1(.2) + 1(.5) + 1(.3)] + 2.54[ 1(.2) + 2(.5) + 3(.3)]
= .254 + 2.54µX
If we let a = .254 and b = 2.54, then we have
µa+bX = a + bµx
Rules for Means
Example 2
Suppose x is the number of sales staff
needed on a given day. If the cost of doing
business on a day involves fixed costs of
$255 and the cost per sales person per day
is $110, find the mean cost (the mean of x or
mx) of doing business on a given day where
the distribution of x is given below.
x
1
2
3
4
p(x)
0.3
0.4
0.2
0.1
Example 2 continued
We need to find the mean of y = 255 + 110x
x p(x) xp(x)
1 0.3
0.3
2 0.4
0.8
3 0.2
0.6
4 0.1
0.4
2.1
m x  2.1
m y  m255110 x  255  110m x
 255  110(2.1)  $486
Example 2 continued
We need to find the variance and standard
deviation of y = 255 + 110x
x
1
2
3
4
2
p(x) (x-m) p(x)
0.3 0.3630
0.4 0.0040
0.2 0.1620
0.1 0.3610
0.8900

2
  0.89
2
x
 
x
 (110)   (110) (0.89)  10769
2
255 110 m X

0.89  0.9434
255 110 m X
2
x
2
 110 x  110(0.9434)  103.77
Means and Variances for Linear
Combinations
If x1, x2,  , xn are random variables with means
m1, m2,
and

 , ,
, mn and variances
2
1
,
2
2
2
n
respectively,
y = a1x1 + a2x2 +  + anxn then
1. my = a1m1 + a2m2 +  + anmn
(This is true for any random variables with no conditions.)
2. If x1, x2,  , xn are independent random
variables then
2y  a1212  a2222 
 an2n2
and
y  a1212  a2222 
 an2n2
Example 3
A distributor of fruit baskets is going to put 4
apples, 6 oranges and 2 bunches of grapes in
his small gift basket. The weights, in ounces, of
these items are the random variables x1, x2 and
x3 respectively with means and standard
deviations as given in the following table.
Apples Oranges Grapes
Mean
m
Standard deviation

8
10
7
0.9
1.1
2
Find the mean, variance and standard deviation of the
random variable y = weight of fruit in a small gift
basket.
Example 3 continued
It is reasonable in this case to assume that the
weights of the different types of fruit are
Apples Oranges Grapes
independent.
Mean
m
Standard deviation

8
10
7
0.9
1.1
2
a1  4, a2  6, a3  2, m1  8, m2  10, m3  7
1  0.9, 2  1.1, 3  2
m y  ma x a x
1
1
2
2
 a3 x 3
 a1m1  a2m2  a3m3
 4(8)  6(10)  2(7)  106
 2y  2a x a x
1
1
2
2
 a3 x 3
 a12 12  a 22 22  a3232
 42 (.9)2  6 2 (1.1)2  22 (2)2  72.52
y = 72.52  8.5159
Example 4
•
A nationwide standardized exam consists of a multiple choice and a
free response section. Each section, the mean and standard
deviation are reported to be:
Mean
Multiple Choice 38
Free Response 30
Standard
Deviation
6
7
• Let X1 = the score for multiple-choice and X2 = the score for the free
response.
• Suppose the total score is computed as Y = X1 + 2X2
• Find the mean and standard deviation for the test
Example 4 Continued
The Mean
mY  m X  2m X
1
2
 38  2(30)  98
The Standard Deviation
Are X1 and X2 independent?
It is likely that X1 and X2 are not independent
since a person who does well on multiple
choice section will also do well on the free
response section and vice versa.
Therefore, we can not calculate the standard
deviation with the given information.
Last Problem
• Suppose that the mean height of policemen is
70 inches with a standard deviation of 3 inches.
And suppose that the mean height for
policewomen is 65 inches with a standard
deviation of 2.5 inches.
•
If heights of policemen and policewomen are
Normally distributed, find the probability that a
randomly selected policewoman is taller than a
randomly selected policeman.
Last Problem - Continued
• Let X = height of policewoman and Y=
height of policeman.
• μX-Y = 65 – 70 = -5.
• σ2X-Y = σ2X + σ2Y = 2.52 + 32 = 15.25
• σX-Y =  2 X Y  3.905
• Using N(-5, 3.905) find P(X –Y < 0).
From the Calculator ( NormCDF ( -9999, 0, -5, 3.905)
P(X – Y < 0) = 0.8997
Summary
• The Law of Large Numbers says that the
average of the values of X observed in many
trials approach μ.
• If X is discrete with the possible values xi, the
means is the average of the values of X, each
weighted by its probability:
μX = x1p1 + x2p2 + … + xnpn
• The variance σ2 for a discrete variable:
σ2X = (x1 - μ)2p1 + (x2 – μ)2p2 + … + (xn - μ)2pn
• The standard deviation σX is the square root of
the variance.
Summary
The means and variance of random variables obey
the following rules
• If a and b are fixed numbers, then
μa + bX = a + b μX
σ2a+bX = b2σ2X
• If X and Y are any two random variables, then
μX + Y = μX + μY
• And if X and Y are independent, then
σ2 X + Y = σ2 X + σ2 Y
σ2X – Y = σ2X + σ2Y