Asefch05_3_Simulation

advertisement
Simulation
 Simulation helps us to understand the consequences of
uncertainty. The probability of completion time or cost of
a single task, a set of tasks, or the project does not
exceed a specific value.
 We can estimate Beta distribution with Triangular
distribution.
 Traditional Statistics vs. Simulation
 Both must enumerate all the paths
 Traditional statistics assume path interdependence while
simulation does not
3/23/2016
Ardavan Asef-Vaziri
5-3-1
Triangular Probability Distributions
a
m
b
a = smallest value the variable can assume
b = largest value the variable can assume
m = most likely value the variable can assume
Expected Value of x
Variance of x
3/23/2016
 µ = (a +m+ b)/3
 s 2 = (a2 + m2 +b2 – ab- am-bm)/18
Ardavan Asef-Vaziri
5-3-2
Generate a Triangular Random Variable
Compute the height of this triangle
AreaL  (m  a) 
1
ma

(b  a) b  a
Similarly, the area to the right is
H= 2/(b-a)
a
m
b
1
bm
AreaR  (b  m) 

(b  a) b  a
Generate a random number if rand() ≤ (m-a)/(b-a) we are on the
left, otherwise on the right
3/23/2016
Ardavan Asef-Vaziri
5-3-3
Triangular Probability Distributions
Suppose we are on the left
Then the triangular random variable
is something like X
H
h
a
X
m
b
What is the height associated with X?
h X a

H ma
 hH
X a
ma
The area to the left of X is then
3/23/2016
Ardavan Asef-Vaziri
2( X  a)
 h
(m  a)(b  a)
Area LX
h( X  a )

2
5-3-4
Triangular Probability Distributions
h( X  a )
Area LX 
2
2( X  a)
h
(m  a)(b  a)
H
h
a
( X  a)

(m  a)(b  a)
X
m
b
2
AreaLX
The area to the left of X was our
rand() which happened to drop
on the left
3/23/2016
( X  a) 2
Rand () 
(m  a)(b  a)
Ardavan Asef-Vaziri
5-3-5
Triangular Probability Distributions
( X  a)
Rand () 
(m  a)(b  a)
2
H
h
a
( X  a)  (m  a)(b  a) Rand ()
X
m
b
2
X  a  (m  a)(b  a) Rand ()
Generate a random number if ≤ (m-a)/(b-a) we are on the left, and
implement the above equation to generate the random variable,
otherwise we are on the right
3/23/2016
Ardavan Asef-Vaziri
5-3-6
Triangular Probability Distributions
We showed that for X on the left
AreaLX
( X  a) 2

(m  a)(b  a)
H
h
a
m
b
X
Similarly, we can show that if X is on the right of m, the area to the
right of h is
(b  X )

(b  m)(b  a)
2
AreaRX
This is the area to the right of X, but the area to the left of X was
equal to Rand()  The area to the right of X is equal to 1- Rand()
3/23/2016
Ardavan Asef-Vaziri
5-3-7
Triangular Probability Distributions
(b  X )

(b  m)(b  a)
2
AreaRX
H
(b  X )
1  Rand () 
(b  m)(b  a)
h
2
a
m
b
X
(b  X ) 2  (b  m)(b  a)(1  Rand ())
X  b  (b  m)(b  a)(1  Rand ())
3/23/2016
Ardavan Asef-Vaziri
5-3-8
Triangular Probability Distributions
Generate a random number
If
ma
Rand () 
ba
we are on the left, otherwise on the right.
If on the Left 
X  a  (m  a)(b  a) Rand ()
If on the Right 
X  b  (b  m)(b  a)(1  Rand ())
3/23/2016
Ardavan Asef-Vaziri
5-3-9
Triangular Probability Distributions
Suppose a=5, b= 20, m=10
ma
10  5

AreaL 
 0.333333
ba
20  5
20  10
bm
 0.666667
AreaR 

20  5
ba
(m  a )(b  a)  (10  5)( 20  5)  75
(b  m)(b  a )  (20  10)( 20  5)  150
3/23/2016
Ardavan Asef-Vaziri
5-3-10
Triangular Probability Distributions
Generate Rand ()
If Rand ()  0.33333 
Otherwise
3/23/2016

X  5  75Rand ()
X  20  150(1  Rand ())
Ardavan Asef-Vaziri
5-3-11
Generate
3/23/2016
Ardavan Asef-Vaziri
5-3-12
Histogram
3/23/2016
Ardavan Asef-Vaziri
5-3-13
Descriptive Statistics
Column1
Mean
Standard Error
Median
Mode
Standard Deviation
Sample Variance
Kurtosis
Skewness
Range
Minimum
Maximum
Sum
Count
3/23/2016
11.70
0.102
11.42
#N/A
3.22
10.37
-0.61
0.30
14.30
5.22
19.51
11701
1000
Ardavan Asef-Vaziri
5-3-14
Assignment
Problems: Ch5 Problem 29(it refers to Problem 27 not 26).
All activities have beta distribution.
Solve the problem using (a) Normal distribution for all
activities, (b) Triangular distribution for all activities
If you solve it using excel, you do not need to solve it using
CB.
If you solve it using CB, also solve it using excel. You will
see solving it simply using excel is not more difficult than
CB.
3/23/2016
Ardavan Asef-Vaziri
5-3-15
Download