Download Week5

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

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability wikipedia , lookup

Probability interpretations wikipedia , lookup

Transcript
Discrete Distributions
Week 5
Objectives
•
•
•
•
On completion of this module you should be
able to:
find expected value, variance and standard
deviation for a discrete random variable,
calculate and interpret covariance,
determine the appropriateness of the binomial
distribution for certain situations,
calculate probabilities of events for the binomial
distribution,
2
Objectives
On completion of this module you should be
able to:
• determine the appropriateness of the Poisson
distribution for certain situations and
• calculate probabilities of events for the Poisson
distribution.
3
Example 5-1
The CEO of a large corporation is concerned
that the corporations intranet has been
suffering with a number of faults and is
unavailable much of the time.
He arranges for the collection of data which
details the number of times where the intranet
has been down, and for how long, over the last
three hundred business days.
The results are given on the following slide:
4
Example 5-1
Hours unavailable
Frequency
(per day)
0
210
1
24
2
30
3
24
4
6
5
0
6
6
a) Form the
probability
distribution
for the
number of
hours per day
the intranet
was down.
5
Solution 5-1
Hours unavailable Frequency
0
210
1
24
2
30
3
24
4
6
5
0
6
6
Total
300
6
Solution 5-1
Hours unavailable Frequency Probability
0
210
1
24
2
30
3
24
4
6
5
0
6
6
Total
300
210
= 0.7
300
24
=
= 0.08
300
30
=
= 0.1
300
24
=
= 0.08
300
6
=
= 0.02
300
0
=
=0
300
6
=
= 0.02
300
=
7
Solution 5-1
Hours unavailable Probability
(X)
P(X)
0
0.7
1
0.08
2
0.1
3
0.08
4
0.02
5
0
6
0.02
This is the
probability
distribution.
8
P(X)
0.7
0.6
How can we tell what
we might expect to
happen “on average”?
0.5
0.4
0.3
0.2
0.1
0.0
0
1
2
3
4
Hours unavailable per day (X)
5
6
9
Expected value of a discrete random variable
• The mean μ of a probability distribution is the
expected value of its random variable.
N
  E  X    XiP Xi 
i 1
where
X i  the ith outcome of X (the discrete
random variable of interest)
P  X i   probability of occurrence of the ith
outcome of X
10
Example 5-1
(b) Compute the mean or expected number of
hours that the intranet will be down per day.
N
  E  X    XiP Xi 
i 1
 0  0.7  1 0.08 
 6  0.02
 0.72
Thus we can expect the intranet to be down for
0.72 of an hour, or about 43 minutes, each day.
11
Variance of a discrete random variable
• The variance 2 of a probability distribution is:
N
    X i  E  X   P  X i 
2
2
i 1
• The standard deviation 2 of a probability
distribution is:
  
2
N
  X
i 1
 E  X   P  X i 
2
i
12
Example 5-1
(c) Compute the standard deviation.
N
    X i  E  X   P  X i 
2
2
i 1
  0  0.72   0.7   1  0.72   0.08  
2
2
  6  0.72   0.02 
2
 1.7216
   2  1.7216  1.3121 (to 4 dec. pl.)
13
Example 5-1
(d) What is the probability that on any given day
the intranet will be down for fewer than two
hours?
P  fewer than 2 hours   P  X  2 
 P  X  0   P  X  1
 0.7  0.08
 0.78
So the probability that the intranet will be down
for fewer than two hours is 0.78.
14
Example 5-1
(e) What is the probability that on any given day
the intranet will not be down at all?
P  0 hours   P  X  0 
 0.7
So the probability that the intranet will not be
down at all is 0.7.
15
Example 5-1
(f) What is the probability that on any given day the
intranet will be down for at least three hours?
P  at least 3 hours   P  X  3
 P  X  3  P  X  4   P  X  5   P  X  6 
 0.08  0.02  0  0.02
 0.12
So the probability that the intranet will be down
at least three hours is 0.12.
16
Expected value of the sum of two random
variables
The expected value of the sum of two random
variables is equal to the sum of the expected
values.
E  X  Y   E  X   E Y 
17
Variance of the sum of two random
variables
The variance of the sum of two random variables is
equal to the sum of the variances plus twice the
covariance.
var  X  Y    X2 Y   X2   Y2  2 XY
Standard deviation of the sum of two
random variables
 X Y   X2 Y
18
Example 5-2
One of your clients is deciding how they should
invest a sum of money.
They have obtained a report giving the predicted
annual return for a $1000 investment in two
different stocks.
The following probability distribution was included
in the report.
Probability
0.2
Stock P
-$50
Stock K
-$105
0.2
0.4
0.2
$10
$30
$100
$2
$25
$200
19
Example 5-2
Let X = stock P and Y = stock K.
(a) Find the expected return of stock P.
N
E  X   X   XiP  Xi 
i 1
 50  0.2   10  0.2   30  0.4   100  0.2 
 $24
