Probability Slides
Probability Slides
Introduction to probability
Jørn Vatn/August-2020
Event
A = {operator error}
An event may occur, or not. We do not know the outcome in advance prior to
the experiment or a situation in “real life”.
1
Probability
When events are defined, the probabilities that the events occur are of
interest. Probability is denoted by Pr(·), i.e.
2
Set theory
3
Union
4
Intersection
5
Disjoint events/sets
A and B are said to be disjoint if they can not occur simultaneously, i.e. A ∩ B =
Ø = the empty set. Let A be the event that tossing a die results in a “six”, and B
be the event that we get an odd number of eyes. A and B are disjoint since
they cannot occur simultaneously, and we have A ∩ B = Ø.
6
Complementary event
The complement of an event A is all events in the sample space S except for A.
The complement of an event is denoted by AC . Let A be the event that tossing
a die results in an odd number of eyes. AC is then the event that we get an
even number of eyes.
7
Mapping of events on the interval [0,1]
8
Conditional probabilities
Pr(A|B) denotes the conditional probability that A will occur given that B has
occurred
9
Independent events
10
Some rules for probability calculus
11
The law of total probability
r
X
Pr(B) = Pr(Ai ) × Pr(B|Ai )
i=1
12
Example
Let
I D denote the event that a project is delayed
I WN denote that there is no work conflict
I WM denote that there is a minor work conflict
I WS denote that there is a severe work conflict
Further, assume
I Pr(D|WN ) = 0.1, Pr(WN ) = 0.8
I Pr(D|WM ) = 0.5, Pr(WM ) = 0.15
I Pr(D|WS = 0.9, Pr(WS ) = 0.05
13
Stochastic variables and their properties
Stochastic variables (=random quantities) are used to describe quantities
which can not be predicted exactly
14
How to represent stochastic variables?
15
Cumulative distribution function
A stochastic variable X is characterized by it’s cumulative distribution function
(CDF)
FX (x) = Pr(X ≤ x)
16
Probability density function
For a continuous stochastic variable, the probability density function (PDF) is
given by
d
fX (x) = FX (x)
dx
17
Expectation
18
Median and mode
19
Variance and standard deviation
The variance of a random quantity expresses the variation in the value X will
take in the long run:
R∞
[x − E(X )]2 · fX (x) dx if X is continuous
Var(X ) = −∞
[(xj − E(X )]2 · p(xj ) if X is discrete
P
j
20
Double expectation
If X and Y are stochastic variables then:
21
Example
Let
I X denote the duration of a project
I WN denote that there is no work conflict
I WM denote that there is a minor work conflict
I WS denote that there is a severe work conflict
where WN , WM and WS represent the Y . Further assume:
I E(X |WN ) = 10, Pr(WN ) = 0.8
I E(X |WM ) = 12, Pr(WM ) = 0.15
I E(X |WS = 20, Pr(WS ) = 0.05
E(X ) = E(X |WN ) Pr(WN ) + E(X |WM ) Pr(WM ) + E(X |WS ) Pr(WS ) = 10.8
22
Common probability distributions
Different distributions have different properties and usage. We review some
of them:
I The normal distribution is often used for aggregated situations, for
example if the total cost is the sum of various item costs
I The PERT and Triangular distribution is often used when we shall assess
the cost, duration etc for single elements where we ask an expert about a
low, high and most likely value (triple estimate)
I The exponential distribution is often used for simplicity, but it might also
be realistic in situation where for example the time to next failure does
not depend on the past
I The Weibull distribution is often used to model life times where time to
failure decreases with increasing age
In the textbook(TPK4120) and in the course compendia more comprehensive
presentations are given
23
The normal distribution
1 1 − (x−µ)2 2
fX (x) = √ e 2σ
2π σ
where µ and σ are parameters that characterise the distribution. The mean
and variance are given by:
E(X ) = µ
Var(X ) = σ2
24
Normal distribution, cont
The CDF cannot be found on closed form for the Normal distribution. In Excel
we may use the Normdist() function, and in pRisk.xlsm we may use the
CDFNormal() function.
1 u2
fU (u) = φ(u) = √ e − 2
2π
25
Standardized normal distribution
We then have
Zu Zu
1 t2
FU (u) = Φ(u) = φ(t)dt = √ e − 2 dt
2π
−∞ −∞
X −µ x −µ X −µ x −µ
FX (x) = Pr(X ≤ x) = Pr ≤ = Pr U ≤ =Φ
σ σ σ σ
26
Example
Let X be normally distributed with parameters µ = 5 and σ = 3. We will find
Pr(X ≤ 6):
6−µ 6−5
X −µ
Pr(X ≤ 6) = Pr ≤ = Pr U ≤
σ σ 3
1
=Φ ≈ Φ(0.33) ≈ 0.629
3
27
The traiangular distribution
The triangular distribution has a probability density function that comprises a
triangle:
2(x−L)
(
(M−L)(H−L) if L ≤ x ≤ M
fX (x) = 2(H−x)
(H−M)(H−L) if M ≤ x ≤ H
E(X ) = L + M3 + H
2 + M 2 + H 2 + LM + LH + MH
Var(X ) = L 6
28
The PERT distribution
The PERT distribution is defined by the lowest value (L), the most likely value
(M ), and the highest value (H):
(x − L)α1 −1 (H − x)α2 −1
fX (x) =
B(α1 , α2 )(H − L)α1 +α2 −1
4M+H−5L 5H−4M−L x−L
where α1 = H−L , α2 = H−L ,z = H−L and B(·, ·) is the beta function.
Bz (α1 , α2 )
FX (x) =
B(α1 , α2 )
where Bz (·, ·) is the incomplete beta function
The mean and variance are given by:
E(X ) = L + 4M
6
+H
30
Example
We will obtain the probability that X is greater than it’s expected value:
We will obtain the probability that X is greater than 2E(X ) given that X is
greater than E(X )
31
The Weibull distribution
X is said to be Weibull distributed if the probability density function of X is
given by:
fX (x) = αλ(λx)α−1 e −(λx)
α
32
Example
We will obtain the probability that X is greater than it’s expected value in the
Weibull situation where α = 2:
The probability that X is greater than 2E(X ) given that X is greater than E(X )
is given by:
33
Distribution of sums, products and maximum values
If X1 , X2 ,. . . ,Xn are random variables we have for of the sum of the x-es:
E(X1 + X2 + . . . + Xn ) = E E(Xi )
Xn Xn
Xi =
i=1 i=1
r
SD [SD(Xi )]2
Xn Xn
Xi =
i=1 i=1
Note that the equations for variance and standard deviations are only valid if
the x-es are stochastically independent
34
Sum of normally distributed stochastic variables
35
Central limit theorem
36
Generalized version of the central limit theorem
37
Weighted sum
38
Distribution of a random number of stochastic variables
Consider Y = N
P
i=1 Xi , where the Xi ’s are independent and identically
distributed stochastic variables. If N is fixed, we can easility find the expected
value and variance of Y . If N is a stochastic variable it is not obvious, but we
have:
I Wald’s formula:
N
!
E Xi = E(N)E(X )
X
i=1
I Blackwell–Girshick equation:
N
!
Var Xi = E(N)Var(X ) + E2 (X )Var(N)
X
i=1
39
Distribution of a product
If X1 , X2 ,. . . ,Xn are independent stochastic variables we might obtain the
expected value, the variance and the standard deviation of the product of the
x-es:
n n
!
E(X1 · X2 · . . . · Xn ) = E E(Xi )
Y Y
Xi =
i=1 i=1
The results for the variance and standard deviation are more complicated,
and we only present the results for n = 2:
40
Distribution of maximum values
In this situation we could easily obtain the distribution of the maximum of two
stochastic variables, but it is not so easy to obtain the expectation and variance
41
Distribution of maximum values, cont
Solution: The probability density function, fY (x) is the derivative of FY (x):
Z∞
E(Y ) = x · fY (x) dx =
−∞
Z∞
x · [fX1 (x)FX2 (x) + fX2 (x)FX1 (x)] dx
−∞
Z∞
Var(Y ) = [x − E(Y )]2 · [fX1 (x)FX2 (x) + fX2 (x)FX1 (x)] dx
−∞
42
The EMax() and VarMax() functions
I The EMax() and VarMax() functions in pRisk.xlsm are used to find the
expectation and variance of two independent normally distributed
stochastic variables
I The syntax is:
I EMax(µ1 , σ12 , µ2 , σ22 )
I VarMax(µ1 , σ12 , µ2 , σ22 )
I where µi and σi are the expected value and standard deviation for the two
variables respectively
I The routines are implemented by use of numerical integration
43
Thank you for your attention