Statistics for Managers Using Microsoft Excel
(3rd Edition)
Chapter Basic Probability and Discrete Probability
Distributions
Chapter Topics
Basic probability concepts Sample spaces and events, simple
probability, joint probability
Conditional probability Statistical independence, marginal
probability
Bayes’s Theorem
Chapter Topics
The probability of a discrete random variable
Covariance and its applications in finance
Binomial distribution Poisson distribution Hypergeometric distribution
(continued)
Sample Spaces
Collection of all possible outcomes e.g.: All six faces of a die:
e.g.: All 52 cards in a deck:
Events
Simple event Outcome from a sample space with
one characteristic e.g.: A red card from a deck of cards
Joint event Involves two outcomes simultaneously e.g.: An ace that is also red from a
deck of cards
Visualizing Events
Contingency Tables
Tree Diagrams
Red 2 24 26
Black 2 24 26
Total 4 48 52
Ace Not Ace Total
Full Deck of Cards
Red Cards
Black Cards
Not an Ace
Ace
Ace
Not an Ace
Simple Events
The Event of a Triangle
There are 55 triangles in this collection of 18 objects
The event of a triangle AND blue in color
Joint Events
Two triangles that are blue
Special Events
Impossible evente.g.: Club & diamond on one card
draw Complement of event
For event A, all events not in A Denoted as A’ e.g.: A: queen of diamonds
A’: all cards in a deck that are not queen of diamonds
Null Event
Special Events Mutually exclusive events
Two events cannot occur together e.g.: -- A: queen of diamonds; B: queen of clubs
Events A and B are mutually exclusive Collectively exhaustive events
One of the events must occur The set of events covers the whole sample space e.g.: -- A: all the aces; B: all the black cards; C: all the
diamonds; D: all the hearts Events A, B, C and D are collectively exhaustive
Events B, C and D are also collectively exhaustive
(continued)
Contingency Table
A Deck of 52 Cards
Ace Not anAce
Total
Red
Black
Total
2 24
2 24
26
26
4 48 52
Sample Space
Red Ace
Full Deck of Cards
Tree Diagram
Event Possibilities
Red Cards
Black Cards
Ace
Not an Ace
Ace
Not an Ace
Probability
Probability is the numerical measure of the likelihood that an event will occur
Value is between 0 and 1 Sum of the probabilities of
all mutually exclusive and collective exhaustive events is 1
Certain
Impossible
.5
1
0
(There are 2 ways to get one 6 and the other 4)e.g. P( ) = 2/36
Computing Probabilities
The probability of an event E:
Each of the outcomes in the sample space is equally likely to occur
number of event outcomes( )
total number of possible outcomes in the sample space
P E
X
T
Properties of Probability
If A is an event and A’ is its complement then P(A) = 1-P(A’)
For any two events A and B P(AUB) = P(A) + P(B)-P(AB)
A B
A=(AB)U(AB’)P(A)=P(AB)+P(AB’)P(AUB)=P(B)+P(AB’) = P(B)+P(A)-P(AB)
Properties of Probability
If A subset of B then P(A)≤P(B)
AA
B
)()(
)'()()(
'
APBP
BAPAPBP
BAAB
Properties of Probability
)())()((
)()()()(
))()((
)()()()(
))(()()(
))(()(
CBAPCBPCAP
CPCAPBPAP
CBCAP
CPCAPBPAP
CBAPCPBAP
CBAPCBAP
Properties of Probability
)(1
....)(
)()()(
1
1
1
n
i in
kjikji
jiji
ii
n
i i
AP
AAAP
AAPAPAP
Computing Joint Probability
The probability of a joint event, A and B:
( and ) = ( )
number of outcomes from both A and B
total number of possible outcomes in sample space
P A B P A B
E.g. (Red Card and Ace)
2 Red Aces 1
52 Total Number of Cards 26
P
Joint Probability Using Contingency Table
Joint Probability
Marginal (Simple) Probability
n(A1 and B2) n(A1)
TotalEvent
n(A2 and B1)
n(A1 and B1)
Event
Total N(S)
A1
A2
B1 B2
n(B1) n(B2)
n(A2 and B2) n(A2)
Joint Probability Using Contingency Table
Joint Probability
Marginal (Simple) Probability
P(A1 and B2) P(A1)
TotalEvent
P(A2 and B1)
P(A1 and B1)
Event
Total 1
A1
A2
B1 B2
P(B1) P(B2)
P(A2 and B2) P(A2)
Computing Compound Probability
Probability of a compound event, A or B:( or ) ( )
number of outcomes from either A or B or both
total number of outcomes in sample space
P A B P A B
E.g. (Red Card or Ace)
4 Aces + 26 Red Cards - 2 Red Aces
52 total number of cards28 7
52 13
P
Compound Probability (Addition Rule)
P(A1 or B1 ) = P(A1) + P(B1) - P(A1 and B1)
P(A1)
P(B2)
P(A1 and B1) P(A1 and B2)
TotalEvent
P(A2 and B1)
Event
Total 1
A1
A2
B1 B2
P(B1)
P(A2 and B2) P(A2)
For Mutually Exclusive Events: P(A or B) = P(A) + P(B)
Computing Conditional Probability
The probability of event A given that event B has occurred:
( and )( | )
( )
P A BP A B
P B
E.g.
(Red Card given that it is an Ace)
2 Red Aces 1
4 Aces 2
P
P(A)
P(B’)
P(A and B)
Conditional Probability
P(A1 and B’)
TotalEvent
P(A’ and B)
Event
Total 1
A
A’
B B’
P(B)
P(A’ and B’) P(A)
( and )( | )
( )
P A BP A B
P B
Conditional Probability Using Contingency Table
BlackColor
Type Red Total
Ace 2 2 4
Non-Ace 24 24 48
Total 26 26 52
Revised Sample Space
(Ace and Red) 2 / 52 2(Ace | Red)
(Red) 26 / 52 26
PP
P
Example
A family has two children. What is the conditional probability that both are boys given that at least one of them is a boy ? Assume that the sample space S is given by S={(b,b),(b,g),(g,b),(g,g)}, and all outcomes are equally likely. [(b,g) means for instance that the older child is boy and the younger child is a girl.]
Solution
Letting E denote the event that both children are boys, and F the event that at least one of them is a boy, then the desired probability is given by
3/1
)|(
4/34/1
)}),(),,(),,({()}),({(
)()(
bggbbbPbbP
FPEFPFEP
Example
Bety can either take a course in mathematics or in statistics. If She takes the statistic course, then she will receive an A grade with probability ½ , while if she takes the math course then she will receive an A grade with prob. 1/3 . Bety decides to base her decision on the flip of fair coin. What is the prob that Bety will get an A in math ?
Solution
If we let F be the event that Bety takes math and E denote the event that she receives an A in whatever course she takes, then the prob is P(EF) = P(E|F)P(F) = 1/3.1/2 = 1/6. P(F) =1/2 , because Bety decides to base
her decision on the flip of fair coin.
Example
Suppose that each of three men at the party throws his hat into the center of the room. The hats are first mixed up and then each man randomly selects a hat. What is the probability that none of the three men selects his own hat ?
Solution
Let us denote by Ei ,i=1,2,3, the event that the ith man selects his own hat. The probability that none selects his own hat is
Now we compute
)(1 321 EEEP
)( 321 EEEP
32
61
61
313
1
61
61
31
21
31
33)(
.1
)()|()(
)()|()(
3,2,1,)(
i i
jijikkji
jjiji
i
EP
EEPEEEPEEEP
EPEEPEEP
iEP
Conditional Probability and Statistical Independence
Conditional probability:
Multiplication rule:
( and )( | )
( )
P A BP A B
P B
( and ) ( | ) ( )
( | ) ( )
P A B P A B P B
P B A P A
Conditional Probability and Statistical Independence
Events A and B are independent if
Events A and B are independent when the probability of one event, A, is not affected by another event, B
(continued)
( | ) ( )
or ( | ) ( )
or ( and ) ( ) ( )
P A B P A
P B A P B
P A B P A P B
Example A series system of two components, C1 and C2.
The probability C1 fail is 0.1 and C2 fail is 0.2 and both of them are independent.
The probability that the system fails is P(C1 fail U C2 fail) =P(C1 fail) + P(C2 fail) -
P(C1,C2 fail) = P(C1 fail) + P(C2 fail) - P(C1 fail)xP(C2 fail)
C1 C2
Example A paralel system of two components, C1 and C2.
The probability C1 fail is 0.1 and C2 fail is 0.2 and both of them are independent.
The probability that the system fails is P(C1 fail and C2 fail) =P(C1 fail).P(C2 fail)
=0.1x0.2 = 0.02
C1
C2
Total Probability
Let E and F be events. We may express E as E = EF U EF’ , since both of them are abviously mutually exclusive, we have that P(E) = P(E|F)P(F) + P(E|F’)P(F’)
If F can be separated by F1 , F2 , …, F k and each of them mutually exclusive then P(E) = P(E|F1)P(F1) + …+ P(E|Fk)P(Fk
)
Bayes’s Theorem
1 1
||
| |
and
i ii
k k
i
P A B P BP B A
P A B P B P A B P B
P B A
P A
Adding up the parts of A in all the B’s
Same Event
Bayes’s Theorem Using Contingency Table
Fifty percent of borrowers repaid their loans. Out of those who repaid, 40% had a college degree. Ten percent of those who defaulted had a college degree. What is the probability that a randomly selected borrower who has a college degree will repay the loan?
R = Repaid ; C = College
.50 | .4 | .10P R P C R P C R | ?P R C
Bayes’s Theorem Using Contingency Table
||
| |
.4 .5 .2 .8
.4 .5 .1 .5 .25
P C R P RP R C
P C R P R P C R P R
(continued)
Repay
Repay
CollegeCollege 1.0.5 .5
.2
.3
.05.45
.25.75
Total
Total
Example
In answering a question on a multiple choice test, a student either knowns the answer of he guesses . Let p be the prob that she knows the answer. There are m multiple-choice alternatives. What is the conditional that a student knew the answer to a question given that she answered it correctly ?
Solution
Let C and K denote respectively the event that the student answers the question correctly and the event that she actually knows the answer. Now
pmpp
KPKCPKPKCPKPKCPCKP
1/11
)'()'|()()|()()|()|(
Example
A laboratory blood test is 95 percent effective in detecting a certain disease when it is, in fact present. However, the test also yields a “ false positive” result for 1 percent of the healthy persons tested. If 0.5 percent of the population actually has the disease, what is the prob a person has the disease given that his test result is positive ?
Solution
Let D be the event that the tested person has the disease, and E the event that his test result is positive.
323.0
)|(
995.01.0005.095.0005.095.0
)'()'|()()|()()|(
DPDEPDPDEPDPDEPEDP
Random Variable
Random Variable Outcomes of an experiment expressed
numerically e.g.: Toss a die twice; count the number of
times the number 4 appears (0, 1 or 2 times)
Discrete Random Variable
Discrete random variable Obtained by counting (1, 2, 3, etc.) Usually a finite number of different values e.g.: Toss a coin five times; count the
number of tails (0, 1, 2, 3, 4, or 5 times)
Probability Distribution Values Probability
0 1/4 = .25
1 2/4 = .50
2 1/4 = .25
Discrete Probability Distribution Example
T
T
T T
Event: Toss two coins
Count the number of tails
Example
Suppose we toss a coin having a prob p of coming up heads, until the first head appears. Letting N denote the number of flips required, then assuming that the outcome of successive flips are independent, N is a random variable taking on one of the values 1,2,3,…with respective probabilities
Solution
P(N=1) = P(H) = p; P(N=2) = P({T,H}) = (1-p)p ; : P(N=n) = P({T,…,T,H})= (1-p)n-1 p, n>=1
As a check, note that
1
)1(
}{}{
1
1
11
n
n
nn
pp
nNPnNP
Discrete Probability Distribution
List of all possible [Xj , p(Xj) ] pairs
Xj = value of random variable
P(Xj) = probability associated with value
Mutually exclusive (nothing in common)
Collectively exhaustive (nothing left out)
0 1 1j jP X P X
Summary Measures
Expected value (the mean) Weighted average of the probability
distribution
e.g.: Toss 2 coins, count the number of tails, compute expected value
j jj
E X X P X
0 2.5 1 .5 2 .25 1
j jj
X P X
Summary Measures
Variance Weight average squared deviation about the
mean
e.g. Toss two coins, count number of tails, compute variance
(continued)
222j jE X X P X
22
2 2 2 0 1 .25 1 1 .5 2 1 .25 .5
j jX P X
Covariance and its Application
1
th
th
th
: discrete random variable
: outcome of
: discrete random variable
: outcome of
: probability of occurrence of the
outcome of an
N
XY i i i ii
i
i
i i
X E X Y E Y P X Y
X
X i X
Y
Y i Y
P X Y i
X
thd the outcome of Yi
Correlation
The correlation coefficient of X and Y is
YX
XY
Computing the Mean for Investment Returns
Return per $1,000 for two types of investments
P(XiYi) Economic condition Dow Jones fund X Growth Stock Y
.2 Recession -$100 -$200
.5 Stable Economy + 100 + 50
.3 Expanding Economy + 250 + 350
Investment
100 .2 100 .5 250 .3 $105XE X
200 .2 50 .5 350 .3 $90YE Y
Computing the Variance for Investment Returns
P(XiYi) Economic condition Dow Jones fund X Growth Stock Y
.2 Recession -$100 -$200
.5 Stable Economy + 100 + 50
.3 Expanding Economy + 250 + 350
Investment
2 2 22 100 105 .2 100 105 .5 250 105 .3
14,725 121.35X
X
2 2 22 200 90 .2 50 90 .5 350 90 .3
37,900 194.68Y
Y
Computing the Covariance for Investment Returns
P(XiYi) Economic condition Dow Jones fund X Growth Stock Y
.2 Recession -$100 -$200
.5 Stable Economy + 100 + 50
.3 Expanding Economy + 250 + 350
Investment
The Covariance of 23,000 indicates that the two investments are positively related and will vary together in the same direction.
100 105 200 90 .2 100 105 50 90 .5
250 105 350 90 .3 23,300
XY
Correlation
The correlation coefficient of X and Y is
If the value of X increase, then the value of Y increase too.
986.068.19435.121300,23
Cumulative Distribution Function
The cumulative distribution function of a random variable X is defined for any real x by
xx
i
dttf
xfxXPxF i
)(
)()()(
Example
Consider the distribution of lifetimes , X (in months), of a particular type of component. We will assume that the CDF has the form
The median lifetime is
0;1)(2
3 )( xexFx
monthsm
e
mF
m
m
m
498.2
)5.0ln(
)5.0ln(
5.01
5.0)(
2/13
2
3
23
It is desired to find the time t such that 10% of the component fail before t. This is the 10th percentile :
Thus if the components are guaranteed for one month, slightly more than 10% will need to be replaced
monthsx
x
e
xF
x
x
974.0
)]5.0ln([3
)9.0ln(
1.01
1.0)(
2/1
2
3
23
Important Discrete Probability Distributions
Discrete Probability Distributions
Binomial Hypergeometric Poisson
Binomial Probability Distribution
‘n’ identical trials e.g.: 15 tosses of a coin; ten light bulbs
taken from a warehouse Two mutually exclusive outcomes on
each trials e.g.: Head or tail in each toss of a coin;
defective or not defective light bulb Trials are independent
The outcome of one trial does not affect the outcome of the other
Binomial Probability Distribution
Constant probability for each trial e.g.: Probability of getting a tail is the same
each time we toss the coin Two sampling methods
Infinite population without replacement Finite population with replacement
(continued)
Binomial Probability Distribution Function
Tails in 2 Tosses of Coin
X P(X) 0 1/4 = .25
1 2/4 = .50
2 1/4 = .25
!1
! !
: probability of successes given and
: number of "successes" in sample 0,1, ,
: the probability of each "success"
: sample size
n XXnP X p p
X n X
P X X n p
X X n
p
n
Proof of the Probability
Note that, by the binomial theorem, the probabilities sum to one, that is
n
xnxn
x
pp
ppx
nxp
))1((
)1()(0
Binomial Distribution Characteristics
Mean E.g.
Variance and Standard Deviation
E.g.
E X np 5 .1 .5np
n = 5 p = 0.1
0.2.4.6
0 1 2 3 4 5
X
P(X)
1 5 .1 1 .1 .6708np p
2 1
1
np p
np p
Expectation
np
ppnp
ppnp
pp
ppx
nxXE
n
k
knkkkn
n
n
x
xnxxxn
n
n
x
xnxxxn
n
n
x
xnx
1
0
1)!()!1(
)!1(
1
1)!1()!(
)!1(
1)!1()!(
!
0
)1(
)1(
)1(
)1()(
Variance
2
2
0
2)!()!2(
)!2(2
2
2)!2()!(
)!2(2
2)!2()!(
!
0
)1(
)1()1(
)1()1(
)1(
)1()1())1((
pnn
pppnn
pppnn
pp
ppx
nxxXXE
n
k
knkkkn
n
n
x
xnxxxn
n
n
x
xnxxxn
n
n
x
xnx
Binomial Distribution in PHStat
PHStat | probability & prob. Distributions | binomial
Example in excel spreadsheet
Microsoft Excel Worksheet
Example
S uppose that an airplane engine will fall, when in flight, with prob 1-p independently from engine to engine; suppose that the airplane will make a succesful flight if at least 50 percent of its engines remain operative. For what values of p is a four-engine plane preferable to a two-engine plane ?
Solution
The probaility that a four-engine plane makes a successful flight is
Whereas the corresponding probability for a two-engine plane is
4
2
43224 )1(4)1(614
x
xx pppppppx
2
1
22 )1(212
x
xx pppppx
Solution
Hence the four-engine is safer if
Hence, the four-engine plane is safer when the engine success probability is at least as large as 2/3 , whereas the two-engine plane is safer when this probability falls below 2/3
32
24322
023
)1(2)1(4)1(6
p
p
pppppppp
Poisson Distribution
Poisson Process: Discrete events in an “interval”
The probability of One Successin an interval is stable
The probability of More thanOne Success in this interval is 0
The probability of success isindependent from interval to interval
e.g.: number of customers arriving in 15 minutes
e.g.: number of defects per case of light bulbs
P X x
x
x
( |
!
e-
Poisson Probability Distribution Function
e.g.: Find the probability of 4 customers arriving in 3 minutes when the mean is 3.6.
3.6 43.6
.19124!
eP X
!
: probability of "successes" given
: number of "successes" per unit
: expected (average) number of "successes"
: 2.71828 (base of natural logs)
XeP X
XP X X
X
e
Poisson Distribution in PHStat
PHStat | probability & prob. Distributions | Poisson
Example in excel spreadsheet
Microsoft Excel Worksheet
Poisson Distribution Characteristics
Mean
Standard Deviationand Variance
1
N
i ii
E X
X P X
= 0.5
= 6
0.2.4.6
0 1 2 3 4 5
X
P(X)
0.2.4.6
0 2 4 6 8 10
X
P(X)
2
Approximate a binomial to poisson
An important property of the poisson random variable is that it may be used to approximate a binomial random variabel when the binomial parameter n is large and p is small. To see this, suppose that X is a binomial r.v. with parameters (n,p), and let µ = np. Then
Proof
1;1)/1(;/1
1)(
)1)...(1(
!
)/1(
/1!
)1)...(1(
!)!(!
i
i
i
ni
i
n
innnin
i
n
nin
innn
in
n
i
niinn
nen
e
iXP
Expectation
ee
e
XE
xx
xx
e
xx
xe
x
xxx
1)!1(
1)!1(
0!
1
1
)(
Variance
1
1
1
1))1((
2)!2(
2)!2(
0!
)1(
2
2
ee
e
XXE
xx
xx
e
xxexx
x
xxx
Hypergeometric Distribution
“n” trials in a sample taken from a finite population of size N
Sample taken without replacement Trials are dependent Concerned with finding the probability of
“X” successes in the sample where there are “A” successes in the population
Hypergeometric Distribution Function
E.g. 3 Light bulbs were selected from 10. Of the 10 there were 4 defective. What is the probability that 2 of the 3 selected are defective?
4 6
2 12 .30
10
3
P
: probability that successes given , , and
: sample size
: population size
: number of "successes" in population
: number of "successes" in sample
0,1,2,
A N A
X n XP X
N
n
P X X n N A
n
N
A
X
X
,n
Hypergeometric Distribution Characteristics
Mean
Variance and Standard Deviation
AE X n
N
22
2
1
1
nA N A N n
N N
nA N A N n
N N
FinitePopulationCorrectionFactor
Hypergeometric Distribution in PHStat
PHStat | probability & prob. Distributions | Hypergeometric …
Example in excel spreadsheet
Microsoft Excel Worksheet
Expectation
0
)(
)(
22
22
22
2/)(
21
2/)(
21
2/)(
21
dxe
xdex
dxxeXE
x
x
x
Variance
2
)(
2
2/2
2
2/)(2
212
22
2
dyey
deXE
y
xxx
Jointly Distributed Random Variables
The joint probability mass function of X and Y is p(x,y)=P(X=x,Y=y)
The probability mass function of X
The probability mass function of Y
dyyxf
yxpxp y
,
),()(
dxyxf
yxpyp x
,
),()(
Expectation
)(...)()...(
)()(
)()(
),(),(
),()(
11 nn XEXEXXE
YEXE
dyyyfdxxxf
dydxyxfydxdyyxfx
dxdyyxfyxYXE
Example As another example of the usefulness of
equation above, let us use it to obtain the expectation of a binomial r.v.
pqXVpXEfailed
succesX iii
)(;)(;,0
,1
npqXVXVXV
npXEXEXE
XXX
n
n
n
)(...)()(
)(...)()(
...
1
1
1
Example
At a party N men throw their hats into the center of a room. The hats are mixed up and each man randomly selects one. Find the expected number of men that select their own hats
Solution
Letting X denote the number of men that select their own hats, we can best compute E(X) by noting that X = X1+…+XN ; where Xi is indicator function if the ith man select his own hat. So P(Xi = 1) = 1/N. And so E(Xi) = 1/N. Hence We obtain that E(X) = 1. So, no matter how many people are at the party, on the average exactly one of the men will select his own hat.
Independent R.V
X and Y are independent if
)()(),(
)()(),(
yfxfyxf
ypxpyxp
)()(
)()(
)()(
),()(
YEXE
dyyyfdxxxf
dxdyyfxxyf
dxdyyxxyfXYE
Covariance and Variance of Sums of Random Variables
The covariance of any two random variables X and Y, denoted by Cov(X,Y), is defined by
Cov(X,Y) = E[(X-E[X])(Y-E[Y])]
= E(XY)-E(X)E(Y) If X and Y are independent Cov(X,Y) = 0
Properties of Covariance
Cov(x,X) = Var(X) Cov(cX,Y) = c Cov(X,Y) Cov(X,Y+Z)= E[X(Y+Z)]-E[X]E[Y+Z]
= E[XY]-E[X]E[Y] + E[XZ]-E[X]E[Z]
= (Cov(X,Y) + Cov(X,Z)The last property easily generalizes to
give ),(, jiji YXCovYXCov
Variance of Sum Variabel
n
i
n
ijji
n
ii
n
i
n
ijji
n
iii
n
i
n
jji
n
ji
n
ii
n
ii
XXCovXV
XXCovXXCov
XXCov
XXCovXVar
11
11
1 1
111
),(2)(
),(),(
),(
,
Proposition
Suppose that X1,…,Xn are independent and identically distributed with expected value µ and variance σ2. Then
nn
ijjiniin
jij
iin
ii
XVarXXCovXXCov
XVarXXXCov
XXCovXXCovXXXCov
22
0
)()(),(
)(),(
),(),(),(
11
1
Example
Sums of independent Poisson Random Variables : Let A and Y be independent Poisson random variables wirh respective means λ1 and λ2 . Calculate the distribution of X + Y.
Solution : Since the event {X+Y = n} may be written as the union of the disjoint events {X=k,Y=n-k}, 0≤k≤n, we have
nne
n
k
knkknk
nn
e
n
kknk
n
k
n
k
knk
ee
knYPkXP
knYkXPnYXP
21!
021)!(!
!!
0)!(!
0
0
21
21
2211
}{}{
},{)(
Top Related