You are on page 1of 42

Prepared by: Youssry Hamdy- CS Diploma

OR 508 (Modeling and Simula on)


CS Diploma

1
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Solu on of Midcourse Exam Dec. 2010
Members of the Willow Creek Emergency Rescue Squad know from past experience that they will receive
between zero and six emergency calls each night, according to the following discrete probability distribution:

Calls 0 1 2 3 4 5 6
Probability 0.05 0.12 0.15 0.25 0.22 0.15 0.6

The rescue squad classifies each emergency call into one of three categories: minor, regular, or major
emergency. The probability that a particular call will be each type of emergency is as follows:

Emergency Minor Regular Major


Probability 0.30 0.56 0.14

The type of emergency call determines the size of the crew sent in response. A minor emergency requires
a two-person crew, a regular call requires a three-person crew, and a major emergency requires a five-
person crew.

Simulate the emergency calls received by the rescue squad for 10 nights, compute the average number of
each type of emergency call each night, and determine the maximum number of crew members that might
be needed on any given night.

Solution

Step 1. Develop Random Number Ranges for the Probability Distributions

Calls Probability Cumulative Probability Random Number Range, r1


0 .05 .05 1-5
1 .12 .17 6-17
2 .15 .32 18-32
3 .25 .57 33-57
4 .22 .79 58-79
5 .15 .94 80-94
6 .06 1.00 95-99
1.00

Emergency Cumulative
Probability Random Number Range, r2
Type Probability
Minor .30 .30 1-30

2
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma

Regular .56 .86 31-86


Major .14 1.00 87-99, 00
1.00
Step 2. Set Up a Tabular Simulation

Use the second column of random numbers in

Night r1 Number of Calls r2 Emergency Type Crew Size Total per Night
71 Regular 3
18 Minor 2
1 65 4 9
12 Minor 2
17 Minor 2
2 89 Major 5
48 3 18 Minor 2 10
83 Regular 3
3 08 1 90 Major 5 5
4 05 0 0 0

5 18 Minor 2
08 Minor 2
89 5 26 Minor 2 14
47 Regular 3
94 Major 5
6 06 1 72 Regular 3 3
47 Regular 3
68 Regular 3
7 62 4 14
60 Regular 3
88 Major 5
8 17 1 36 Regular 3 3
43 Regular 3
9 77 4 28 Minor 2 10
31 Regular 3
3
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
06 Minor 2
39 Regular 3
71 Regular 3
10 68 4 11
22 Minor 2
76 Regular 3
Step 3. Compute Results

Average number of Minor emnergency calls per night =

Average number of Regurlar emgergency calls per night =

Average number of Major emgergency calls per night =

If all the calls came in at the same time, the maximum number of squad members required during any 1
night would be 14.

Question: 2
Burlingham Mills produces denim cloth that it sells to jeans manufacturers. It is negotiating a contract
with Troy Clothing Company to provide denim cloth on a weekly basis. Burlingham has established its
monthly available production capacity for this contract to be between 0 and 600 yards, according to the
following probability distribution:

Troy Clothing's weekly demand for denim cloth varies according to the following probability distribution:

Demand (yd.) 0 100 200 300 400 500


Probability 0.3 0.12 0.20 0.35 0.20 0.10
Simulate Troy Clothing's cloth orders for 5 weeks and determine the average weekly capacity and
demand. Also determine the probability that Burlingham will have sufficient capacity to meet demand.
Use the following sets of random numbers:
{0.59, 0.43, 0.11, 0.82, 0.35} { 0.18, 0.86, 0.22, 0.62, 0.70}
Solution:
Step: 1 Develop Random Number Ranges for the Probability Distributions

Demand Probability Cumulative Probability Range


0 0.3 0.3 0-2
100 0.12 0.15 3-14
200 0.20 0.35 15-34
300 0.35 0.70 35-69
400 0.20 0.90 70-89
500 0.10 1.00 90-99
4
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
1.00 100

Production is uniformly distributed variable ranges from 0 to 600, such that it needs to be converted to
discrete using the following formula:
a+r (b-a) = a=0, b=600
0+r(600-0)= 600r
Step: 2 Tabular Simulation:

weeks Rn1 Production Rn2 Demand [a+r(b-a)] 600


1 0.59 300 0.18 0.18 x 600= 108
2 0.43 300 0.86 516
3 0.11 100 0.22 132
4 0.82 400 0.62 372
5 0.35 300 0.70 420
1400 1548

Step: 3 Computations:
Average weekly capacity production: = 280 Yards per week.
Average weekly Demand: = 309.6 310 Yards per week.

Ex:

ComputerWorld Company demand data for laptops selling for $4,300 per unit over a period of 15 weeks. Simulate
the demand and compute the average demand and revenue for this company. Use the following data:

PCs Demanded per week Frequency of Demand Probability of Demand, p(x)


0 20 0.2
1 40 0.4
2 20 0.2
3 10 0.10
4 10 0.10
Total 100 1.00
Step: 1 Develop Random number ranges for the probability distribution

Probability of Demand, Ranges of Random


PCs Demanded per week Cumulative Probability
p(x) number
0 0.2 0.2 0.0-19
1 0.4 0.6 20-59
2 0.2 0.8 60-79
3 0.1 0.9 80-89
4 0.1 1.0 90-99
Total 1.00 1.0
Step: 2 Use tabular simula on:

Weeks Random number of demand Demand Revenue ($)


1 39 1 (1x4,300) = 4,300
5
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
2 73 2 8,600
3 72 2 8,600
4 75 2 8,600
5 37 1 4,300
6 02 0 0
7 87 3 12,900
8 98 4 17,200
9 10 0 0
10 47 1 4,300
11 93 4 17,200
12 21 0 0
13 95 4 17,200
14 97 4 17,200
15 69 2 8,600
31 $ 133,300
Step: 3 Computa ons:

Average Demand= =2.07 laptop PCs per week.

Average Revenue= =$ 8,920.

Simulation of a queuing system of Burlingham Mills


Given the following data simulate the system for 10 days and compute average waiting time and
average time in the system.

Distribution of Arrival Intervals Distribution of Service Times


Arrival interval (Days), x Probability Service Time (Days), y Probability
1 20 5 20
2 40 1 50
3 30 2 30
4 10
Step: 1 Develop Random number ranges for the probability distribution for arrival intervals:

Arrival interval (Days), x Probability Cumulative Probability Range


1 20 20 0-19
2 40 60 20-59
3 30 90 60-89
4 10 100 90-99
Develop Random number ranges for the probability distribution of service times:

Service Time (Days), y Probability Cumulative Probability Range


5 20 20 0-19
1 50 70 20-69
2 30 100 70-99

6
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma

Step: 2 Tabular Simula on:

Arrival Arrival Enter Waiting Service Departure Time in


Batch Rn1 Rn2
Interval, x Clock Facility clock time Time, y Clock system
1 - - 0.0 0.0 0.0 65 1.0 1.0 1.0
2 71 3 3.0 3.0 0.0 18 0.5 3.5 0.5
3 12 1 4.0 4.0 0.0 17 0.5 4.5 0.5
4 48 2 6.0 6.0 0.0 89 2.0 8.0 2.0
5 18 1 7.0 8.0 1.0 83 2.0 10.0 3.0
6 08 1 8.0 10.0 2.0 90 2.0 12.0 4.0
7 05 1 9.0 12.0 3.0 89 2.0 14.0 5.0
8 18 1 10.0 14.0 4.0 08 5.0 14.5 4.5
9 26 2 12.0 14.5 2.5 47 1.0 15.5 3.5
10 94 4 16.0 16.0 0.0 06 0.5 16.5 0.5
Total 12.5 24.5
Step: 3 Computa ons:

Average Waiting time= = 1.25 days / 10 batches

Average time in system= = 2.45 days / 10 batches

Ex:
Harrys Company is producing vehicles tires according to the following probability distribution. Simulate
the demand for 10 days and compute average demand.

Demand for Tires Frequency Probability


0 10 5
1 20 10
2 40 20
3 60 30
4 40 20
5 30 15
Total 200 100.0
Step: 1 Develop Random number ranges for the probability distribution of tires demand:

