Modelling and Simulation IS 331. Lec (3) презентация

Слайд 2

Monte Carlo simulation
Estimating π
Craps (dice game)
Time-stepped simulation
Mortgage scenarios
Trace-driven simulation
Single-server queue (ssq1.c)
Discrete-event simulation
Witchcraft hair

salon

Simulation Examples

Слайд 3

Monte Carlo simulation
Estimating π
Craps (dice game)

Simulation Examples

Слайд 4

Example 3

Use the one-digit Random Number (6, 3, 5, 0, 8) to generate

random observations for :
Throwing an unbiased coin,
Throwing a die,
The color of a traffic found by a randomly arriving car when it is green 40% of the time, yellow 10% of the time, and red 50% of the time.

Слайд 5

To simulate a coin using one digit R.N.(0-9),
let 0 - 4

Represent a Head and
5 – 9 Represent a Tail;
so the solution will be:

(6, 3, 5, 0, 8) (T, H, T, H, T)

R. Observations

Example 3: Solution

(6, 3, 5, 0, 8)

Слайд 6

Example 3: Solution

b) To simulate a die using number 0 – 9.


Let: 1 – 6 represents the faces of the die; then
0, 7, 8 and 9 are rejected.
So the solution will be

(6, 3, 5, 0, 8) (6, 3, 5, reject, reject)

R. Observations

(6, 3, 5, 0, 8)

Слайд 7

Example 3: Solution

c) Divide 0 – 9 into 3 classes according to

the given probability:
Green 40% 0, 1, 2, 3
Yellow 10% 4
Red 50% 5, 6, 7, 8, 9

So (6, 3, 5, 0, 8) (Red, Green, Red ,Green, Red)

R. Observations

(6, 3, 5, 0, 8)

Слайд 8

A news boy buys paper for 15 P.T. each and sells them

for 25 P.T. each. Unsold papers have no value in analyzing past sells, it is found that three demand distribution exist, depending on news events in the papers. A good interesting news day yield to many potential customer, typical and poor days yield to less interest. Historically 20% of days have been “good”, 50% “typical”, 30% “Poor”, The demand distributions are summarized :
Simulate 10 days period and determine main daily profit, max profit, min profit if he decides to buy 80 papers each day. Use the following R.N :-
09 65 69 66 57 64 84 24 92 22 49 50 61 01 45 48 48 45 52 35

Example 4: A news boy

Слайд 9

Example 4: Solution (A news boy)

Слайд 10

06/10/2019

1st Day:
RN 09 --> Good
RN 65 --> demand = 60
Profit = 60*25 –

80*15 = 300 P.T
 2nd Day:
RN 69 --> Typical
RN 66 --> demand = 80
Profit = 80*25 – 80*15 = 800 P.T
 3rd Day:
RN 57 --> Typical
RN 64 --> demand = 80
Profit = 80*25 – 80*15 = 800 P.T
4th Day:
RN 84 --> poor
RN 24 --> demand = 100
Profit = 80*25 – 80*15 = 800 P.T ; we calculate with demand 80 NOT 100 as the newsboy buy only 80 news paper each day.

Example 4: Solution (A news boy)

Use the following R.N :-
09 65 69 66 57 64 84 24 92 22 49 50 61 01 45 48 48 45 52 35

Слайд 11

06/10/2019

5th Day:
RN 92 --> poor
RN 22 --> demand = 100
Profit = 80*25 –

80*15 = 800 P.T
6th Day:
RN 49 --> Typical
RN 50 --> demand = 80
Profit = 80*25 – 80*15 = 800 P.T 
7th Day:
RN 61 --> Typical
RN 01 --> demand = 50
Profit = 50*25 – 80*15 = 50 P.T
8th Day:
RN 45 --> Typical
RN 48 --> demand = 80
Profit = 80*25 – 80*15 = 800 P.T

9th Day:
RN 48 --> Typical
RN 45 --> demand = 80
Profit = 80*25 – 80*15 = 800 P.T
10th Day:
RN 52 --> Typical
RN 35 --> demand = 70
Profit = 70*25 – 80*15 = 550 P.T
MIN profit: in 7th day which is 50 P.T
MAX profit: is 800 P.T
Main daily profit:
300+800+800+800+800+800+50+800+800+550/10=650 PT

