Simulation
Simulation
Simulation
Answer
Table - I
Random No. Range Table for demand
Demandper Probability Cumulative Range†
Frequency(f)
week (p = f ÷ ∑f) Probability of Random Nos.
0 2 .04 .04 00-03
5 11 .22 .26 04-25
10 8 .16 .42 26-41
15 21 .42 .84 42-83
20 5 .10 .94 84-93
25 3 .06 1.00 94-99
∑ f = 50 1.00
As the given Random Nos. are of 2 digits, the ranges of Random Nos. has also been considered
to have 2 digits only. Also the range of Random Nos. corresponds to cumulative probability
values which lies between 0 & 1 and can be correlated as nos. between 00 and 99.
Table - II
Simulated Values for next 10 weeks
Weeks Random Nos. Demand
1 35* 10*
2 52 15
3 13 5
4 90 20
5 23 5
6 73 15
7 34 10
8 57 15
9 35 10
10 83 15
Total – 120
*From Table (I), Random No. 35 appears in the range of 26-41. Also the demand for this range
is 10.
Average weekly demand = 120 = 12
10
Ex. Book No. Pg. No.
2
Using empirical data A process planner is working on plans for producing a new detergent. She
wishes to simulate a raw material demand in order to plan for adequate materials – handing
and storage facilities. On the basis of usage for a similar product introduced previously, she
has developed a frequency distribution of demand in tons per day for a 2-month period. Use
this data (shown below) to simulate the raw material usage requirements for 7 periods (days)
and average demand.
Demands, X (tons/ day) 10 11 12 13 14 15
Total = 60
Frequency (days) 6 18 15 12 6 3
Use following Random No. 27, 13, 80, 10, 54, 60, 49
Reference What’s New
Raw Material Usage Required and
Average Demand
Answer
(1) Data are given in frequencies.
(2) To formulate a probability distribution, divide each frequency by the total (60), for
example, 6 60 = .10 and18 60 = .30. Then formulate a cumulative probability distribution
by successively summing the probabilityvalues.
Demand Frequency Probability Cumulative
(tons/day) (days) P(X) probability
10 6 0.10 0.10
11 18 0.30 (10 + 0.30) = 0.40
12 15 0.25 0.65
13 12 0.20 0.85
14 6 0.10 0.95
15 3 0.05 1.00
1.00 60 1.00
(3) Next, assign random – number intervals so that the number of values available to each
class corresponds with the probability. Using 100 two – digit numbers (00-99), we assign
10 percent (00-09) to the first class,30 percent (10-39) to the second class, and so on.
Demand Probability Corresponding
(tons/day) P(X) Random Numbers
10 .10 00-09
11 .30 10-39
12 .25 40-64
13 .20 64-84
14 .10 85-94
15 .05 95-99
1.00 RN = 27
(4) We obtained random numbers (RN) from column 1 of Appendix I (for convenience),
so the first seven numbers are:
27 13 80 10 54 60 49
The first RN, 27, falls into the second class of the distribution and corresponds to a
demand of 11 tons per day.
Random Number 27 13 80 10 54 60 49
Simulated Demand 11 11 13 11 12 12 12
(5) This extremely small simulation yields a mean of X = 11.7 tons. The expected value from
the empirical probability distribution is E(X) = [XP(X)] = 12.05 tons, suggestion that the
small sample size of only 7 periods has resulted in some error. A much larger sample
should be simulated before the simulation results are used for making decisions.
Note that the width of the random number “target” in each class corresponds exactly to
the relative frequency of the class. This helps to ensure that the simulated results have
the same type of distribution as the original data. This is more apparent in the graphic
method where the vertical distances on the graph correspond to the relative frequencies
of the respective classes.
Using the following set of random numbers, simulate the weekly pattern of receipts and
payments for the 12 weeks of the next quarter, assuming further that the beginning bank
balance is ` 8000. What is the estimated balance at the end of the 12 weekly period? What is
the highest weekly balance during the quarter? What is the average weekly balance for the
quarter?
Random Numbers
For Receipts 03 91 38 55 17 46 32 43 69 72 24 22
For payments 61 96 30 32 03 88 48 28 88 18 71 99
According to the given information, the random number interval is assigned to both the
receipts and the payments.
Reference What’s New
Receipts and Payments
Answer
Range of random numbers
Receipt Cumulative Payments Cumulative
Probability Range Probability Range
(`) probability (`) probability
3000 0.20 0.20 00-19 4000 0.30 0.30 00-29
5000 0.30 0.50 20-49 6000 0.40 0.70 30-69
7000 0.40 0.90 50-89 8000 0.20 0.90 70-89
12000 0.10 1.00 90-99 10000 0.10 1.00 90-99
a. Use the following sequences of random numbers to be used for estimating costs and
revenues. Obtain the probability distribution of the monthly net revenue.
82 84 28 82 36 92 73 91 63 29
Sequence 1
27 26 92 63 83 02 10 39 10 10
39 72 38 29 71 83 19 72 92 59
Sequence 2
49 39 72 94 04 92 72 18 09 00
b. Repeat the analysis in (a) by using the following random number streams:
20 63 46 16 45 41 44 66 87 26
Sequence 1
78 40 29 92 21 36 57 03 28 08
23 57 99 84 51 29 41 11 66 30
Sequence 2
41 80 62 74 64 26 41 40 97 15
Answer
Cumulative Random Cumulative Random
Costa. (`) Cost (`)
Probability Probability Range Probability Probability Range
17000 0.1 0.1 00-09 19000 0.1 0.1 00.09
18000 0.1 0.2 10-19 20000 0.1 0.2 10-19
If the ferry has space for only 101 cars, what will be the average number of empty space on
the boat? Use following Random Numbers to simulate the data provided above - 20, 63, 46,
16, 45, 41, 44, 66, 87, 26, 78, 40, 29, 92, 21.
Answer
Simulation of data of an Automobile Production line
Production/day Probability Cumulative Probability Random No. Range
95 0.03 0.03 00-02
96 0.05 0.08 03-07
97 0.07 0.15 08-14
98 0.10 0.25 15-24
99 0.15 0.40 25-39
100 0.20 0.60 40-59
101 0.15 0.75 60-74
102 0.10 0.85 75-84
103 0.07 0.92 85-91
104 0.05 0.97 92-96
105 0.03 1.00 97-99
1.00
Simulated data
[Link] cars waiting to No. of empty space on the
Day Random No. Production
be shipped boat
1 20 98 - 3
2 63 101 - -
3 46 100 - 1
4 16 98 - 3
5 45 100 - 1
6 41 100 - 1
7 44 100 - 1
8 66 101 - -
9 87 103 2 -
10 26 99 - 2
11 78 102 1 -
12 40 100 - 1
13 29 99 - 2
14 92 104 3 -
15 21 98 - 3
Total 6 18
Average no. of empty space on the boat = 18/15 = 1.2 per day
Using the following sequence of random numbers, generate the demand for 20 time periods
(years). Calculate the average profit obtainable under each of the courses of action open to
the manager. What is the optimal policy?
14 02 93 99 18 71 37 30 12 10
88 13 00 57 69 32 18 08 92 73
Answer
Random No. Range Table
Demand Probability CumulativeProbability Random No. Range
15 .05 .05 00-04
16 .08 .13 5-12
17 .20 .33 13-32
18 .45 .78 33-77
19 .10 .88 78-87
20 .07 .95 88-94
21 .03 .98 95-97
22 .02 1.00 98-99
Total 1.00 – –
Calculation of demand and profit for next 20 years
Random No. of books unsold if stock is
Expecteddemand
Year Numbers 16* 17* 18*
1 14 17 - - 1
2 02 15 1 2 3
3 93 20 - - -
4 99 22 - - -
5 18 17 - - 1
6 71 18 - - -
7 37 18 - - -
8 30 17 - - 1
9 12 16 - 1 2
10 10 16 - 1 2
11 88 20 - - -
12 13 17 - - 1
13 00 15 1 2 3
14 57 18 - - -
15 69 18 - - -
16 32 17 - - 1
17 18 17 - - 1
18 08 16 - 1 2
19 92 20 - - -
20 73 18 - - -
Total 2 7 18
*Looking at the simulated demand pattern, these stock figures have been chosen to find out
optimal course of action. Stock figures of 20 or more have not been considered because it is
quite obvious that such figures will not give optimal course of action due to high losses for
the unsold books.
Statement Showing Computation of Profit
No. of Books No. of Books sold in 20 years Average Profit/Year
*Net Profit (`)
order (n) (n × 20 - Books unsold) (Profit ÷ 20)
15 15 × 20 = 300 ` 6000 ` 300
16 16 × 20 – 2 = 318 ` 6300 ` 315
(318 × 20) – 2 × 30
17 (17 × 20) – 7 = 333 ` 6450 ` 322.5
(333 × 20) -7 × 30
18 (18 × 20) – 18 ` 6300 ` 315
(342 × 20) – 18 × 30
* Net Profit = No. of books sold × ` 20# – No. of books unsold × ` 30**
Selling price/book = `80, Cost/book = ` 60
#
Profit /book = 80 – 60 = ` 20
Selling price of any unsold book = ` 30
**Loss incurred/unsold book = ` 60 – ` 30 = ` 30
Since profit is maximum for 17 books order, the optimal policy is to order 17 books per year.
Each time an order is placed, the store incurs an ordering cost of ` 10 per order. The store also
incurs a carrying cost of ` 0.50 per book per day. The inventory carrying cost in calculated on
the basis of stock at the end of each day.
The manager of the bookstore wishes to compare two options for his inventory decision.
A. Order 5 books when the inventory at the beginning of the day plus order outstanding is
less than 8 books.
B. Order 8 books when the inventory at the beginning of the day plus order outstanding is
less than 8.
Currently (beginning 1st day) the store has a stock of 8 books plus 6 books ordered two days
ago and expected to arrive next day.
Using Monte-Carlo Simulation for 10 cycles, recommend, which option the manager, should
choose.
The two digit random numbers are given below:
89 34 70 63 61 81 39 16 13 73
Answer
Demand Probability Cumulative Probability Random No. Range
0 0.05 0.05 00-04
1 0.10 0.15 05-14
2 0.30 0.45 15-44
3 0.45 0.90 45-89
4 0.10 1.00 90-99
Option - A
Random Opening Ordered Quantity Quanity for which
Day Demand ClosingStock
No. Stock receipt Order Placed
1 89 3 8 - 5 -
2 34 2 5 6 9 -
3 70 3 9 - 6 0
4 63 3 6 - 3 5
5 61 3 3 0 0 -
6 81 3 0 5 2 5
7 39 2 2 - 0 5
8 16 2 0 5 3 -
9 13 1 3 5 7 -
10 73 3 7 - 4 5
Ordering cost 4 × 10 ` 40
Carrying cost 0.5 × 39 ` 19.50
Total Cost ` 59.50
Option B
Opening Ordered Quantity Quanity for which
Day R No. Demand ClosingStock
Stock receipt Order placed
1 89 3 8 - 5 -
2 34 2 5 6 9 -
3 70 3 9 - 6 -
4 63 3 6 - 3 8
5 61 3 3 - 0 -
6 81 3 0 8 5 -
7 39 2 5 - 3 8
8 16 2 3 - 1 -
9 13 1 1 8 8 -
10 73 3 8 - 5 -
45
Answer
Table-1: Probability Distribution (Supply)
Supply Probability Cum. Prob. Range Range of Random Nos. forsimulation
10 40/500 = 0.08 0.08 0 - 0.08 00 - 07
20 50/500 = 0.10 0.18 0.08 - 0.18 08 - 17
30 190/500 = 0.38 0.56 0.18 - 0.56 18 - 55
40 150/500 = 0.30 0.86 0.56 - 0.86 56 - 85
50 70/500 = 0.14 1.00 0.86 - 1.00 86 - 99
Table-2: Probability distribution (Demand)
Range of Random Nos.
Demand Probability Cum. Prob. Range
forsimulation
10 50/500 = 0.10 0.10 0 - 0.10 00 - 09
20 110/500 = 0.22 0.32 0.10 - 0.32 10 - 31
30 200/500 = 0.40 0.72 0.32 - 0.72 32 - 71
40 100/500 = 0.20 0.92 0.72 - 0.92 72 - 91
50 40/500 = 0.08 1.00 0.92 - 1.00 92 - 99
Table-3: Showing simulated data
Simulated data for supply Simulated data for demand
Day Random No. Supply (Kg.) Day Random No. Demand (Kg.)
1 31 30 1 18 20
2 63 40 2 84 40
3 15 20 3 79 40
4 07 10 4 32 30
5 43 30 5 75 40
6 81 40 6 27 20
Assume:
(i) The clock starts at 8:00 hours
(ii) Only one pump is set up.
(iii) The following12 Random Numbers are to be used to depict the customer arrival pattern:
78, 26, 94, 08, 46, 63, 18, 35, 59, 12, 97 and 82.
(iv) The following 12 Random Numbers are to be used to depict the service pattern: 44, 21,
73, 96, 63, 35, 57, 31, 84, 24, 05, 37
Answer
Inter-arrival time Service time
Average time spent by the customer waiting in the queue = 140/12 = 11.67 minutes
Total idle time
Probability of idle time of petrol station = = 12/86 = 0.1395 time of the
Total Operating
Service Channel*
*Service End Time – 9.26 Hrs. Service Channel opened at 8.00 hrs. i.e. Total Time of the Service
Channel = 1 hr. 26 Mins = 86 Mins.
(a) Simulated the assembly of six parts, showing idle time in activity B, waiting time of each
part, and number of parts waiting. Note: omit the first random number of A so that
activity B begins at time zero.
(b) What was the average length of the waiting line ahead of B (in number of units)?
(c) What was the average output per hour of the assembly line?
Answer
(a) Our interest lies in activity b, so we can set up a table (below) to show when parts arrive
at B, how long it takes B, how long it takes B to work on them, and the resultant idle and
waiting times:
Part Available Activity B Waiting Number parts
Part Activity B Activity B
for Activity B Beginning Time of Waiting at B
Number Ending Time Idle Time
at Time Time Part End time
1 - 0 .5 0 0 0
2 .8 .8 1.2 .3 0 1
3 1.0 1.2 1.6 0 .2 1
4 1.5 1.6 2.5 0 .1 1
5 2.1 2.5 2.9 0 .4 2
6 2.6 2.9 3.5* 0 .3 2
7 2.9 1.0 ** 2
8 3.2
* Total run time.
**Total waiting time.
Activity B begins at 0, and it takes .5 minute to complete the first part. B is then idle for .3
minute until part 2 arrives from A at .8 minutes. Part 2 takes .4 minute, so the ending time is .8
+ .4 = 1.2 minutes. By this time part 3 has been waiting. 2 minute because it became available
at .8 + .2 = 1.0 minute, but work could not be begun on it until 1.2 minutes. However, before
activity B is finished on part 3 at 1.6 minutes, part 4 has arrived (at 1.0 + .5 = 1.5 minutes) and
so one part is waiting. We continue systematically in this manner through part 6, noting that
when it is finished at time were 3.5 minutes,there are two parts waiting, for their availability
times were 2.9 minutes and 3.2 minutes, respectively.
(b) The average length of the waiting line (that is, average inventory) ahead of B can be
expressed in equation form as follows:
Total waiting time
Average inventory =
Total run time
1.0 assembly minute
=
3.5 minutes
= 0.29 assembly
(c) Average output per hour:
Units/hr =
6 unit
( )
60 min
3.5 minutes hr
= 102.9 units/hr.
Answer
Computation of Random Interval for Processing Time
A1 A2
Process time Minutes
Pi ∑Pi Range Pi ∑Pi Range
10 0.10 0.10 0-9 0.20 0.20 0-19
11 0.15 0.25 10-24 0.10 0.60 20-59
12 0.40 0.65 25-64 0.20 0.80 60-79
13 0.25 0.90 65-89 0.15 .095 80-94
14 0.10 1.00 90-99 0.05 1.00 95-99
Answer
(a) Cumulative distributions are usually formulated on a scale where the cumulative
percentage is “more than”or “less than” a corresponding X axis amount. We shall use a
“less than” percentage and so will need to identify the upper- class boundaries (UCB) as
the Y coordinates for the cumulative distribution.
Weld Time Frequency Upper – Class Cumulative Number Of Cumulative Percent-
(Min) In Numbers Boundary (UCB) Times < UCB age Of Time < UCB
< .25 0 .25 0 0
.25 < .75 24 .75 24 12
.75 < 1.25 42 1.25 66 33
1.25 < 1.75 72 1.75 138 69
1.75 < 2.25 38 2.25 176 88
2.25 < 2.75 14 2.75 190 95
2.75 < 3.25 10 3.25 200 100
(b) The frequency distribution is constructed by extending vertical lines from the class
boundaries to the appropriate frequency level for the class. For the cumulative
distribution, values of the cumulative percentage of time < UCB are plotted at weld times
corresponding to the UCB. For example, the frequency (12 percent) is plotted at UCB =
.75 (as illustrated below).
80
72
80
72
60
60
42
40 38
42
40 38
24
20
24 14
10
20
14
10
0 0.75 1.75 2.75
0.25 1.25 2.25 3.25
100 100
Cumulativer Percentage of Time Values < UCB
80 80
Cumulativer Percentage of Time Values < UCB
80 80
60 60
60 60
40 40
40 40
RN 25
20 20
RN 25
20 20
0 0
0.75 1.75 2.75
0.25 1.25 2.25 3.25
0 0
Weld Time (min)
0.75 1.75 2.75
0.25 1.25 2.25 3.25
Weld Time (min)
(a) The simulated time for random number (RN) 25 is determined by entering the cumulative
graph at 25 (as shown by the arrow) and proceeding horizontally to the curve and then
down to the weld time. The resultant is a reading of 1.0 minute (rounded to the nearest.
25 minutes). Times for random number 90 and 59 are 2.5 and 1.5 minutes, respectively.
(A larger graph would lend more accuracy.)
(b) From the cumulative distribution, about 12 percent of the times exceed 2.0 minutes.
Answer
Simulation of data of an Automobile Production line
Production/day Probability Cumulative Probability Random No. Range
95 0.03 0.03 00-02
96 0.05 0.08 03-07
97 0.07 0.15 08-14
98 0.10 0.25 15-24
99 0.15 0.40 25-39
100 0.20 0.60 40-59
Simulated data
[Link] cars waiting to No. of empty space on the
Day Random No. Production
be shipped boat
1 20 98 - 3
2 63 101 - -
3 46 100 - 1
4 16 98 - 3
5 45 100 - 1
6 41 100 - 1
7 44 100 - 1
8 66 101 - -
9 87 103 2 -
10 26 99 - 2
11 78 102 1 -
12 40 100 - 1
13 29 99 - 2
14 92 104 3 -
15 21 98 - 3
Total 6 18
Average no. of cars waiting to be shipped = 6/15 = 0.40 per day