You are on page 1of 17

Name: Jose Alejandro Bastidas B.

SIMULATION

HOMEWORK 2 CHAPTER 1
BASIC CONCEPTS OF SIMULATION

1. Consider the following continuously operating job shop. Interarrival times of jobs are
distributed as follows:

Tiempo entre arribos (horas) Probabilidad


0 0.23
1 0.37
2 0.28
3 0.12

Processing times for jobs are normally distributed, with mean 50 minutes and standard
deviation 8 minutes. Construct a simulation table and perform a simulation for 10 new
customers. Assume that, when the simulation begins, there is one job being processed
(scheduled to be completed in 25 minutes) and there is one job with a 50-minute processing
time in the queue.

Interarrival Time Cumulative


Probability Random digits
(min) Probability
0 0.23 0.23 01-23
60 0.37 0.60 24-60
120 0.28 0.88 61-88
180 0.12 1.00 89-00

Customer Random Number Interarrival Time


3 27 60
4 83 120
5 04 0
6 86 120
7 07 0
8 47 60
9 44 60
10 57 60

Table 1. Interarrival Time

We start taking the random number on customer #3 because when the simulation begins, there
are already two jobs, so we assume that customer #1 and customer #2 are in the system with the
given information.
Name: Jose Alejandro Bastidas B.

Processing Time
𝜇 = 50 𝑚𝑖𝑛𝑢𝑡𝑒𝑠 ; 𝜎 = 8 𝑚𝑖𝑛𝑢𝑡𝑒𝑠

So, using the equation: and the table of normal random numbers, we have:

Normal Random
Customer x
Number
3 -1,26 40
4 1,92 65
5 2,55 70
6 -0,21 48
7 0,6 55
8 1,76 64
9 -1,13 41
10 -1,68 37

Simulation Table

Time
Time Waiting Time
Interarrival Arrival Service Customer Idle Time
Customer(i) Service Time in Service
Time Time Time spends in of Server
begins Queue ends
the system
1 0 0 25 0 0 25 25 0
2 0 0 50 25 25 75 75 0
3 60 60 40 75 15 115 55 0
4 120 180 65 180 0 245 65 65
5 0 180 70 245 65 316 136 0
6 120 300 48 316 16 364 64 0
7 0 300 55 364 64 419 119 0
8 60 360 64 419 59 483 123 0
9 60 420 41 483 63 524 104 0
10 60 480 37 524 44 560 80 0
Sum -> 495 351 136
Maximum
Time

(a) What was the average time in the queue for the 10 new jobs?

𝑇𝑜𝑡𝑎𝑙 𝑊𝑎𝑖𝑡𝑖𝑛𝑔 𝑇𝑖𝑚𝑒 𝑖𝑛 𝑄𝑢𝑒𝑢𝑒 351


𝑨𝒗𝒆𝒓𝒂𝒈𝒆 𝒕𝒊𝒎𝒆 𝒊𝒏 𝑸𝒖𝒆𝒖𝒆 = = = 35,1 𝑚𝑖𝑛𝑢𝑡𝑒𝑠
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝐶𝑢𝑠𝑡𝑜𝑚𝑒𝑟𝑠 10
Name: Jose Alejandro Bastidas B.

(b) What was the average processing time of the 10 new jobs?

𝑇𝑜𝑡𝑎𝑙 𝑃𝑟𝑜𝑐𝑒𝑠𝑠𝑖𝑛𝑔 𝑇𝑖𝑚𝑒 495


𝑨𝒗𝒆𝒓𝒂𝒈𝒆 𝑷𝒓𝒐𝒄𝒆𝒔𝒔𝒊𝒏𝒈 𝑻𝒊𝒎𝒆 = = = 49,5 𝑚𝑖𝑛𝑢𝑡𝑒𝑠
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝐶𝑢𝑠𝑡𝑜𝑚𝑒𝑟𝑠 10

(c) What was the maximum time in the system for the 10 new jobs?

𝑴𝒂𝒙𝒊𝒎𝒖𝒎 𝒕𝒊𝒎𝒆 𝒖𝒏 𝒕𝒉𝒆 𝒔𝒚𝒕𝒆𝒎 = 136 𝑚𝑖𝑛𝑢𝑡𝑒𝑠

2. Determine the best policy for ordering newspapers form Example 3 in the class material.
Make the simulation table for purchase of 60, 70, and 80 newspapers. ¿Must you use the
same random numbers for each experiment (60, 70, and 80 newspapers)? ¿Why YES or why
NOT?

Yes, we must use the same random numbers to perform the simulation because we can compare
which is the best case or the one that give us more profit in the same conditions.
Name: Jose Alejandro Bastidas B.

