Вы находитесь на странице: 1из 28

Quantitative Analysis Lec 9 04/08/2014

Simulation Model
Audio 157
All is probabilistic, in order to do the probabilistic ,
we should follow the simulation model.
To simulate something on the computer before you
do it in real life, in order to reduce the failure from
the investment.
Example: you want to invest , and to build a big
resort in sharm El Sheikh, and you discovered that
it is not working
The word "Discovered" is not applicable , whether it
will be possible or don't do it.
That is why they do simulation on the computer with
the financial formula, in order to make sure about :
No of people & the % of The resort will be
complete , in order to say that the project is viable
for application .
They simulate what is in the real life in a formula.
PS.: The mathematical formula we are using during
the term , will be used in order to simulate
something which is not clear and probabilistic, to
get something depending on this .
Example : Profit depending on cost,
Time depending on distance
Gravity depending on sending rocket
to the moon
Simulation is an interesting technique, but
expensive, to do all the lab investigation, each
company is different .
1 Prof. Maged Morcos
Quantitative Analysis Lec 9 04/08/2014

you are tuning it to the problem that you have in


your own company. You have to pay money for the
programming , and how much variety in the
variables, and the probability of every variable.
This model is mainly for risk analysis topic :
nuclear power station, petrol , submarine buildings.
Any decision will have an impact on the nation, the
error should be very small, in order to do it very
small, you need to move in every part of the variable
million of times, in order to know that it will
replicate the real life million of times, as if you are
living a million of years.
you are predicting the future using the probability
with simulation, (not only probability) and then get
the mean of that value on the left hand side of the
formula with the minimum deviation.
Ex: IRR " Interest Rate of Return " of a business
If I will give you the choice between
17 OR 12
it is deterministic
WE will choose 17
If I will give you a deviation of 5 for 7 , & 0.1 for
the 12
17 OR 12
5% & 0.1 %
WE should choose 12

2 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

therefore the deviation should be calculated, in


order to get the deviation, we should go into the
probabilistic measurement of every unit .
It is not a matter of average, you have to simulate it,
in order to get both values more accurate and then
compare them .
the one of the minimum deviation ,is the one that
you have to apply it.

Description
"Simulation is the process of studying the
behavior of a real system by using a model
that replicates the behavior of the system.."
more than once
Example:
P rofit=RevenueCost

I can simulate the probability of the revenue, and


the probability of the cost and then get different
values, and then get the profit to the nearest
possible.
Area of Application in real life:
Simulating inventory system in a company ( the
trial and error, when there is a cycle there is a
simulation. )
Simulating waiting line of a concrete mixers a
concrete batch plant
Simulating arriving and departing flights a
major airport,
3 Prof. Maged Morcos
Quantitative Analysis Lec 9 04/08/2014

Simulating the flow of traffic through busy road,


The idea of Risk Analysis is Monte Carlo Simulation

4 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

Monte Carlo Simulation


There are some sections in a
roulette, and the marble
should fall in one of the section
in a roulette,
How many times that stands
play this game in order to
increase my profit.
that's gambling
The roulette concept
It has 5 steps
1.You have to get the probability curve for every
variable
2.from the probability curve you get something
called Cumulative of probability curve.
3.& from the Cumulative of probability curve , you
get the interval.
4.And from the interval we need the section for
every parameter, as if it is a roulette.
We have a roulette for the cost and a roulette for
the revenue.
When throwing 2 balls falling in 7 & 2, my profit
should be 5.
Then repeat it again it will fall on different sections
how many times should I play in each roulette , in
order to be sure that the marble will fall in every
section.
5 Prof. Maged Morcos
Quantitative Analysis Lec 9 04/08/2014

This mean that it is calculated for every value of the


revenue, and it is calculated of every value of the
cost.
Playing more is the trial and error that you do until
you get the deviation less.

Problem Description

To see how these steps work see following examples which


explains the five steps for a historical review of 200 days.

Management found that the daily demands for radial tiers


in a Tire company are as follows:

Interval
Demand Freq. Cum of
Prob..
for Tiers (days) Prob. Random
No.

0 10 0.05 0.05 00-04

1 20 0.10 0.15 05-14

2 40 0.20 0.35 15-34

3 60 0.30 0.65 35-64

4 40 0.20 0.85 65-84

5 30 0.15 1.00 85-99

200 1.00
6 Prof. Maged Morcos
Quantitative Analysis Lec 9 04/08/2014

Using above data the following cumulative prob.. curve is


obtained from which the random numbers are used

7 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

Problem Explanation
Notes:
To know how the probability consist of :
in this problem there is only one variable of the demand
.
he found that from the 200 days ,there are 10 days
nobody asks to buy any tires
Not the first 10 days, different or random 10 days
during the period
other 20 days people asked for 1 tires
40 days they asked for 2 , 60 days asked for 3 ,........
the total is 200
to calculate the probability
Probability of Zero = 10 200 = 0.05
Interval
Demand Freq. Cum of
Prob..
for Tiers (days) Prob. Random
No.

0 10 0.05
1 20

2 40

3 60

4 40

5 30

200 1.00

8 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

Probability of 20 = 20 200 = 0.20

Interval
Demand Freq. Cum of
Prob..
for Tiers (days) Prob. Random
No.

0 10 0.05

1 20 0.20
2 40

3 60

4 40

5 30

200 1.00

Probability of 40 = 10 200 = 0.05


Interval
Demand Freq. Cum of
Prob..
for Tiers (days) Prob. Random
No.

0 10 0.05

1 20 0.10

9 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

2 40 0.05
3 60

4 40
5 30

200 1.00

Getting the number of days , and the


probability
this what so called the relative of the
probability curve.
Demand Freq.
Prob..
for Tiers (days)

0 10 0.05

1 20 0.10

2 40 0.20

3 60 0.30

4 40 0.20

5 30 0.15

200 1.00

the probability Curve :

10 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

0.35

0.3

0.25

0.2
Day
0.15 Probabilities

0.1

0.05

0
10 20 40 60 40 30
proba
bility 1.0

11 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

To calculate the cumulative Probability :



Any probability should = 1

All the probabilities of 0, 1, 2 , 3, 5 should be 1

Interval of
Demand Freq. Cum
Prob.. Random
for Tiers (days) Prob.
No.

0 10 0.05 0.05
0.10 0.15
+
1 20

2 40 0.20

3 60 0.30

4 40 0.20

5 30 0.15 1.00 Should


=1
200 1.00

12 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

Interval of
Demand Freq. Cum
Prob.. Random
for Tiers (days) Prob.
No.

0 10 0.05 0.05
1 20 0.10 + 0.15
=
2 40 0.20 0.35
3 60 0.30

4 40 0.20

5 30 0.15 1.00 Should


=1
200 1.00

Meaning that there is a probability of 35 %


that people will ask for 0 or 1 or 2 or 3 .
But the probability of getting 3 only . will be
30 %.
At the end should close with 1.00
if it is more than 1.00 do not start the
problem
PS:

In the exam you will find an empty slot ,


you will find it

13 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

To be sure that the student understand


that the probability should be 1.00

14 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

Interval of Random No
It is different from a number to the other
To get the continuous :
In order to get the continuous ( Roulette )
I will imagine that there is a probability PIE
SHART with sections , in order to make a
roulette.
which starts from 0 , to 99 , to close 100
units.
Interval
Demand Freq. Cum of
Prob..
for Tiers (days) Prob. Random
No.

0 10 0.05 0.05 00-04


1 20 0.10 0.15

2 40 0.20 0.35

3 60 0.30 0.65

4 40 0.20 0.85

5 30 0.15 1.00

200 1.00

15 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

Following the previous rule the Cum.


probability is .05 , I will begin with Zero and
end with .04

16 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

Interval
Demand Freq. Cum of
Prob..
for Tiers (days) Prob. Random
No.

0 10 0.05 0.05 00-04