(b) Find the expected return of stock K.
N
E Y   Y   Yi P Yi 
i 1
 105  0.2   2  0.2   25  0.4   200  0.2 
 $29.40
20
Notes on rounding answers
• All final answers that are money amounts
should be rounded to exactly 2 decimal places
(for dollars and cents).
• The only exception is if the value is whole
dollars, when 0 decimal places are acceptable.
• But, don’t round intermediate steps of working
or you will introduce a rounding error (and be
marked wrong in assessment items).
• Correct: $4.57 $100.95 $5,984.56 $495
• Incorrect: $4.6
$100.9543


21
Example 5-2
(c) Find the standard deviation for stock P.
N
var  X       X i  E  X   P  X i 
2
X
2
i 1
  50  24   0.2    20  24   0.2 
2
2
  30  24   0.4   100  24   0.2 
2
2
 2304
 X   X2  2304  $48
22
Example 5-2
(d) Find the standard deviation for stock K.
N
var Y      Yi  E Y   P Yi 
2
Y
2
i 1
  105  29.4   0.2    2  29.4   0.2 
2
2
  25  29.4   0.4    200  29.4   0.2 
2
2
 9591.44
 Y   Y2  9591.44  $97.94
23
Covariance
The covariance between two discrete random
variables X and Y is
N
 XY    X i  E  X   Yi  E Y  P  X iYi 
i 1
24
Example 5-2
(d) Find the covariance of stock P and stock K.
N
 XY    X i  E  X   Yi  E Y  P  X iYi 
i 1
  50  24  105  29.4  0.2 
 10  24  2  29.4  0.2 
  30  24  25  29.4  0.4 
 100  24  200  29.4  0.2 
 4648.4
25
Example 5-2
•
•
•
Based on your answers above, what
recommendations might you make to the client.
Explain.
Stock K has higher expected return and a
higher standard deviation – higher return but
higher risk.
Recommend stock K to client if they are willing
to take a higher risk, but stock P if they want a
safer investment.
Covariance is positive – there is positive
relationship between the stock – as one
increases so does the other.
26
Portfolio expected return
The portfolio expected return for a two-asset
investment is:
E  P   wE  X   1  w E Y 
where E  P   portfolio expected return
w  portion assigned to asset X
1  w   portion assigned to asset Y
E  X   expected return of asset X
E Y   expected return of asset Y
27
Portfolio risk
 p  w   1  w  Y2  2w 1  w XY
2
2
X
2
28
Example 5-3
Returning to the scenario in Example 5-2,
compute the portfolio expected return and the
portfolio risk if 90% of the stock is invested in
stock P.
Repeat when 50% of the stock is invested in
stock P.
29
Solution 5-3
• When 90% of the stock is invested in stock P,
w = 0.9 and
E  P   wE  X   1  w E Y 
 0.9  24    0.1 29.4   $24.54
 p  w   1  w  Y2  2w 1  w XY
2

2
X
2
 0.9   2304    0.1  9591.44   2  0.9  0.1 4648.4 
2
2
 $52.90
30
Solution 5-3
• When 50% of the stock is invested in stock P,
w = 0.5 and
E  P   0.5  24    0.5 29.4   $26.70
p 
 0.5  2304    0.5  9591.44   2  0.5  4648.4 
2
2
2
 $72.79
• Although both investment schemes are fairly
risky, investing 50% in stock P offers a better
return but much larger risk!
31
Binomial distribution
The binomial distribution is appropriate if:
• there are a fixed number of trials, n.
• there are two possible outcomes for each trial:
success (the desired outcome) and failure.
• the probabilities of success (p) is constant
over all observations (the probability of failure
is therefore given by 1-p).
• trials are independent.
32
Binomial distribution
• The binomial distribution is given by:
n!
n X
X
P X  
p 1  p 
X ! n  X !
where
P(X) = probability of X successes
n = number of trials (sample size)
p = probability of success
X = number of successes
• We can use this formula, tables or Excel/PHStat2
(discussed in workshops) to find probabilities
(make sure you can do all three!).
33
Example 5-4
An accountant works mainly with personal
income tax cases.
He knows from past experience that the
probability of a customer being satisfied with the
service he offers is 0.8.
Given that he sees 8 clients today, determine
the probability that:
(a) all 8 customers are satisfied
34
Solution 5-4
We are told that n = 8 (he sees 8 clients), p = 0.8
and X = 8 (8 customers are satisfied – success).
n!
n X
X
P X  x 
p 1  p 
X ! n  X !
8!
88
8
P  X  8 
0.8 1  0.8 
8! 8  8 !
 1 0.8  0.2 