Demand for Tires Probability Cumulative Probability Range


0 5 5 0-4
1 10 15 5-14
2 20 35 15-34
3 30 65 35-64
4 20 85 65-84
7
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
5 15 100 85-99
100.0

Step: 2 Tabular Simula on

Days Rn Demand
1 52 3
2 37 3
3 82 4
4 69 4
5 98 5
6 96 5
7 33 2
8 50 3
9 88 5
10 90 5
39
Step: 3 Computa ons:

Demand per day= = 3.9 tires / 10 days

Lecture Example:

Compcomm, Inc. is an international communications and information technology company. A stock


analyst would like to use simulation to predict the stock prices of Compcomm for an extended period.
Based on historical data, the analyst has developed the following probability distribution for the
movement of Compcomm stock prices per day:

Stock Price Movement Probability


Increase 0.45
Same 0.3
Decrease 0.25
1
The analyst has also developed the following probability distributions for the percentage of the
increases or decreases in the stock price per day:

Stock Price Change Increase Decrease


12.50% 0.4 0.12
25% 0.17 0.15
37.50% 0.12 0.18

8
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
50% 0.1 0.21
62.50% 0.08 0.14
75% 0.07 0.1
87.50% 0.04 0.05
100% 0.02 0.05
1 1
The price of the stock is currently 62.

Develop a simula on model to track the stock price of Compcomm stock and simulate for 10 days.
Indicate the new stock price at the end of the 10 days

Use the following sets of random numbers:

17, 95, 21, 78, 58,24, 33, 45, 77, 48

37, 79, 49, 12, 38,48, 13, 93, 55, 96

Step: 1 Develop Random number ranges for the probability distribution for price movement:

Stock Price Movement Probability Cumulative Probability Range


Increase 45 45 0-44
Same 30 75 45-74
Decrease 25 100 75-99
100.0
Develop Random number ranges for the probability distribution for the percentage of increases and
decreases in stock price:

Increase:

Stock Price
Probability Cumulative Probability Range
Change
12.50% 40 40 0-39
25% 17 57 40-56
37.50% 12 69 57-68
50% 10 79 69-78
62.50% 8 87 79-86
75% 7 94 87-93
87.50% 6 100 94-99
Decrease:

Stock Price
Probability Cumulative Probability Range
Change
12.50% 12 12 0-11
25% 15 27 12-26
37.50% 18 45 27-44
50% 21 66 45-65
9
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
62.50% 14 80 66-79
75% 10 90 80-89
87.50% 10 100 90-99

Step: 2 Tabular Simula on

Stock Price Stock Price


Days Rn1 Rn2 Price
Movement Change
1 17 Increase 37 12.5% =7.75+62= 70
2 95 Decrease 79 62.5% 23.25
3 21 Increase 49 25% 77.5
4 78 Decrease 12 25% 46.5
5 58 Same 38 0 62
6 24 Increase 48 25% 77.5
7 33 Increase 13 12.5% 70
8 45 Same 93 0 62
9 77 Decrease 55 50% 31
10 48 Same 96 0 62

Ex: 14 page 62

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 times between arrivals and the service-time
distribution follow:

Time between Arrivals (Minutes) Probability Service Time (Minutes) Probability


0 9 1 20
1 17 2 40
2 27 3 28
3 20 4 12
5 12
Simulate the operation of the drive-in teller for 10 new customers. The rst of the 10 new customers arrives at a
me determined at random. Start the simula on with customer being served, leaving at me 3, and on in the
queue. How many customers went into the bank to transact business?
Solution:

Step: 1 Develop Random number ranges for the probability distribution for time between arrivals:

Time between Arrivals Probability Cumulative Probability Range

10
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
0 9 9 0-8
1 17 26 9-25
2 27 53 26-52
3 20 73 53-72
4 15 88 73-87
5 12 100 88-99

Service Time Probability Cumulative Probability Range


1 20 20 0-19
2 40 60 20-59
3 28 88 60-87
4 12 100 88-99

Rn for Time Time Go into the


Rn for Interarrival Clock Service No. in
Customer Service Service Service Bank?
Arrival Time Time Time Queue
Time Begin Ends Yes No
1 30 2 2 27 2 1 -
2 46 2 4 26 2 0 4 6
3 39 2 6 99 4 0 6 10s
4 86 4 10 72 3 0 10 13
5 63 3 13 12 1 0 13 14
6 83 4 17 17 1 0 17 18
7 07 0 17 78 3 1 18 21
8 37 2 19 91 4 1 -
9 69 3 22 82 3 0 22 25
10 78 4 26 62 3 0 26 29

Two customers only will go into the bank to transact business.

Lecture Example:

PortaCom manufacturers personal computers and related equipments. PortaComs product design group
developed a prototype for a new high-quality portable printer. The new printer features an innovative design and
has the potential to capture a significant share of the portable printer market. Preliminary marketing and financial
analyses provided the following selling price, first year administrative cost, and first-year advertising cost:
Selling price=$ 249 per unit
Administra ve cost= $ 400,000
Adver sing cost= $ 600,00
in the simulation model for the PortaCom problem the proceeding values are constants and are referred to as
parameters of model. The cost of parts and the first-year demand for the printer are not known with certainty
and are considered probabilistic inputs. At this stage of planning process, PortaComs best estimates of these
inputs are $ 45 per unit for the direct labor cost $ 90 per unit for parts cost, and 15,000 units for rst-year
11
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
demand. PortaCom would like an analysis of first-year profit potential for printer. Because of PortaComs tight
cash flow situation, management is particularly concerned about the potential for a loss.
where Direct labor cost and parts cost

Direct labor cost per unit Probability


43 0.1
44 0.2
45 0.4
46 0.2
47 0.1
Parts cost: depends on the general economy, the overall demand for parts, and pricing policy of PoraComs parts
suppliers. portCom believes that the parts cost will range from $80 to $100 per unit is described by uniform
probability distribution.
Solution:

Profit = (selling price Direct labor cost per unit parts cost per unit)(demand)-(Admin cost +ad Cost)

Letting c1 = direct labor cost per unit

C2 = parts cost per unit

X=first-year demand

The profit model for the first year can be as follows:


Prot=(249-c1-c2)x-1,000,000
Profit=(249-45-90)(15,000)-1,000,000=114 x 15,000=1,710,000-1,000,000=710,000

Direct labor cost per unit Probability Cumulative Range


43 0.1 0.1 0.0-0.1
44 0.2 0.3 0.1-0.3
45 0.4 0.7 0.3-0.7
46 0.2 0.9 0.7-0.9
47 0.1 1.0 0.9-1.0
Parts cost = a+r(b-a) = 80+r(100-80)=80+r20
we will use set of 10 random number to calculate the parts cost {0.6953, 0.0082, 0.1514, 0.4013, 0.3125,
0.8166,0.9439,0.5448,0.3813,0.5389}

Parts cost

Trials Rn Parts cost $ [a+r(b-a)]


1 0.6953 80+0.6953(20)=94
2 0.0082 80
3 0.1514 83
4 0.4013 88
5 0.3125 86
6 0.8166 96
7 0.9439 99
8 0.5448 91
12
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
9 0.3813 87
10 0.5389 90
Estimate first-year demand:

Trials Rn Demand
1 0.7005 17,366
2 0.3204 12,900
3 0.9868 20,686
4 0.1804 10,888
5 0.4346 14,259
6 0.9605 22,904
7 0.5647 15,732
8 0.7334 17,804
9 0.0216 5,902
10 0.3218 12,918
Tabular Simulation

Trials Direct Labor Cost per unit ($) Parts Cost per unit ($) Units Sold Profits $
1 47 94 17,366 1,023,570
2 44 80 12,900 461,828
3 45 83 20,686 1,288,906
4 43 88 10,888 169,807
5 45 86 14,259 648,911
6 44 96 22,904 1,526,769
7 45 99 15,732 814,686
8 45 91 17,804 1,165,501
9 45 87 5,902 -350,131
10 46 90 12,918 385,585
Total 449 912.64 151,359 7,137,432
Average 44,9 91.26 15,359 713,743.2