1 20 0.10
0.15 05-14
2 40 0.20

3 60 0.30

4 40 0.20

5 30 0.15

200 1.00

As it ends with 4 The next section should


begin with 5
And should end with : 14
Interval
Demand Freq. Cum of
Prob..
for Tiers (days) Prob. Random
No.

0 10 0.05 0.05 00-04


1 20 0.10 0.15 05-14
2 40 0.20 0.35 15 - 34
3 60 0.30

4 40 0.20
17 Prof. Maged Morcos
Quantitative Analysis Lec 9 04/08/2014

5 30 0.15

200 1.00

As if I am representing each section, in a


continuous circle.
WHY ?????
If i consider that I through a marble with
numbers randomly & get 47.
Where should I read the 47 ???
Interval
Demand Freq. Cum of
Prob..
for Tiers (days) Prob. Random
No.

0 10 0.05 0.05 00-04

1 20 0.10 0.15 05-14

2 40 0.20 0.35 15-34


3 60 0.30 0.65 35-64
4 40 0.20 0.85 65-84

5 30 0.15 1.00 85-99

200 1.00

Between the 35 & 64


This mean the goal fall into the section
of demand of 3 tiers.

18 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

The simulation of the marble tell that


the demand on the first day will be 3
Repeat the same process , I found that
the marble is 16, it falls between 15 &
34 , the next day will be in the section 2

19 Prof. Maged Morcos


Quantitative Analysis Lec 9 04/08/2014

I will get the probability of the mean , and


then get the deviation from it.
that mean that my business will look like my
previous business but more accurate.
To improve it , We should take more than
200 days.
if I have the following formula
P rofit =RevenueCost

P=RC

I will prepare a roulette for the revenue and


a roulette for the cost.
and then get the profit to the nearest value.

20 Prof. Maged Morcos


Quantitative Analysis Problem
Lec 9 Description
04/08/2014

See Problem 14 in book page 562


A.1) Revenue Controlling Variables
Revenue per unit (5) = 45
A.2) Cost Controlling Variables
Purchase Relative Cumulativ Random
Cost (S) Probabilit e Number
y Probabilit s
y
10 0.25 0.25 00-24 Total Prof
PC AC TC Rev.
cost .
11 0.45 0.70 25-69 R
37 58 82
N
12 0.3 1.00 70-99 11 24 5 40 45 5
1.00
Assembly Relative Cumulativ Random
Labor Cost Probabilit e Number Total Prof
PC AC TC Rev.
(S) y Probabilit s Cost .
y
20 0.1 0.10 00-09 R
18 74 61
N
22 0.25 0.35 10-34 10 52 3 38 45 7
24 0.35 0.70 35-69
25 0.30 1.00 70-99
1.00
Transportati Relative Cumulativ Random
Quantitative Analysis Lec 9 04/08/2014

Problem Explaination
on Cost (S) Probabilit e Number
y Probabilit s
y
3 0.75 0.75 00-74
5 0.25 1.00 75-99
1.00
In the exam this problem will be in English wording
The student should understand what will in the right and the
left hand side.
Everything will be on the right hand side
the right hand side will be probabilistic, meaning that each one
will have its probability curve (A.2) given .
Will give you 7 number for simulation . to do in the exam
Will give also the random numbers.
Quantitative Analysis Lec 9 04/08/2014

We will imagine that we have 3 marbles, one for each variable.


The Purchase Cost Purch Relative Cumulative Random
ase Probabili Probability Numbers
The red one = 37 (is the Cost ty
value of the purchasing cost (S)
10 0.25 0.25 00-24
that I am going to get, in
11 0.45 0.70 25-69
the first random), 12 0.3 1.00 70-99
1.00
the purchasing cost will
be 11

The Assembly Cost Assem Relative Cumulative Random