Use the following R.N :-
09 65 69 66 57 64 84 24 92 22 49 50 61 01 45 48 48 45 52 35

Слайд 12

06/10/2019

Example 5: The owner of car renting company, pays a penalty for
each

accident according to the following distribution:

The accidents occur with the probability of 30% (number of accidents per day is up to 6). Number of accidents per day has the following distribution:

Слайд 13

Simulate 12 days. Based on your simulation what is the minimum money the

owner must have to cover the penalties occurred per day.
Use the following R.N:
44 99 15 97 21 47 80 28 87 13 33 42 84 27 64
59 33 84 00 10 50 51 09 31 12 94 96 97 77

Example 5: The owner of car renting company

Слайд 14

Solution 5: The owner of car renting company

The probability accidents occur is 30%

? 00 --> 29
The probability accidents don’t occur is 70% ? 30 --> 99

Слайд 15

Solution 5: The owner of car renting company

1st Day:
RN: 92 --> NO ACCIDENT

2ND Day:
RN: 44 --> NO ACCIDENT
3RD Day:
RN: 99 --> NO ACCIDENT
4TH Day:
RN: 15 --> ACCIDENT
RN: 97 --> Number of accidents = 6 accidents.
? 1th Accident:
RN: 21 --> Amount of money paid= 50 L.E
? 2ND Accident:
RN: 47 --> Amount of money paid= 100 L.E
?3rd Accident:
RN: 80 --> Amount of money paid= 150 L.E
 ?4th Accident:
RN: 28 --> Amount of money paid = 50 L.E
?5th Accident:
RN: 87 --> Amount of money paid = 200 L.E
?6th Accident:
RN: 13 --> Amount of money paid= 50 L.E
Then the total paid in this day = 50 + 100 + 150 + 50 + 200 + 50 = 600 L.E

Use the following R.N:
44 99 15 97 21 47 80 28 87 13 33 42 84 27 64
59 33 84 00 10 50 51 09 31 12 94 96 97 77

Слайд 16

5th Day:
RN: 33 --> NO ACCIDENT
6TH Day:
RN: 42 --> NO ACCIDENT
7th Day:
RN:

84 --> NO ACCIDENT
8th Day:
RN: 27 --> ACCIDENT.
RN: 64 --> Number of accidents = 5 accidents.
1st Accident:
RN: 59 --> Amount of money paid = 100 L.E
2nd Accident:
RN: 33 --> Amount of money paid = 100 L.E
3rd Accident:
RN: 84 --> Amount of money paid = 150 L.E
4th Accident:
RN: 00 --> Amount of money paid = 50 L.E
5th Accident:
RN: 10 --> Amount of money paid = 50 L.E
Then the total paid in this day = 100 + 100 + 150 + 50 + 50 = 450 L.E

Solution 5: The owner of car renting company

Use the following R.N:
44 99 15 97 21 47 80 28 87 13 33 42 84 27 64
59 33 84 00 10 50 51 09 31 12 94 96 97 77

Слайд 17

9TH Day:
RN: 50 --> NO ACCIDENT.
10TH Day:
RN: 51 --> NO ACCIDENT.
11TH Day:
RN:

09 --> ACCIDENT.
RN: 31 --> Number of accidents = 4 accidents
?1st Accident:
RN: 12 --> Amount of money paid= 50 L.E
?2nd Accident:
RN: 94 --> Amount of money paid= 200 L.E
?3rd Accident:
RN: 96 --> Amount of money paid= 200 L.E
?4th Accident:
RN: 97 --> Amount of money paid= 200 L.E
Then the total paid in this day = 50 + 200 + 200 + 200 = 650 L.E
12th Day:
RN: 77 --> NO ACCIDENT
Based on the above simulation :- The minimum money the owner must have to cover the penalties occurred per day (The maximum paid money in all days) = 650 L.E

Solution 5: The owner of car renting company

Use the following R.N:
44 99 15 97 21 47 80 28 87 13 33 42 84 27 64
59 33 84 00 10 50 51 09 31 12 94 96 97 77

Имя файла: Modelling-and-Simulation-IS-331.-Lec-(3).pptx
Количество просмотров: 66
Количество скачиваний: 0