----------------------------------------------------------------------------------------------------------------------------------------------

Lecture Example:

25- Tracy McCoy is shopping for a new car. She has identified a particular sports utility vehicle she likes
but has heard that it has high maintenance costs. Tracy has decided to develop a simulation model to help
her estimate maintenance costs for the life of the car. Tracy estimates that the projected life of the car
with the first owner (before it is sold) is uniformly distributed with a minimum of 2.0 years and a
maximum of 8.0 years. Furthermore, she believes that the miles she will drive the car each year can be
defined by a triangular distribution with a minimum value of 3,700 miles, a maximum value of 14,500
miles, and a most likely value of 9,000 miles. She has determined from Automobile Association data that
the maintenance cost per mile driven for the vehicle she is interested in is normally distributed, with a
mean of $0.08 per mile and a standard deviation of $0.02 per mile. Using Crystal Ball, develop a
simulation model (using 10 trials) and determine the average maintenance cost for the life of the car
with Tracy and the probability that the cost will be less than $3,000.
Solution:

13
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
1. The car life cost is uniformly distributed [a=2.0, b =8.0]
2. The Mile drive is triangular distributed [a=3,700, b=14,500, c=9,000]
3. Maintenance cost is normally distributed [ = 0.8, = 0.02]
Convert uniform distribution using the formula a+r(b-a)
2.0+r(8.0-2.0) = r 6.0
Convert Triangular distribution

Find h value =

Convert Maintenance =

Step: 1 Develop probability distribution ranges: (Car life cost)

Trials Rn Car life cost ($) [a+r(b-a)] r6


1 0.405 2.43
2 0.173 1.038
3 0.011 0.066
4 0.529 3.174
5 0.004 0.024
6 0.514 3.084
7 0.691 4.146
8 0.654 3.924
9 0.709 4.254
10 0.412 2.472
24.612
Develop probability distribution ranges: (Mile Drive)

Trials Rn Mile Drive (0.926)


1 0.726 0.672
2 0.009 0.008
3 0.369 0.342
4 0.571 0.529
5 0.828 0.767
6 0.237 0.219
7 0.605 0.560
8 0.275 0.255
9 0.949 0.879
10 0.865 0.672
4.903

14
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Develop probability distribution ranges: (Maintenance cost)
Z x = x , X = z + ,
X= -Z, if r < 0.5, X= if r =0.5, X=+z if >0.5, if r > 0.5 (r-0.5)

Trials Rn Maintenance cost (0.4177)


1 0.930 0.033
2 0.014 0.117
3 0.995 0.280
4 0.796 0.103
5 0.588 0.197
6 0.758 0.017
7 0.040 0.150
8 0.607 0.099
9 0.286 0.137
10 0.351 0.033
2.272

Maintenance Total cost=car life cost Mile+


Trials Car life cost Mile driven/Year
cost/mile Maintenance
1 2.43 0.672 0.033 1.135
2 1.038 0.008 0.117 1.163
3 0.066 0.342 0.280 0.688
4 3.174 0.529 0.103 3.806
5 0.024 0.767 0.197 0.988
6 3.084 0.219 0.017 3.32
7 4.146 0.560 0.150 4.856
8 3.924 0.255 0.099 4.278
9 4.254 0.879 0.137 5.27
10 2.472 0.672 0.033 3.177
24.612 4.903 2.272 28.681
Average 0.4475 0.0891 0.0313 2.68

The average cost of car life = $2,680


The probability that the cost will be less than $3,000.
P (x 3,000)
Z=

___________________________________________________________________________________
Ex: A city is served by two newspapers the Tribune and the Daily News. Each Sunday readers purchase
one of the newspapers at a stand. The following matrix contains the probabilities of a customer's buying a
particular newspaper in a week, given the newspaper purchased the previous Sunday:

This Sunday Next Sunday


Tribune Daily News

15
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Tribune

Daily News

Simulate a customer's purchase of newspapers for 10 weeks to determine the steady-state probabilities of
a customer buying each newspaper in the long run.

Solution:
Step: 1 Develop distribution ranges for this week:

Newspaper Probability Cumulative Probability Range


Tribune 0.65 0.65 0-64
Daily News 0.35. 1.00 65-99
1.00

Develop distribution ranges for next week:

Newspaper Probability Cumulative Probability Range


Tribune 0.45 0.45 0-44
Daily News 0.55 1.00 45-99
1.00

Step: 2 Tabular Simulation

Newspaper
Trials Rn
Daily News Tribune
1 66 1 0
2 09 0 1
3 39 0 1
4 60 0 1
5 66 1 0
6 20 0 1
7 19 0 1
8 71 1 0
9 86 1 0
10 82 1 0
Total 5 5

16
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Probabilities of a customer buying each newspaper in the long run
Daily News =

Tribune =

Book Example: 2.5 page: 46


A milling machine has different bearings that fail in service. The distribution of the life of each bearing is identical,
as it indicated below. When a bearing fails, the mill stops, a repairperson is called, and a new bearing is installed.
The delay time of repairpersons arriving at the milling is also a random variable having the distribution in the
given table. Down me for the es mated at $10 per minute. The direct on-site cost of the repairperson is $30 per
hour. It takes 20 minutes to change one bearing, 30 minutes to change two bearings, and 40 minutes to change
three bearings. A proposal has been made to replace all three bearings whenever a bearing fails. Management
needs an evaluation of proposal. The total cost per 1, 0000 bearings-hours will be used as the measure of
performance.
The below table represent a simula on of 15 bearings changes under the current method of operation. Note that
there are instances where more than one bearing fails at the same time. This is unlikely to occur in practice and is
due to using a rather coarse grid of 100 hours for bearing life. It will be assumed in this example that the times
are never exactly the same and thus nor more than one bearing is changed at any breakdown.

Bearing life hours 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900
Probability 0.10 0.13 0.25 0.13 0.0 0.12 0.02 0.06 0.05 0.05
Delay Time Distribution

Delay Time (Minute) 5 10 15


Probability 0.6 0.3 1.0

Step: 1 develop probability distribu on range for Bearing-life Distribution.

Bearing life hours Probability Cumulative probability Range


1000 0.10 0.10 0-9
1100 0.13 0.23 10-22
1200 0.25 0.48 23-47
1300 0.13 0.61 48-60
1400 0.09 0.70 61-69
1500 0.12 0.82 70-81
1600 0.02 0.84 82-85
1700 0.06 0.90 84-89
1800 0.0 5 0.95 90-94
1900 0.0 5 1.00 95-99
Develop probability distribution range for Bearing-life Distribution.

Delay Time (Minutes) Probability Cumulative probability Range


5 0.6 0.6 0-5
10 0.3 0.9 6-8
17
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
15 0.1 1.0 9-00

2- Step: Tabular Simulation Bearing replacement under current method:

Bearing 1 Bearing 2 Bearing3


Life Delay Life Delay Delay
Trials Rd1 Rd2 Rd3 Rd4 Rd5 Life Hours Rd6
Hours Time Hours Time Time
1 67 1400 7 10 71 1500 8 10 18 1100 6 10
2 55 1300 3 5 21 1100 3 5 17 1100 2 5
3 98 1900 1 5 79 1600 3 5 65 1400 2 5
4 76 1500 6 10 88 1700 1 5 03 1000 9 15
5 53 1300 4 5 93 1800 0 5 54 1300 8 10
6 69 1400 8 10 77 1500 6 10 17 1100 3 5
7 80 1600 5 5 08 1000 9 15 19 1100 6 10
8 93 1800 7 10 21 1100 8 10 09 1000 7 10
9 35 1200 0 5 13 1100 3 5 61 1400 1 5
10 02 1000 5 5 03 1000 2 5 84 1700 0 15
11 99 1900 9 15 14 1100 1 5 11 1100 5 5
12 65 1400 4 5 05 1000 0 5 25 1200 2 5
13 53 1300 7 19 29 1200 2 5 86 1700 8 10
14 87 1700 1 5 07 1000 4 5 65 1400 3 5
15 90 1800 2 5 20 1100 3 5 44 1200 4 5
Total 119 100 120
Bearing changed at any breakdown. The cost of the current is estimated as follows:
cost of bearing = 47 bearings X $32/bearing = $ 1,504
Cost of delay me = (110=110+105) minutes x $10.minute = $ 3,250
cost of down me during repair = 45 bearings x 20 minutes/bearing x $10 minute = $9,000
Cost of repairperson = $45 bearings x 20 minutes/bearing x $30/60 minutes = $450
Total Cost = $ 1,440+$3,250+$9,000+$450=$ 14,140
Total life of bearings = (22,300+18,700+18,600) 59,600 hours. Therefore, the total cost per 10,000 bearings-hours
is ($14,140/5.96) = $2,372.
Proposed Method:

Bearing1 Bearing2 Life Bearing3Life First Failure


Trails Delay (minute)
Life(hours) (hours) (hours) (hours)
1 1700 1100 1000 1000 10
2 1000 1800 1200 1000 5
3 1500 1700 1300 1300 5
4 1300 1100 1800 1100 5
5 1200 1100 1300 1100 5
6 1000 1200 1000 1100 10
7 1500 1700 1200 1200 5
8 1300 1700 1000 1000 10
9 1800 1200 1100 1100 15
10 1300 1300 1100 1100 5
11 1400 1300 1900 1300 10
12 1500 1300 1400 1300 5
18
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
13 1500 1800 1200 1200 10
14 1000 1900 1400 1000 5
15 1300 1700 1700 1300 5
Total 110
Cost of bearings = 45 bearings x $ 32/bearing =$ 1,44,
Cost of delay me = 110 minutes x $ 10/minute = $ 1.100
Cost of down me during repairs = 15 sets x 40 minutes/ set x $10/ minute = $6,000
Cost of repairpersons = 15 sets x 40 minutes/set x $30/60 minutes = $300.
Total cost = $ 1,440 +$1,100+$6,000+$300=$8,840
The total life of bearings = (17,000x3) 51,000 hours. Therefore, the total cost per 10,000 bearings-hours is
($8,840/5.1)=$1.733
The new policy generates a savings of $ 634 per 10,000 hours bearing-life.

Ex. Page 40: News Dealer's Problem


The new stand buys the papers for 33 cents each and sells them for 50 cents each. Newspapers not sold at the
end of the day are sold as scrap for 5 cents each. Newspapers can be purchased in bundles of 10 thus; the
newsstand can buy 50, 60, and so on. There're three types of newsdays: 'Good", "Fair" and "Poor"; they have the
probabili es 0.35, 0.45 and 0.20, respec vely. The distribu on of newspapers demanded on each of these days us
given below. The problem is to compute the optimal number of papers the newsstand should purchase. This will
be accomplished by simula ng demands for 10 days and recording prots from sales each day.

Profit = (Revenue from sales)-(Cost of newspapers)-(lost profit from excess demand)+(salvage from sale of scrap
papers).

Demand Probability Distribution


Demand
Good Fair poor
40 0.03 0.10 0.44
50 0.05 0.18 0.22
60 0.15 0.40 0.16
70 0.20 0.20 0.12
80 0.35 0.08 0.06
90 0.15 0.04 0.00
100 0.07 0.00 0.00

Type of News probability Distribution

Type of News Probability


Good 0.35
Fair 0.45
Poor 0.20
Solution:
Step: 1 Develop probability distribu on range for newspapers demand .

Type of News Probability Cumulative Distribution Range


Good 0.35 0.35 0-34
19
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Fair 0.45 0.75 35-74
Poor 0.20 1.0 75-99
Step: 2 Develop probability distribu on range for newspaper type .

Cumulative Distribution Ranges


Demand
Good Fair Poor Good Fair Poor
40 0.03 0.10 0.44 0-2 0-9 0-43
50 0.08 0.28 0.66 3-7 10-27 44-65
60 0.23 0.68 0.82 8-22 28-67 66-81
70 0.43 0.88 0.94 23-42 68-87 82-93
80 0.78 0.96 0.1 43-77 88-95 94-95
90 0.93 0.1 0.1 78-92 96-97 96-97
100 1.0 0.1 0.1 93-99 98-99 98-99

Step: 3 Tabular Simula on:

Rn1 for Lost profit Salvage


Type of Rn2 for Revenue Daily
Day newspaper Demand from excess from sale of
newspaper Demand from sales profit
type Demand scrap
1 58 Fair 93 80 $35.00 $1.70 - $ 10.2
2 17 Good 63 80 35.00 1.7 - 10.20
3 21 Good 31 70 35.00 - - 11.90
4 45 Fair 19 50 25.00 - 1.00 2.90
5 43 Fair 75 70 35.00 1.70 - 10.20
6 36 Fair 84 80 35.00 - - 11.90
7 27 Good 37 70 35.00 3.40 - 8.50
8 73 Fair 23 50 30.00 - 0.50 7.40
9 86 Poor 02 40 20.00 - 1.50 -1.60
10 19 Good 53 70 20.00 - 1.50 -1.60
Total $ 300.00 $ 17.00 $10.00 $161.00

The op mal number the newsstand (10 days x $0.33 x 70) = $ 231

Ex: The time between arrivals of cars at the Petroco Service Station is defined by the following
probability distribution:

Time Between Arrivals (min.) 1 2 3 4


Probability 0.15 0.30 0.40 0.15
Simulate the arrival of cars at the service station for 10 arrivals and compute the average time between
arrivals.

20
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Solution:
Step:1 Develop probability distribution range for Time between Arrivals .

Time Between
Probability Cumulative Distribution Range
Arrivals (min.)
1 0.15 0.15 0-14
2 0.30 0.45 15-44
3 0.40 0.85 45-84
4 0.15 1.00 85-99

Step: 2 Tabular Simulation

Trials Rn Time Between Arrivals (min.)


1 71 3
2 18 2
3 12 1
4 17 2
5 89 4
6 18 2
7 83 3
8 90 4
9 18 2
10 08 1
24

24
The Average Time between Arrivals= =2.4 Minute/Car
10

Ex: The Dynaco Manufacturing Company produces a product in a process consisting of operations of
five machines. The probability distribution of the number of machines that will break down in a week
follows:

Machine Breakdowns per Week 0 1 2 3 4 5


Probability 0.10 0.10 0.20 0.25 0.30 0.5

a. Simulate the machine breakdowns per week for 10 weeks.


b. Compute the average number of machines that will break down per week.

Solution:
Step: 1 Develop probability distribution range for Time between Arrivals .

Machine Breakdown Per week Probability Cumulative Distribution Range


0 0.10 0.10 0-9
1 0.10 0.20 10-19
2 0.20 0.40 20-39
3 0.25 0.65 40-64
21
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
4 0.30 0.95 65-94
5 0.5 1.00 95-99

Step: 2 Tabular Simulation

Machine 1 Machine 2 Machine 3 Machine 4 Machine


Weeks Rn1 Rn2 Rn3 Rn4 Rn5
Breakdown Breakdown Breakdown Breakdown Breakdown 5
1 65 4 71 4 26 2 28 2 77 4
2 48 3 18 1 47 3 31 2 35 2
3 08 0 12 1 94 4 06 0 0 0
4 05 0 17 1 72 4 39 2 90 4
5 89 4 89 4 47 3 71 4 69 4
6 06 0 18 1 68 4 22 2 55 3
7 62 3 83 4 60 3 76 4 10 1
8 17 1 90 4 88 4 80 4 72 4
9 77 4 18 1 36 2 95 5 06 0
10 68 4 08 0 43 3 11 1 40 3
23 21 32 26 25

23 + 21 + 32 + 26 + 25
Average number of machines that will break down per week= = 10.4
10

Ex: Every time a machine breaks down at the Dynaco Manufacturing Company , either 1, 2, or 3 hours
are required to fix it, according to the following probability distribution:

Repair Time (hr.) 1 2 3


Probability 0.30 0.50 0.20

