Download Slide 16

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Statistics wikipedia , lookup

Transcript
Chapter 16
Random Variables
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Expected Value: Center

A random variable assumes a value based on the
outcome of a random event.
 We use a capital letter, like X, to denote a
random variable.
 A particular value of a random variable will be
denoted with a lower case letter, in this case x.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 2
Expected Value: Center (cont.)

There are two types of random variables:
 Discrete random variables can take one of a
finite number of distinct outcomes.


Example: Number of credit hours
Continuous random variables can take any
numeric value within a range of values.

Example: Cost of books this term
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 3
Expected Value: Center (cont.)


A probability model for a random variable
consists of:
 The collection of all possible values of a
random variable, and
 the probabilities that the values occur.
Of particular interest is the value we expect a
random variable to take on, notated μ (for
population mean) or E(X) for expected value.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 4
Expected Value: Center (cont.)

The expected value of a (discrete) random
variable can be found by summing the products
of each possible value by the probability that it
occurs:
  E  X    x  P  X  x

Note: Be sure that every possible outcome is
included in the sum and verify that you have a
valid probability model to start with.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 5
Expected Value – Example #1

An insurance company offers a “death and
disability” policy that pays $10,000 when you die
or $5000 if you are disabled. It charges a
premium of only $50 a year for this benefit.
Suppose the death rate is 1/1000 and another
2/1000 will be disabled. Is the company likely to
make a profit selling such a plan?
 Come up with a probability model
 Find the expected value
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 6
Policy Outcome
Death
Disability
Neither

x = payout
10,000
5,000
0
probability
1/1000
2/1000
997/1000
Expected Value for 1000 people:
10,000 for 1 person
5,0000 for 2 people
0 for 997 people = 20,000 payout or $20 per policy
So company has an average profit of $30 for every
policy
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 7
Expected Value Example #2

One of the authors took his minivan in for repair. The
mechanic identified the problem as dirt in the control unit.
He said that in about 75% of such cases, drawing down
an recharging the coolant a couple of times cleans up the
problem and costs $60. If it fails, then the control unit must
be replaced at an additional cost of $100 for parts and
$40 for labor.



A) Define the random variable and construct a
probability model
B) what is the expected value of the cost of the
repair?
C) what does that mean in this context?
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 8
Answer

Outcome
recharging
works
x= cost
$60
probability
.75
Replace unit
$200
.25
 60(.75) + 200(.25) = $95
 Car owners with this problem will spend an
average of $95 to get it fixed
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 9

Back to the Insurance problem…
 No individual policy actually costs the company
$20 – most cost $0
 Since we are dealing with random events, some
policyholders receive big payouts, others
nothing
 B/c insurance company must anticipate this
variability, we need to know the standard
deviation from the mean
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 10
Remember standard deviation?



How far from the average
To compute we took the deviation (difference)
from the mean and squared it – called variance
Take the square root to get the standard deviation
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 11
Finding Standard Deviation Example

Using the data from example #1, find the standard
deviation
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 12
Policy Outcome
Death
Disability
Neither
x = payout
10,000
5,000
0
probability Deviation
1/1000
(10000-20) = 9980
2/1000
(5000-20) = 4980
997/1000 (0-20) = -20
To Find the Variance:
Var(X) = 99802 (1/1000) + 49802 (2/1000) + (-20) 2 (997/1000)
= 149,600
SD = Square Root 149,600 = $386.78
The insurance company can expect an average payout of $20
per policy, with a standard deviation of $386.78
So this means that although payout is small there is a big risk
(Spread) for an average profit of $30
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 13
First Center, Now Spread…


For data, we calculated the standard deviation by
first computing the deviation from the mean and
squaring it. We do that with random variables as
well.
The variance for a random variable is:
  Var  X     x     P  X  x 
2
2

The standard deviation for a random variable is:
  SD  X   Var  X 
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 14
Practice