Note: Red for Random Demand and Blue for Random Days
Name: Jose Alejandro Bastidas B.
60 Newspapers

Lost profit
Type Salvage from
Random Random Revenue Newspaper Excess from Daily
Day of Demand sale returned
Number Demand for sales Cost Demand excess gain
days papers
demand

1 37 Fair 14 50 25 $ 19,80 0 $ - $ 0,50 $ 5,70


2 59 Fair 96 80 40 $ 19,80 20 $ 3,40 $ - $ 16,80
3 56 Fair 27 50 25 $ 19,80 0 $ - $ 0,50 $ 5,70
4 12 Good 83 90 45 $ 19,80 30 $ 5,10 $ - $ 20,10
5 12 Good 4 50 25 $ 19,80 0 $ - $ 0,50 $ 5,70
6 7 Good 86 90 45 $ 19,80 30 $ 5,10 $ - $ 20,10
7 92 Poor 7 40 20 $ 19,80 0 $ - $ 1,00 $ 1,20
8 88 Poor 47 50 25 $ 19,80 0 $ - $ 0,50 $ 5,70
9 48 Fair 44 60 30 $ 19,80 0 $ - $ - $ 10,20
10 53 Fair 57 60 30 $ 19,80 0 $ - $ - $ 10,20
11 68 Fair 71 70 35 $ 19,80 10 $ 1,70 $ - $ 13,50
12 63 Fair 90 80 40 $ 19,80 20 $ 3,40 $ - $ 16,80
13 97 Poor 10 40 20 $ 19,80 0 $ - $ 1,00 $ 1,20
14 0 Good 11 60 30 $ 19,80 0 $ - $ - $ 10,20
15 54 Fair 39 60 30 $ 19,80 0 $ - $ - $ 10,20
16 67 Fair 90 80 40 $ 19,80 20 $ 3,40 $ - $ 16,80
17 21 Good 66 80 40 $ 19,80 20 $ 3,40 $ - $ 16,80
18 56 Fair 14 50 25 $ 19,80 0 $ - $ 0,50 $ 5,70
19 22 Good 31 70 35 $ 19,80 10 $ 1,70 $ - $ 13,50
20 23 Good 64 80 40 $ 19,80 20 $ 3,40 $ - $ 16,80
TOTAL $ 396,00 $ 30,60 $ 4,50 $ 222,90
Name: Jose Alejandro Bastidas B.
70 Newspapers

Lost profit
Type Salvage from
Random Random Revenue Newspaper Excess from Daily
Day of Demand sale returned
Number Demand for sales Cost Demand excess gain
days papers
demand

1 37 Fair 14 50 25 $ 23,10 0 $ - $ 1,00 $ 2,90


2 59 Fair 96 80 40 $ 23,10 10 $ 1,70 $ - $ 15,20
3 56 Fair 27 50 25 $ 23,10 0 $ - $ 1,00 $ 2,90
4 12 Good 83 90 45 $ 23,10 20 $ 3,40 $ - $ 18,50
5 12 Good 4 50 25 $ 23,10 0 $ - $ 1,00 $ 2,90
6 7 Good 86 90 45 $ 23,10 20 $ 3,40 $ - $ 18,50
7 92 Poor 7 40 20 $ 23,10 0 $ - $ 1,50 $ -
8 88 Poor 47 50 25 $ 23,10 0 $ - $ 1,00 $ 2,90
9 48 Fair 44 60 30 $ 23,10 0 $ - $ 0,50 $ 7,40
10 53 Fair 57 60 30 $ 23,10 0 $ - $ 0,50 $ 7,40
11 68 Fair 71 70 35 $ 23,10 0 $ - $ - $ 11,90
12 63 Fair 90 80 40 $ 23,10 10 $ 1,70 $ - $ 15,20
13 97 Poor 10 40 20 $ 23,10 0 $ - $ 1,50 $ -
14 0 Good 11 60 30 $ 23,10 0 $ - $ 0,50 $ 7,40
15 54 Fair 39 60 30 $ 23,10 0 $ - $ 0,50 $ 7,40
16 67 Fair 90 80 40 $ 23,10 10 $ 1,70 $ - $ 15,20
17 21 Good 66 80 40 $ 23,10 10 $ 1,70 $ - $ 15,20
18 56 Fair 14 50 25 $ 23,10 0 $ - $ 1,00 $ 2,90
19 22 Good 31 70 35 $ 23,10 0 $ - $ - $ 11,90
20 23 Good 64 80 40 $ 23,10 10 $ 1,70 $ - $ 15,20
TOTAL $ 462,00 $ 15,30 $ 10,00 $ 180,90
Name: Jose Alejandro Bastidas B.
80 Newspapers