a. Simulate the repair time for 10 weeks and then compute the average weekly repair time.
b. If the random numbers that are used to simulate breakdowns per week are also used to simulate
repair time per breakdown, will the results be affected in any way? Explain.
c. If it costs $50 per hour to repair a machine when it breaks down (including lost productivity),
determine the average weekly breakdown cost.
d. The Dynaco Company is considering a preventive maintenance program that would alter the
probabilities of machine breakdowns per week as shown in the following table:

Machine Breakdowns per Week 0 1 2 3 4 5


Probability 0.20 0.30 0.20 0.15 0.10 0.5
The weekly cost of the preventive maintenance program is $150. Using simula on, determine whether the
company should institute the preventive maintenance program.
Solution:
Step: 1 Develop probability distribution machine repair time .

Repair Time (hr.) Probability Cumulative Distribution Range


1 0.30 0.30 0-29
2 0.50 0.80 30-79
22
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
3 0.20 1.00 80-99

a) Repair Time Simulation for 10 days:

Machine 1 Machine 2 Machine 3 Machine 4 Machine 5


Weeks Rn1 Rn2 Rn3 Rn4 Rn5
Repair Time Repair Time Repair Time Repair Time Repair Time
1 62 2 77 2 30 2 62 2 16 1
2 54 2 35 2 71 2 27 1 52 2
3 82 3 18 1 18 1 73 2 98 3
4 48 2 79 2 01 1 84 3 79 2
5 10 1 75 2 85 3 81 3 82 3
6 82 3 92 3 83 3 26 1 34 2
7 82 3 48 2 67 2 38 2 51 2
8 81 3 13 1 53 2 0 1 65 2
9 95 3 56 2 88 3 64 2 16 1
10 05 1 85 3 04 1 96 3 09 1
23 20 20 20 19

23 + 20 + 20 + 20 + 19
Average weekly Repair Time = = 10.3 Hour per machine/Week
10
b) If the same random numbers that are used to simulate breakdowns per week are also used to simulate
repair time per breakdown:

Machine 1 Machine 2 Machine 3 Machine 4 Machine 5


Weeks Rn1 Rn2 Rn3 Rn4 Rn5
Repair Time Repair Time Repair Time Repair Time Repair Time
1 65 2 71 2 26 1 28 1 77 2
2 48 2 18 1 47 2 31 2 35 2
3 08 1 12 1 94 3 06 1 0 1
4 05 1 17 1 72 2 39 2 90 3
5 89 3 89 3 47 2 71 2 69 2
6 06 1 18 1 68 2 22 1 55 2
7 62 2 83 3 60 2 76 2 10 1
8 17 1 90 3 88 3 80 3 72 2
9 77 2 18 1 36 2 95 3 06 1
10 68 2 08 1 43 2 11 1 40 2
17 17 21 18 18

if we used the random number used in problem # 3, the result of average repair time will be affected
as follows:
17 + 17 + 21 + 18 + 18
Average weekly Repair Time = = 9.1 Hour per machine/Week
10
The difference between using dierent random numbers and the same random numbers are 10.3 9.1=1.2
hours per machine/week

c) The Average weekly breakdown cost

Machine Breakdown Per week Probability Cumulative Distribution Range


23
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
0 0.30 0.30 0-29
1 0.20 0.50 30-49
2 0.20 0.70 50-69
3 0.15 0.85 70-83
4 0.10 0.95 84-94
5 0.5 1.00 95-99

Machine 1 Machine 2 Machine 3 Machine 4 Machine


Weeks Rn1 Rn2 Rn3 Rn4 Rn5
Breakdown Breakdown Breakdown Breakdown Breakdown 5
1 62 2 77 3 30 1 62 2 16 0
2 54 2 35 1 71 3 27 0 52 2
3 82 3 18 0 18 0 73 2 98 5
4 48 1 79 3 01 0 84 4 79 3
5 10 0 75 3 85 4 81 4 82 3
6 82 3 92 4 83 4 26 0 34 1
7 82 3 48 1 67 2 38 1 51 2
8 81 3 13 0 53 0 0 0 65 2
9 95 5 56 2 88 4 64 2 16 0
10 05 0 85 4 04 0 96 5 09 0
22 21 18 20 18

Weekly breakdown Cost per machine


Machine 1 = 22 hrs x ($50) =$ 1,100
Machine2 =21 hrs x ($50) = $ 1,050
Machine3 = 18 hrs x ($50) = $ 900
Machine4 = 20 hrs x ($50) = $ 1,000
Machine5 = 18 hrs x ($50) = $ 900
Total weekly breakdown cost = $1,100+$1,050+$900+$1,000+$900=$ 4,950
$4,950
Average weekly breakdown cost = =$ 495 per machine/weekly
10
d) Preventive maintenance program
weekly preventive cost program = $ 150
Weekly maintenance cost = Machine breakdown hours x weekly preventive cost
Machine1 = 22 x $ 150 = $ 3,300
Machine2 = 21 x $ 150 = $ 3,150
Machine3 = 18 x $ 150 = $ 2,700
Machine4 = 20 x $ 150 = $ 3,000
Machine5 = 18 x $ 150 = $ 2,700
Total weekly cost of new Preventive maintenance program= 3,300+3,150+2,700+3,000+2,700= $
14,850
$14,850
Average cost of new Preventive maintenance program= =$ 1,485 per machine/weekly
10
Difference between the old system and new system = $ 1,485 - $ 495 = $ 990
Decision: the old system is more feasible than the new Preventive maintenance program because the old
system will save $ 4,950 ($ 990 x 5) weekly to the company. So it is recommended to keep the old system
than adopting the new one.
24
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Ex: Sound Warehouse in Georgetown sells CD players (with speakers), which it orders from Fuji
Electronics in Japan. Because of shipping and handling costs, each order must be for 5 CD players.
Because of the time it takes to receive an order, the warehouse outlet places an order every time the
present stock drops to 5 CD players. It costs $100 to place an order. It costs the warehouse $400 in lost
sales when a customer asks for a CD player and the warehouse is out of stock. It costs $40 to keep each
CD player stored in the warehouse. If a customer cannot purchase a CD player when it is requested, the
customer will not wait until one comes in but will go to a competitor. The following probability
distribution for demand for CD players has been determined:

Demand per Month 0 1 2 3 4 5 6


Probability 0.4 0.8 0.28 0.40 0.16 0.2 0.2

The time required to receive an order once it is placed has the following probability distribution:

Time to Receive an Order (mo.) 1 2 3


Probability 0.60 0.30 0.10
The warehouse has five CD players in stock. Orders are always received at the beginning of the week. Simulate
Sound Warehouse's ordering and sales policy for 10 months and Compute the average monthly cost.

Solution:
Step: 1 Develop probability distribu on for Monthly demand:

Demand Per Month Probability Cumulative Distribution Range


0 0.4 0.8 0-7
1 0.8 0.12 8-11
2 0.28 0.40 12-39
3 0.40 0.80 40-79
4 0.16 0.96 80-95
5 0.2 0.98 96-97
6 0.2 1.00 98-99
Develop probability distribution for Time receives order:

Time to Receive an Order (mo.) Probability Cumulative Distribution Range


1 0.60 0.60 0-59
2 0.30 0.90 60-89
3 0.10 1.00 90-99

Step: 2 Tabular Simula on:

Rn2 for
Time to
Rn1 for Time to Cost (Order place lost
Months Demand receive Sales stock
Demand receive an sales +order holding)
and order
order
1 39 2 19 1 3 2 40x2=$80
2 65 3 90 3 2 0 1x100x400=$40,000
3 76 3 69 2 0 0 3x100x400=$120,000
4 45 3 64 2 3 2 40x2=$80

25
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
5 96 5 61 2 2 0 3x100x400=$120,000
6 73 3 20 1 0 3 40x3=$120
7 71 3 31 1 3 0 0
8 00 0 99 3 0 0 0
9 70 3 00 1 0 3 3x100x400=$120,000
10 99 6 85 2 3 0 2x100x400=$80,000
31 18 $ 480,280

$480,280
Average Monthly Cost = = $ 48,028 per month
10

Ex: The emergency room of the community hospital in Farmburg has one receptionist, one doctor, and
one nurse. The emergency room opens at time zero, and patients begin to arrive some time later. Patients
arrive at the emergency room according to the following probability distribution:

Time Between Arrivals (min.) 5 10 15 20 25 30


Probability 0.06 0.10 0.23 0.29 0.18 0.14

Patient Needs to See Doctor alone Nurse alone Both


Probability 0.50 0.20 0.30

The attention needed by a patient who comes to the emergency room is defined by the following
probability distribution:
If a patient needs to see both the doctor and the nurse, he or she cannot see one before the other that is,
the patient must wait to see both together.
The length of the patient's visit (in minutes) is defined by the following probability distributions:

Doctor Probability Nurse Probability Both Probability


10 0.22 5 .08 15 0.07
15 0.31 10 .24 20 0.16
20 0.25 15 .51 25 0.21
25 0.12 20 .17 30 0.28
30 0.10 35 0.17
40 0.11

Simulate the arrival of 10 patients to the emergency room and compute the probability that a patient must
wait and the average waiting time. Based on this one simulation, does it appear that this system provides
adequate patient care?

Solution:
Step: 1 Develop Probability Distribution ranges for Time Between Arrivals:

Time Between Arrivals Probability Cumulative Probability Range


5 0.06 0.06 0-5

26
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
10 0.16 0.16 6-15
15 0.23 0.39 16-38
20 0.29 0.68 39-67
25 0.18 0.86 68-85
30 0.14 1.00 86-99

Patient needs to see

Patient needs to see Probability Cumulative Probability Range


Doctor only 0.50 0.50 0-49
Nurse only 0.20 0.70 50-69
Both 0.30 1.00 70-99

Length of Visit (Doctor only)

Doctor only Probability Cumulative Probability Range


10 0.22 0.22 0-21
15 0.31 0.53 22-52
20 0.25 0.78 53-77
25 0.12 0.90 78-89
30 0.10 1.00 90-99
Length of Visit (Nurse only)

Nurse only Probability Cumulative Probability Range


5 0.08 0.08 0-7
10 0.24 0.32 8-31
15 0.51 0.83 32-82
20 0.17 1.00 83-99
Length of Visit (Both)

Both (Doctor & Nurse) Probability Cumulative Probability Range


15 0.07 0.07 0-6
20 0.16 0.23 7-22
25 0.21 0.44 23-43
30 0.28 0.72 44-71
35 0.17 0.89 72-88
40 0.11 1.00 89-99

Step: 2 Tabular Simulation

Time Enter
Arrival Waiting Patient Length Time in
Patient Rn1 between Room Rn2 Rn3
Clock Time need to of Visit system
Arrivals Clock
1 - - 0.0 0.0 0.0 65 Nurse 52 15 15
2 37 15 15.0 15.0 0.0 88 Both 60 30 30
3 90 25 25.0 30.0 5.0 30 Doctor 77 20 25

27
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
4 40 20 45.0 50.0 5.0 16 Doctor 44 15 20
5 10 10 55.0 65.0 10.0 27 Doctor 67 20 30
6 53 20 75.0 95.0 20. 99 Both 08 20 40
7 08 10 85.0 135.0 50.0 54 Nurse 15 10 60
8 93 25 110.0 145.0 35.0 79 Both 90 40 75
9 60 20 130.0 220.0 90.0 14 Doctor 35 15 105
10 96 30 160.0 325.0 165.0 50 Nurse 24 10 175.0
380 575

Step: 3 Computation:
380
Average waiting time = =38 Minutes per patient
10

Probability that the patient must wait:


5 5 10 20
P(5) = =0.0131, P(5) = =0.0131, P(10) = =0.0263, P(20) = =0.0526
380 380 380 380
50 35 90 165
P(5) = =0.0131, P(5) = =0.0921, P(5) = =0.2368, P(5) = =0.4342
380 380 380 380
Probability that the patient must
wait=0.0131+0.0131+0.0263+0.0526+0.0131+0.0921+0.2368+0.4342=0.8813
The system doesnt appear to provide adequate care to patient because the waiting time ranges between 0
and 165 minutes. Thus waiting time is longer in some cases which affect patients health condition.

Ex. 8 Page 60 Book


An elevator in a manufacturing plant carries exactly 400 kilograms of materials. Therere three kinds of material,
and these are in boxes, that arrive for a ride on the elevator. These materials and their distributions of time
between arrivals are as follows:

Material Weight (Kilograms) Interarrival Time (Minutes)


A 200 52 (uniform)
B 100 6 (constant)
C 50 P(2)=0.33
P(3)=0.67

It takes 1 minute to go up to the second oor, 2 minutes to unload, and 1 minute to return to the rst oor. The
elevator doesnt leave the first floor unless it has a full load. Simulate 1 hour of opera on of the system. Whats
the average transit time for a box of material A (Time from its arrival until it is unloaded)? Whats the average
waiting time for a box of material B? How many boxes of material C made the trip 1 hour?
Solution:
Material A has a uniform distribu on 52, such that b=(5+2) = 7, a=(5-2) = 3
a+r(b-a)=3+r(7-3) = 3r+4=r7

Interarrival Time Probability Cumulative Probability Range


28
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
3 0.2 0.2 0-19
4 0.2 0.4 20-39
5 0.2 0.6 40-59
6 0.2 0.8 60-79
7 0.2 1.0 80-99
Material A (200kg/box)

Box Rn Interarrival Time Clock Time


1 55 5 5
2 89 7 12
3 17 4 16
4 38 4 20
5 69 6 26
6 71 6 32
7 90 7 39
8 18 3 42
9 94 7 49
10 47 5 54

Material B (100kg/box)

Box Clock Time


1 6
2 12
3 18
4 24
5 30
6 36
7 42
8 48
9 54
10 60

Material C (50kg/box)

Interarrival Time Probability Cumulative Probability Range


2 0.33 0.33 0-32
3 0.67 1.00 33-99

Box Rn Interarrival Time Clock Time


1 39 3 3
29
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
2 73 3 6
3 72 3 9
4 75 3 12
5 02 2 14
6 87 3 17
7 98 3 20
8 10 2 22
9 47 3 25
10 21 2 27

Clock Time Material( A) Arrival Material (B) Arrival Material (C) Arrival
3 1 - 1
6 - 1 2
7 2 - -
9 - - 3
11 - - 4
12 - 2 -
15 - - -
18 - 3 -
19 - - -
21

Ex: 9
The time between arrivals of oil tankers at a loading dock at Prudhoe Bay is given by the following
probability distribution:

Time Between Ship Arrivals (days) 1 2 3 4 5 6 7


Probability 0.5 0.10 0.20 0.30 0.20 0.10 0.5

The time required to fill a tanker with oil and prepare it for sea is given by the following probability
distribution:

Time to Fill and Prepare (days) 3 4 5 6


Probability 0.10 0.20 0.40 0.30

Simulate the movement of tankers to and from the single loading dock for the first 10 arrivals.
Compute the average time between arrivals, average waiting time to load, and average number of
tankers waiting to be loaded.
Solution:
Step:1 Develop Random Number Ranges for Time between Ship Arrivals

Time Between Ship Arrivals (days) Probability Cumulative Probability Range


3 0.5 0.5 0-4
4 0.10 0.15 5-14
30
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
5 0.20 0.35 15-34
6 0.30 0.65 35-64
5 0.20 0.85 65-84
6 0.10 0.95 85-94
7 0.5 1.00 95-99

Develop Random Number Ranges for Time to Fill and prepare (days)

Time to Fill and Prepare (days) Probability Cumulative Probability Range


3 0.10 0.10 0-9
4 0.20 0.30 10-29
5 0.40 0.70 30-69
6 0.30 1.00 70-99

Step: 2 Tabular Simulation:

Time Time to Fill Time Time Time


Tanker Arrival Enter Waiting No. in
Rn1 between Rn2 and Prepare Service Service in
Movement Clock Clock Time Queue
Arrivals (days) begin End system
1 17 3 - - - 95 6 - 3 9 6
2 06 2 6 6 4 62 5 1 6 11 11
3 47 4 7 12 5 31 5 1 12 17 10
4 80 5 8 17 9 36 5 1 17 22 14
5 23 3 9 22 13 63 5 2 22 27 18
6 25 3 10 27 17 76 6 1 27 33 23
7 77 5 11 33 22 01 3 1 33 36 25
8 32 3 12 36 24 66 5 1 36 41 29
9 96 6 13 41 28 03 3 1 41 44 31
10 71 5 14 44 30 55 5 1 44 49 35
39 152 10 202