bly Probabili Probability Numbers
The green one = 52 (is the Cost ty
value of the assembly cost (S)
that I am going to get, in 20 0.1 0.10 00-09
the first random), 22 0.25 0.35 10-34
24 0.35 0.70 35-69
the purchasing cost will 25 0.30 1.00 70-99
1.00
be 24
Quantitative Analysis Lec 9 04/08/2014

The Transportation Cost: Transporta Relative Cumulative Random


tion Cost Probabil Probability Numbers
The blue one = 82 (is the (S) ity
value of the purchasing cost 3 0.75 0.75 00-74

that I am going to get, in 5 0.25 1.00 75-99


1.00
the first random),
the purchasing cost will be 5
P rofit=RevenueCost

P = Revenue (Cost of Purchase + Cost of Assembly + Cost


of Transportation )
P = R (P. C. + A. C. + T. C.)
Probabilistic
We add them all to get the Total Cost :
PC AC TC Total cost Rev Pro
. f
RN 37 58 82
11 24 5 40 45 5
Quantitative Analysis Lec 9 04/08/2014

Total Cost = Cost of Purchase + Cost of Assembly + Cost


of Transportation
1 + 24 + 5 = 40
Profit = Revenue - Total Cost
= 45 - 40
Profit = 5
AS $ 5 is not enough as profit , I should make another trial with
the other randoms
PC AC TC Total cost Rev Pro
. f
RN 18 74 61
10 25 3 38 45 7

Total Cost = 10 + 25 + 3 = 38
Profit = 45 - 38 = 7
The formula for this Lecture is :
P = R (P. C. + A. C. + T. C.)
Quantitative Analysis Lec 9 04/08/2014

P 1 = 45 ( 11 + 24 + 5 ) =5
P 2 = 45 ( 10 + 25 + 3 ) =7

The problem in this lecture is the Formula , you


should get it yourself
in this case

Example :
Distance
Time=
V ilocity

C3 Simulation of Objective Function


Given Given Given PC+AC TC
+TC -
Simulated no. of RN PC RN AC RN TC Tot. C Re Pr
trials v of
Quantitative Analysis Lec 9 04/08/2014

1 52 11 37 24 82 5 39 45 5
2 6 10 63 24 57 3 37 45 8
3 50 11 28 22 68 3 36 45 9
4 88 12 2 20 28 3 35 45 10
5 53 11 74 25 5 3 39 45 6
6 30 10 35 24 94 5 39 45 5
7 10 10 24 22 3 3 35 45 10
8 47 11 3 20 29 3 34 45 11
9 99 12 29 22 60 3 37 45 8
10 37 11 60 24 79 5 40 45 5
11 69 11 98 25 96 5 41 45 4
12 2 10 94 25 52 3 38 45 7
13 36 11 90 25 62 3 39 45 6
14 49 11- 36 24 87 5 40 45 5
15 71 12 6 20 49 3 35 45 10
16 99 12 78 25 56 3 40 45 5
17 32 11 23 22 59 3 36 45 9
18 10 10 67 24 23 3 37 45 8
19 75 12 89 25 78 5 42 45 3
20 21 10 85 25 71 3 38 45 7
$ 14
Average = 143/20 = 7.1
Quantitative Analysis Lec 9 04/08/2014

we will check how many 5 appeared, how many 10 appeared , how many 6
appeared
divide them / 20 = to get the probability that value (like the demand)
in the exam you are going to prepare the previous schedule of only 6 or 7 rows.
6 rows & 6 columns ( according the equation)
the random number is given , you will get the value.
In the exam the formula could be Like Lecture 8:
The Total cost Formula of Lecture 8 :)
TC=C w X L+C s X k

K will be standard, and will change the Cs, L & Cw

Cost of Waiting

Cost of Service

No of Channels
Length of the queue
You will get Random No of: Cw, L & Cs
If I put no of random numbers 20, I will get a value of 7.15m.
at 2,000,000 I will get 5.15 instead of 7.15
and the deviation will be minimal
If we do simulation, the counter will stop at a certain point ,
and say that there is no significant improvement.
you will build your work at 7.15 , but in real life you will get only 5.15

Вам также может понравиться