Lost profit
Type Salvage from
Random Random Revenue Newspaper Excess from Daily
Day of Demand sale returned
Number Demand for sales Cost Demand excess gain
days papers
demand

1 37 Fair 14 50 25 $ 26,40 0 $ - $ 1,50 $ 0,10


2 59 Fair 96 80 40 $ 26,40 0 $ - $ - $ 13,60
3 56 Fair 27 50 25 $ 26,40 0 $ - $ 1,50 $ 0,10
4 12 Good 83 90 45 $ 26,40 10 $ 1,70 $ - $ 16,90
5 12 Good 4 50 25 $ 26,40 0 $ - $ 1,50 $ 0,10
6 7 Good 86 90 45 $ 26,40 10 $ 1,70 $ - $ 16,90
7 92 Poor 7 40 20 $ 26,40 0 $ - $ 2,00 $ -
8 88 Poor 47 50 25 $ 26,40 0 $ - $ 1,50 $ 0,10
9 48 Fair 44 60 30 $ 26,40 0 $ - $ 1,00 $ 4,60
10 53 Fair 57 60 30 $ 26,40 0 $ - $ 1,00 $ 4,60
11 68 Fair 71 70 35 $ 26,40 0 $ - $ 0,50 $ 9,10
12 63 Fair 90 80 40 $ 26,40 0 $ - $ - $ 13,60
13 97 Poor 10 40 20 $ 26,40 0 $ - $ 2,00 $ -
14 0 Good 11 60 30 $ 26,40 0 $ - $ 1,00 $ 4,60
15 54 Fair 39 60 30 $ 26,40 0 $ - $ 1,00 $ 4,60
16 67 Fair 90 80 40 $ 26,40 0 $ - $ - $ 13,60
17 21 Good 66 80 40 $ 26,40 0 $ - $ - $ 13,60
18 56 Fair 14 50 25 $ 26,40 0 $ - $ 1,50 $ 0,10
19 22 Good 31 70 35 $ 26,40 0 $ - $ 0,50 $ 9,10
20 23 Good 64 80 40 $ 26,40 0 $ - $ - $ 13,60
TOTAL $ 528,00 $ 3,40 $ 16,50 $ 138,90

As it’s shown in the different tables for each newspaper, you get more profit when you buy 60
newspapers daily.
Name: Jose Alejandro Bastidas B.

3. Smalltown Taxi operates one vehicle during the 9:00 A.M. to 5:00 P.M. period. Currently,
consideration is being given to the addition of a second vehicle to the fleet. The demand for
taxis follows the distribution shown:

Time Between Calls (Minutes) 15 20 25 30 35


Probability 0.14 0.22 0.43 0.17 0.04

The distribution of time to complete a service is as follows:

Service Time (Minutes) 5 15 25 35 45


Probability 0.12 0.35 0.43 0.06 0.04

Simulate 1 individual days of operation of the current system and of the system with an
additional taxicab. Compare the two systems with respect to the waiting times of the
customers and any other measures that might help on the situation.

Interarrival Cumulative Random


Probability
Time (min) Probability digits
15 0,14 0,14 01-14
20 0,22 0,36 15-36
25 0,43 0,79 37-79
30 0,17 0,96 80-96
35 0,04 1 97-00

Service
Cumulative Random
Time Probability
Probability digits
(min)
5 0,12 0,12 01-12
15 0,35 0,47 13-47
25 0,43 0,9 48-90
35 0,06 0,96 91-96
45 0,04 1 97-00
Name: Jose Alejandro Bastidas B.

Note: Red for Service Time and Blue for Interarrival Time
Name: Jose Alejandro Bastidas B.

Simulation for 1 driver


Time
Idle
Random Random Time Waiting Time Customer
Interarrival Arrival Service Wait in Time
Number Number Service Time in Service spends in
Time Time Time Queue? of
(Interarrival) (Service) begins Queue ends the
Server
system
65 25 0 45 15 0 0 No 15 15 0
91 30 30 43 15 30 0 No 45 15 15
30 20 50 34 15 50 0 No 65 15 5
66 25 75 17 15 75 0 No 90 15 10
32 20 95 4 5 95 0 No 100 5 5
29 20 115 65 25 115 0 No 140 25 15
11 15 130 83 25 140 10 Si 165 35 0
43 25 155 77 25 165 10 Si 190 35 0
40 25 180 94 35 190 10 Si 225 45 0
65 25 205 71 25 225 20 Si 250 45 0
82 30 235 61 25 250 15 Si 275 40 0
73 25 260 55 25 275 15 Si 300 40 0
15 20 280 17 15 300 20 Si 315 35 0
70 25 305 18 15 315 10 Si 330 25 0
65 25 330 42 15 330 0 No 345 15 0
33 20 350 98 45 350 0 No 395 45 5
54 25 375 7 5 395 20 Si 400 25 0
87 30 405 10 5 405 0 No 410 5 5
27 20 425 56 25 425 0 No 450 25 15
37 25 450 37 15 450 0 No 465 15 0
Name: Jose Alejandro Bastidas B.