Step: 3 Computations
39
Average Time between Arrivals = =3.9 Days per Ship
10
152
Average Waiting Time to load = =15.2 Days per Ship.
10
10
Average number of Tankers waiting to be loaded = =1 Tanker per Day
10

Ex: 10 The Saki automobile dealers in the Minneapolis St. Paul area orders the Saki sport compact,
which gets 50 miles per gallon of gasoline, from the manufacturer in Japan. However, the dealer never
knows for sure how many months it will take to receive an order once it is placed. It can take 1, 2, or 3
months, with the following probabilities:

Months to Receive an Order 1 2 3

31
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Probability 0.50 0.30 0.20

The demand per month is given by the following distribution:

Demand per Month (cars) 1 2 3 4


Probability 0.10 0.30 0.40 0.20

The dealer orders when the number of cars on the lot gets down to a certain level. To determine the
appropriate level of cars to use as an indicator of when to order, the dealer needs to know how many cars
will be demanded during the time required to receive an order. Simulate the demand for 10 orders and
compute the average number of cars demanded during the time required to receive an order. At
what level of cars in stock should the dealer place an order?

Solution:
Step: 1 Develop Random Number Ranges for Months to Receive an Order

Months to Receive an Order Probability Cumulative Probability Range


1 0.50 0.50 0-49
2 0.30 0.80 50-79
3 0.20 1.00 80-99

Develop Random Number Ranges for Demand per Month (cars)

Demand per Month (cars) Probability Cumulative Probability Range


1 0.10 0.10 0-9
2 0.30 0.40 10-39
3 0.40 0.80 40-79
4 0.20 1.00 80-99

Step: 2 Tabular Simulation:

Orders Rn1 Months to Receive an Order Rn2 Demand


1 71 2 65 3
2 12 1 18 2
3 48 1 19 2
4 18 1 89 4
5 08 1 83 4
6 94 3 90 4
7 26 1 89 4
8 83 3 08 1
9 63 2 74 3
10 05 1 69 3
30

32
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
30
The Average number of Cars demanded during the time required to receive an order = =3 Cars
10
The dealer should place an order when the demand is 4 cars per month.

Ex: 21 The Western Outfitters Store specializes in denim jeans. The variable cost of the jeans varies
according to several factors, including the cost of the jeans from the distributor, labor costs, handling,
packaging, and so on. Price also is a random variable that varies according to competitors' prices.
Sales volume also varies each month. The probability distributions for volume, price, and variable costs
each month are as follows:

Sales Volume 300 400 500 600 700 800


Probability 0.12 0.18 0.20 0.23 0.17 0.10

Price $ 22 23 24 25 26 27
Probability 0.07 0.16 0.24 0.25 0.18 0.10

Variable Cost $ 8 9 10 11 12
Probability 0.17 0.32 0.29 0.14 0.08

Fixed costs are $9,000 per month for the store.

Simulate 10 months of store sales and compute the probability that the store will at least break even and
the average profit (or loss).

Solution:

Step: 1 Develop Random Number Ranges for Sales Volume

Sales Volume Probability Cumulative Probability Range


300 0.12 0.12 0-11
400 0.18 0.30 12-29
500 0.20 0.50 30-49
600 0.23 0.73 50-72
700 0.17 0.90 73-89
800 0.10 1.00 90-99

Develop Random Number Ranges for Price

Price $ Probability Cumulative Probability Range


22 0.07 0.07 0-6

33
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
23 0.16 0.23 7-22
24 0.24 0.47 23-46
25 0.25 0.72 47-71
26 0.18 0.90 72-89
27 0.10 1.00 90-99

Develop Random Number Ranges for Variable Cost $

Variable Cost $ Probability Cumulative Probability Range


8 0.17 0.17 0-16
9 0.32 0.49 17-48
10 0.29 0.78 49-77
11 0.14 0.92 78-91
12 0.08 1.00 92-99

Step: 2 Tabular Simulation:

Sales Variable
Month Rn1 Rn2 Price $ Rn3 Profits $ Loss $
Volume Cost $
1 71 600 65 25 17 9 $600 -
2 12 400 18 23 06 8 - -3,000
3 48 500 19 23 47 9 - -2,900
4 18 400 89 26 80 11 - -3,000
5 08 300 83 26 23 9 - -3,900
6 94 800 90 27 25 9 5,400 -
7 26 400 89 26 77 10 - -2,600
8 83 700 08 22 32 9 100 -
9 63 600 74 26 96 12 - -600
10 05 300 69 25 71 10 - -4,500
50,000 $ 6,100 $ 20,500

Step: 3 Computations:

Profit = Sales volume x price per unit $ - (variable cost + Fixed Cost)
Month 1 = (600 x $25) =$15,000 (600 x 9 +$9,000) = (5,400+9,000) =14,400
Profit = $ 15,000 $14,400= $ 600
Month 2 = (400 x $ 23) = $9,200 (400 x $8 + $9,000) = $12,200
Loss = $9,200 - $12,200 = - $3,000
Month 3 = (500 x $23) = $11,500 (500 x $9 +$9,000) = $ 13,500
Loss = $11,500 $ 13,500 = $ -2,000
Month 4 = (400 x $ 26) = $10,400 (400 x $ 11 + $9,000) = $ 13,400
Loss = $10,400 $ 13,400 = $ -3,000
Month 5: (300x$26)=$7,800 (300x9+$9,000) = $11,700
Loss = $7,800-$11,700= $ - 3,900
Month 6: (800x$27)=$21,600 (800x$9+$9,000) = $16,200
Profit= $21,600 $16,200= $5,400

34
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Month 7: (400x$26)=$10,400 (400x$10+$9,000) =$13,000
Loss=$10,400 $13,000= $ -2,600
Month 8: (700x$22)=$15,400 (700x$9+$9,000) = $15,300
Profit= $15,400 $15,300=$100
Month 9: (600x$26)=$15,600 (600x$12+$9,000) = $16,200
Loss= $15,600 $16,200 = $ -400
Month 10: (300x$25)=$7,500 (300x$10+$9,000)=$12,000
Loss = $7,500 $12,000= $ -4,500
$6,100
Average profits = = $ 610 Per month
10
$20,500
Average Loss = = $ 2,050 Per month
10

Ex: 21 Randolph College and Salem College are within 20 miles of each other, and the students at each
college frequently date each other. The students at Randolph College are debating how good their dates
are at Salem College. The Randolph students have sampled several hundred of their fellow students and
asked them to rate their dates from 1 to 5 (in which 1 is excellent and 5 is poor) according to physical
attractiveness, intelligence, and personality. Following are the resulting probability distributions for these
three traits for students at Salem College:

Physical Attractiveness 1 2 3 4 5
Probability 0.27 0.35 0.14 0.9 0.15

Intelligence 1 2 3 4 5
Probability 0.10 0.16 0.45 0.17 0.12

Personality 1 2 3 4 5
Probability 0.15 0.30 0.33 0.07 0.15

Simulate 10 dates and compute an average overall rating of the Salem students.

Solution:
Step: 1 Develop Random Number Ranges for Physical Attractiveness

Physical Attractiveness Probability Cumulative Probability Range


1 0.27 0.27 0-26
2 0.35 0.62 27-61
3 0.14 0.76 62-75
4 0.09 0.85 76-84
5 0.15 1.00 85-99

Develop Random Number Ranges for Intelligence

Intelligence Probability Cumulative Probability Range


1 0.10 0.10 0-9
35
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
2 0.16 0.26 10-25
3 0.45 0.71 26-70
4 0.17 0.88 71-87
5 0.12 1.00 88-99
Develop Random Number Ranges for Personality

Personality Probability Cumulative Probability Range


1 0.15 0.15 0-14
2 0.30 0.35 15-34
3 0.33 0.78 35-77
4 0.07 0.85 78-84
5 0.15 1.00 85-99