8
0
 0.1678 (to 4 dec. pl.)
So the probability that the accountant will have
exactly 8 satisfied customers is 0.1678.
35
Solution 5-4
(b) at least 6 customers are satisfied.
n = 8 and p = 0.8
P  X  6   P  X  6   P  X  7   P  X  8
Using the binomial tables, find n and p, and
then the relevant probabilities are:
 0.2936  0.3355  0.1678
 0.7969
The probability that the accountant will have at
least 6 satisfied customers in the day is 0.7969.
36
Solution 5-4
OR calculate each probability using the
binomial formula as below (we do not need to
recalculate the probability that 8 customers are
satisfied):
8!
8 6
6
P  X  6 
0.8 1  0.8   0.2936
6! 8  6 !
8!
8 7
7
P  X  7 
0.8 1  0.8   0.3355
7! 8  7 !
37
Solution 5-4
(c) fewer than 5 customers are satisfied.
P  X  5  P  X  0   P  X  1  P  X  2 
 P  X  3  P  X  4 
OR
 1  P  X  8  P  X  7   P  X  6 
 P  X  5
 1  0.1678  0.3355  0.2936  0.1468
 0.0563
So the probability that the accountant will have
less than 5 satisfied customers is 0.0563.
38
Solution 5-4
(d) What assumptions are necessary in (a) to (c)?
• Trials are independent – the outcome for one
customer does not affect other customers.
– Note: Is this actually true? Do customers
make recommendations to others? Can we
prove that the assumption has been violated?
• There are only two possible outcomes: satisfied
(success) and not satisfied (failure).
Normally we would check the assumptions
prior to doing any calculations!!
39
Mean and standard deviation of the
binomial distribution
  E  X   np
    np 1  p 
2
40
Solution 5-4
(e) What are the mean and standard deviation of
the probability distribution?
  E  X   np  8  0.8  6.4
  np 1  p   8  0.8 0.2   1.1314 (to 4 dec. pl.)
41
Poisson distribution
The Poisson distribution is appropriate if:
• you are interested in the rate at which some
event occurs (in a particular time, area etc)
• events are rare
• events are random and independent
(The textbook goes in to more detail – make
sure you read this…)
42
Poisson distribution
• The Poisson distribution is given by:
 X
e 
P X  
X!
where P(X) = probability of X successes given
knowledge of 
 = expected number of successes
e = constant (2.71828…)
X = number of successes per unit
• We can use this formula, tables or Excel/PHStat2
(discussed in workshops) to find probabilities
(make sure you can do all three!).
43
Example 5-5
A new call centre is being set up for a large
telephone company.
Based on experience at their other similar
centres, they expect that calls will come in at an
average of 10 per minute.
In order to plan their staffing requirements, the
company would like to answer the following
questions:
(a) What is the probability that less than five calls
will be received in any given minute?
44
Solution 5-5
• We know that  = 10.
P  X  5  P  X  0   P  X  1  P  X  2 
 P  X  3  P  X  4 
• Since this would be a lot of values to calculate,
we’ll look this up in tables (Table E.7 in the
text)…
P  X  5   0.000  0.0005  0.0023  0.0076
 0.0189
 0.0293
45
Solution 5-5
• So the probability that the company receives
less than five calls in a given minute is 0.0293.
• We’ll look at two examples of using the formula
to do the calculations:
e  X
P X  
X!
e 10102
P  X  2 
 0.0023 (4 dec. pl.)
2!
10
4
e 10
P  X  4 
 0.0189 (4 dec. pl.)
4!
46
Example 5-5
(b) What is the probability that at least twenty
calls will be received in any given minute?
P  X  20   P  X  20   P  X  21  P  X  22 
 0.0019  0.0009  0.0004
 0.0002  0.0001 
 0.0035
Note: probabilities
for X=25, 26, …
exist but are
effectively zero to
4 decimal places.
So the probability that the company will receive
at least twenty calls in a given minute is 0.0035.
47
Example 5-5
(c) What is the probability that between seven and
thirteen calls will be received in any given
minute?
P  7  X  13  P  X  8   P  X  9   P  X  10 
 P  X  11  P  X  12 
 0.1126  0.1251  0.1251  0.1137
 0.0948
 0.5713
So the probability that the company will receive
between seven and thirteen calls in a given
minute is 0.5713.
48
After the lecture each week…
• Review the lecture material
• Complete all readings
• Complete all of recommended problems
(listed in SG) from the textbook
• Complete at least some of additional problems
• Consider (briefly) the discussion points prior to
tutorials
49