Simulation Two-Driver

Time Time Waiting Waiting Time Time


Wait in Wait in
Interarrival Arrival Service Service Service Time in Time in Service Service
Queue? Queue?
Time Time Time begins begins Queue Queue ends ends
#1 #2
#1 #2 #1 #2 #1 #2
25 0 15 0 0 0 No 0 No 15 0
30 30 15 30 0 0 No 0 No 45 0
20 50 15 50 0 0 No 0 No 65 0
25 75 15 75 0 0 No 0 No 90 0
20 95 5 95 0 0 No 0 No 100 0
20 115 25 115 0 0 No 0 No 140 0
15 130 25 0 130 0 No 0 No 0 155
25 155 25 155 0 0 No 0 No 180 0
25 180 35 180 0 0 No 0 No 215 0
25 205 25 0 205 0 No 0 No 230
30 235 25 235 0 0 No 0 No 260 0
25 260 25 260 0 0 No 0 No 285 0
20 280 15 0 280 0 No 0 No 0 295
25 305 15 305 0 0 No 0 No 320 0
25 330 15 330 0 0 No 0 No 345 0
20 350 45 350 0 0 No 0 No 395 0
25 375 5 0 395 0 No 0 No 0 400
30 405 5 405 0 0 No 0 No 410 0
20 425 25 425 0 0 No 0 No 450 0
25 450 15 450 0 0 No 0 No 465 0

When we have two taxi working, there is no queue.


Name: Jose Alejandro Bastidas B.

4. Given A, B, and C, which are uncorrelated random variables, Variable A is normally


distributed with  = 100 and ² = 400. Variable B is discrete uniformly distributed with a
probability distribution given by p(b)=1/5 with b = 0, 1, 2, 3, and 4. Variable C is distributed in
accordance with the following table:

Value of C Probability
10 0.10
20 0.25
30 0.50
40 0.15

Use simulation to estimate the mean of a new variable D, that is defined as

D = ( A − 25B ) / (2C )
Use a sample of size 30. Prepare a histogram of the resulting values, using class intervals
of width equal to 3

Value of Cumulative Random


Probability
C Probability Digits
10 0,10 0,10 01-10
20 0,25 0,35 11-35
30 0,50 0,85 36-85
40 0,15 1,00 86-00

Value of Cumulative Random


Probability
B Probability Digits
0 0,2 0,2 01-02
1 0,2 0,4 03-04
2 0,2 0,6 05-06
3 0,2 0,8 07-8
4 0,2 1,0 09-00

Data of A:
𝜇 = 100 ; 𝜎 = 20

So, using the equation: and the table of


normal random numbers, we obtain the values.

Note: Red for Random Normal Numbers, Blue for Random


Numbers 2 Digits, Yellow for Random Number 1 Digit.
Name: Jose Alejandro Bastidas B.
Name: Jose Alejandro Bastidas B.
i Normal Value A Random Value B Random Value C D
Random Number Number
Number for B for C
1 0,42 108,4 0 4 68 30 0,14
2 1,64 132,8 1 0 63 30 2,21
3 -0,02 99,6 0 4 97 40 -0,01
4 -0,38 92,4 2 0 0 40 1,16
5 -0,44 91,2 3 1 54 30 1,10
6 0,62 112,4 7 3 67 30 0,62
7 1,41 128,2 9 4 21 20 0,71
8 -1,63 67,4 9 4 56 30 -0,54
9 0,75 115 5 2 22 20 1,63
10 0,61 112,2 0 0 23 20 2,81
11 0,83 116,6 4 1 2 10 4,58
12 0,08 101,6 1 0 35 20 2,54
13 0,87 117,4 2 0 26 20 2,94
14 0,51 110,2 2 0 39 30 1,84
15 0,11 102,2 0 4 70 30 0,04
16 -1,37 72,6 1 0 66 30 1,21
17 -0,21 95,8 2 0 72 30 1,60
18 0,17 103,4 3 1 6 10 3,92
19 1,14 122,8 5 2 26 20 1,82
20 -0,12 97,6 9 4 16 20 -0,06
21 -1,61 67,8 1 0 70 30 1,13
22 -0,52 89,6 0 4 17 20 -0,26
23 0,78 115,6 2 0 19 20 2,89
24 -1,29 74,2 8 3 24 20 -0,02
25 0,54 110,8 1 0 8 10 5,54
26 0,31 106,2 8 3 41 30 0,52
27 2,91 158,2 5 2 19 20 2,71
28 -0,99 80,2 9 4 88 40 -0,25
29 -0,89 82,2 2 0 90 40 1,03
30 0,54 110,8 8 3 66 30 0,60