As the head of inventory for a computer company, you
ship 2 computers to your client the day the order arrived.
You find out that someone had restocked refurbished
computers in with new computers. The shipped computers
were selected randomly from 15 computers in stock, 4 of
those were refurbished .
If your client gets 2 new computers, things are fine. If the
client gets one refurbished computer, it will be sent back
at your expense $100 and you can replace it. If both are
refurbished, the client will cancel and you’ll lose $1000.
What’s the expected value and standard deviation of your
loss?
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 15
How do you find the Mean and
Standard Deviation in Calculator?






Using the previous example:
STAT – Edit - L1: enter values of variable
(0,100,1000)
L2: enter probability model (.524,.419, .057)
STAT CALC - 1: VarStats L1, L2 – enter
X = mean
σ = standard deviation
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 16
More About Means and Variances

Adding or subtracting a constant from data shifts
the mean but doesn’t change the variance or
standard deviation:
E(X ± c) = E(X) ± c
Var(X ± c) = Var(X)

Example: Consider everyone in a company
receiving a $5000 increase in salary.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 17
More About Means and Variances (cont.)

In general, multiplying each value of a random
variable by a constant multiplies the mean by that
constant and the variance by the square of the
constant:
E(aX) = aE(X) Var(aX) = a2Var(X)

Example: Consider everyone in a company
receiving a 10% increase in salary.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 18
More About Means and Variances (cont.)

In general,
 The mean of the sum of two random variables
is the sum of the means.
 The mean of the difference of two random
variables is the difference of the means.
E(X ± Y) = E(X) ± E(Y)

If the random variables are independent, the
variance of their sum or difference is always
the sum of the variances.
Var(X ± Y) = Var(X) + Var(Y)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 19
Example #5

Suppose the time it takes a customer to get and
pay for seats at the ticket window of a baseball
park is a random variable with a mean of 100
seconds and a standard deviation of 50 seconds.
When you get there, you find 2 people in line
 How long do you expect to wait for your turn to
get tickets?
 What’s the standard deviation of your wait time?
 What assumption did you make about the 2
customers in finding the standard deviation
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 20
Answer

100 + 100 = 200 seconds

√502 + 502 = 70.7 seconds
The times for the two customers are independent

Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 21
Continuous Random Variables



Random variables that can take on any value in a
range of values are called continuous random
variables.
Continuous random variables have means
(expected values) and variances.
We won’t worry about how to calculate these
means and variances in this course, but we can
still work with models for continuous random
variables when we’re given the parameters.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 22
Continuous Random Variables (cont.)



Good news: nearly everything we’ve said about
how discrete random variables behave is true of
continuous random variables, as well.
When two independent continuous random
variables have Normal models, so does their sum
or difference.
This fact will let us apply our knowledge of
Normal probabilities to questions about the sum
or difference of independent random variables.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 23
Example #6

The times required to pack a stereos can be
described with a Normal model with a mean of 9
minutes and standard deviation of 1.5 minutes.
The times for the boxing stage can also be
modeled as Normal, with a mean of 6 minutes
and standard deviation of 1 minute
 What is the probability that packing two
consecutive systems takes over 20 minutes
 What percentage of the stereo systems take
longer to pack than to box?
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 24
What Can Go Wrong?


Probability models are still just models.
 Models can be useful, but they are not reality.
 Question probabilities as you would data, and
think about the assumptions behind your
models.
If the model is wrong, so is everything else.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 25
What Can Go Wrong? (cont.)


Don’t assume everything’s Normal.
Watch out for variables that aren’t independent:
 You can add expected values for any two
random variables, but
 you can only add variances of independent
random variables.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 26
What Can Go Wrong? (cont.)



Don’t forget: Variances of independent random
variables add. Standard deviations don’t.
Don’t forget: Variances of independent random
variables add, even when you’re looking at the
difference between them.
Don’t forget: Don’t write independent instances of
a random variable with notation that looks like
they are the same variables.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 27
What have we learned?



We know how to work with random variables.
 We can use a probability model for a discrete
random variable to find its expected value and
standard deviation.
The mean of the sum or difference of two random
variables, discrete or continuous, is just the sum
or difference of their means.
And, for independent random variables, the
variance of their sum or difference is always the
sum of their variances.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 28
What have we learned? (cont.)

Normal models are once again special.
 Sums or differences of Normally distributed
random variables also follow Normal models.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Slide 16- 29