Step: 2 Tabular Simula on

Physical
Date Rn1 Rn2 Intelligence Rn3 Personality
Attractiveness
2 71 3 65 3 55 3
2 12 1 18 2 89 5
3 48 2 19 2 17 2
4 18 1 89 5 38 3
5 08 1 83 4 69 3
6 94 5 90 5 71 3
7 26 1 89 4 90 5
8 83 4 08 1 18 2
9 63 3 74 4 94 5
10 05 1 69 3 47 2
22 33 33
Step: 3 Computa on
22
Average Physical Attractiveness = =2.2
10
33
Average Intelligence = =3.3
10
33
Average Personality = =3.3
10
The Overall Ra ng of Salem Collage = 2.2+3.3+3.3=8.8

Random Number Generation using Linear congruential Method:

Formula: Xi +1=(axi+c)mod m, I = 0,1,2,3,.


Where: X0 is the seed, a is mul plier, c is increment, m is modulus.

1. , i =1, 2, 3, .
Example: 7.1 Page: 254
36
Prepared by: Youssry Hamdy-CS Diploma
Formula : Xi +1=(axi+c)mod m, I = 0,1,2,3,.

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Use Linear congruen al Method to generate a sequence of 10 random numbers with

X0=27, a=17, c=43, mod 100


Solution:
Xi +1 =(17X 27+43) mod 100= 502 mod 100 = 2
= = 0.02
X2 =(17X 2+43) mod 100= 77 mod 100 = 77
= 0.77
X3 =(17X 77+43) mod 100= 1352 mod 100 = 52
= 0.52
X4 =(17X 52+43) mod 100= 927 mod 100 = 27
= 0.27
X5 =(17X 27+43) mod 100= 502 mod 100 = 2
= 0.02
X6 =(17X 2+43) mod 100= 43.34 mod 100 = 77
= 0.77
X7 =(17X 77+43) mod 100= 1352 mod 100 = 52
= 0.52
X7=(17X 52+43) mod 100= 927 mod 100 = 27
= 0.27
X8=(17X 27+43) mod 100= 502 mod 100 = 2
= 0.02
X9=(17X 2+43) mod 100= 77 mod 100 =77
= 0.77
X10=(17X 77+43) mod 100= 1352 mod 100 =52
= 0.52
The 10 random number {0.02, 0.77, 0.52, 0,27, 0.02, 0.77, 0.52,0.27,0.02,0.77,0.52}

Ex: 4 Page 269


Use Linear congruen al Method to generate a sequence of 3 two-digit random integers

Let X0=27, a=8, c=47, mod= 100


Solution:
Xi +1 =(8x 27+47) mod 100= 263 mod 100 = 63

37
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
63
R1 = =0.63
100
x2 =(8x63+47) = mod 100 = 551 mod 100 = 51
51
R2 = =0.51
100
x3 =(8x51+47) = mod 100 = 455 mod 100 = 55
55
R3 = =0.55
100
x4 =(8x55+47) = mod 100 = 487 mod 100 = 87
87
R4 = =0.87
100
x5 =(8x87+47) = mod 100 = 743 mod 100 = 43
43
R5 = =0.43
100
The Sequence of Random integer numbers are {63, 51, 55, 87, 43}

Ex: 6 Page: 269


Use the multiplicative congruential method to generate a sequence of four-digit random integers. Let X0
=117, a=43, and m=1000.
ax mod 100
X1=[43(117)]=mod 1000 = (5031) mod 1000 = 31
X2=[43(31)]=mod 1000 = (1333) mod 1000 = 333
X3=[43(333)]=mod 1000 = (14319) mod 1000 = 319
X4=[43(319)]=mod 1000 = (13717) mod 1000 = 717
The four-digit random integers are {31, 333, 319, 717}

Tests of autocorrelation:

Ex: 7.8 Page: 266


Given the following probability distribution and intervals, compute the largest M that satisfting the inequality
M=4

Random 3 8 13 18 23 28
Probability 0.23 0.28 0.33 0.27 0.05 0.36

Formula:
Where: i is star ng point, m is step size, M is the largest integer 4 such that i+(M+1)m<30

38
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma

Solution:
R3 +5k+1-0.25

0.25

= (0.23 x 0+02.8x 0.33+0.33x(0.27)+0.27x0.05+0.05x0.36-0.25=-0.1945

Q:1 Define the simulation and draw the steps of simulation modeling and process.
A simulation is the Imitation of the operation of real-world process or system. Simulation involves the generation
of an artificial history of a system, and observation of that artificial history to draw inferences concerning the
operating characteristics of the real system.
Steps of simulation:
1- Problem formulation, 2- Se ng of objec ves and overall project plan, 3- Model conceptualization
4- Data collec on, 5- Model transla on, 6-Tes ng verica on, 7- Testing validation
8- Experimental design, 9- Running and analysis, 10- More runs, 11- Repor ng, 12- Setting implementation

39
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma

Q 2: Dene the model, its importance and the dierent types of models.
Model is a representation of a system for the purpose of studying the system.
The importance of model is that it provides a structural approach to run the system and study its beaver without
running the system itself to determine the problems of the system under investigation that may appear through
implementation and solve them.
Types of models:
1- Mathematical 2- simulation [static, Dynamic, Deterministic, Stochastic, Discrete, Continues]

40
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma

Q 3: When and when not a Simula on is an appropriate tool?

When simulation is a appropriate tool:


1. Simulation enables the study of and experimentation with, internal interaction of a complex system

2. Changes can be simulated, and the effect of these alternation can be observed

3. The knowledge gained in designing a simulation model may help in suggesting improvement in the
system under investigation

4. Simulation can be used to test new designs or policies, so as to prepare for what may happen

5. Simulation can be used to verify the analytical solution

6. Simulation models designed for training allow learning without the cost of on-the-job learning

7. The modern systems (factory, service organization, etc) are so complex that the interactions can be
treated only through simulation.

When simulation is not a appropriate tool:


If the problem can be solved using common sense

1. If the problem can be solved analytically

2. If it is easier to perform direct experiments

3. If the costs exceed the savings

4. If the resources or time are not available

5. If the system behavior is too complex or cant be defined

Q : 4 Whatre the advantages and disadvantages of simula on and areas of application?


Advantages of Simulation:
1- Simulation appealing to a client because it mimics what happens in a real system in the design stage

2- It is possible to develop a simulation model without dubious mathematical assumptions

3- In contrast to optimization models, simulation models are run rather than solved

Disadvantages of Simulation:

1. Model building requires special training

2. Simulation result may be difficult to interpret

3. Simulation modeling can be time consuming and expensive

41
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com


Prepared by: Youssry Hamdy- CS Diploma
Areas of application:
1- manufacturing 2- Semi-conductors manufacturing 3- Construction Engineering
4- Military Applications 5- Logistics, Transportations and distribution
6- Business process simulation 7- Human system

Q: 5 whats the difference between system and model? And mention the components of the system and its
types?
A system is a group of objects that are joined together in some regular interaction or interdependence toward
the accomplishment of some purpose.

Example in production system manufacturing automobiles. The machines, component parts and workers operate
jointly along an assembly line to produce a high-quality vehicle.

It is important to define the boundary between the system and its environment.
Components of the system:

1. An entity is an object of interest in the system.


2. An attribute is a property of an entity
3. An activity represents a time period of specified length
4. The state of a system is defined to be that collection of variables necessary to describe the
system at any time, relative the objective of the study
5. An event is an instantaneous occurrence that may change the state of the system.

System types:
1- Discrete system: is one which is the state variables change only at discrete set points in time.
2- Continues System: is one in which the state variable change continuously over time

Model is a representation of a system for the purpose of studying the system.


The importance of model is that it provides a structural approach to run the system and study its beaver without
running the system itself to determine the problems of the system under investigation that may appear through
implementation and solve them.
Types of models:
1- Mathematical

2- simulation [static, Dynamic, Deterministic, Stochastic, Discrete, Continues]

42
Prepared by: Youssry Hamdy-CS Diploma

PDF created with pdfFactory Pro trial version www.pdffactory.com

You might also like