Class Interval Class Mark Frequency


absolute
[-0.54 , 2.46 ) 0,96 22
[2.46 , 5.46) 3,96 7
[5.46 , 8.46) 6,96 1
Name: Jose Alejandro Bastidas B.

Histograma de Frecuencias
25

20

15

10

0
[-0.54 , 2.46 ) [2.46 , 5.46) [5.46 , 8.46)

5. Estimate, by simulation, the average number of lost sales per week for an inventory system
that functions as follows:

(a) Whenever the inventory level falls to or below 10 units, an order is placed. Only one order
can be outstanding at a time.
(b) The size of each order is equal to 20 – I, where I is the inventory level when the order is
placed
(c) If a demand occurs during a period when the inventory level is zero, the sale is lost.
(d) Daily demand is normally distributed, with a mean of 5 units and a standard deviation of
1.5 units. (Round off demands to the closest integer during the simulation and, if a
negative value results, give it a demand of zero.)
(e) Lead time is distributed uniformly between zero and 5 days—integers only.
(f) The simulation will start with 18 units in inventory.
(g) For simplicity, assume that orders are placed at the close of the business day and
received after the lead time has occurred. Thus, if lead time is one day, the order is
available for distribution on the morning of the second day of business following the
placement of the order.
(h) Let the simulation run for 2 weeks.

Shortage Average
Initial Final Inventory # Random Supply
Week Day Demand of Sales
Inventory Inventory Order Reposition Time
inventory Number
1 1 18 7 11 1,5
2 11 6 5 15 28 1
3 5 4 2 0
4 2 5 15 3
5 15 4 11 0
2 1 11 4 7 13 77 4 4
2 7 8 0 1 3
3 0 8 0 8 2
4 0 3 0 3 1
5 0 4 0 4 0
Name: Jose Alejandro Bastidas B.

6. A bank has one drive-in teller and room for one additional customer to wait. Customers,
arriving when the queue is full, park and go inside the bank to transact business. The between
arrivals and the service- time distribution follow:

Time Between Service Time


Probability Probability
Arrivals (Minutes) (minutes)
0 0.09 1 0.20
1 0.17 2 0.40
2 0.27 3 0.28
3 0.20 4 0.12
4 0.15
5 0.12

Simulate the operation of the drive-in teller for 10 new customers. The first of the 10 new
customers arrive at a time determined at random. Start the simulation with one customer
being served, leaving at time 3, and one in the queue. How many customers went into the
bank to transact business?

Interarrival Cumulative Random Service


Probability Cumulative Random
Time (min) Probability digits Time Probability
Probability digits
0 0,09 0,09 01-09 (min)
1 0,17 0,26 10-26 1 0,20 0,20 01-20
2 0,27 0,53 27-53 2 0,40 0,60 21-60
3 0,20 0,73 54-73 3 0,28 0,88 61-88
4 0,15 0,88 74-88 4 0,12 1,00 89-00
5 0,12 1,00 89-00
Name: Jose Alejandro Bastidas B.

Time Waiting Time Waiting


Random Interarrival Arrival Random Service Customer in
Customer Service Time in Service in
Number Time Time Number Time the bank?
begins Queue ends Queue?
0 0 3 0 0 3 No No
1 14 1 1 26 2 3 2 5 Si Si
2 96 5 6 26 2 6 0 8 No No
3 27 2 8 34 2 8 0 10 No No
4 83 4 12 34 2 12 0 14 No No
5 4 0 12 72 3 14 2 17 Si Si
6 86 4 16 77 3 17 1 20 Si Si
7 7 0 16 67 3 20 4 23 Si Si
8 47 2 18 30 2 23 5 25 Si Si
9 44 2 20 18 1 25 5 26 Si Si
10 57 3 23 66 3 26 3 29 Si Si

Enter to the bank, 7 customers.

You might also like