Professional Documents
Culture Documents
Or 508 Exercises Solution
Or 508 Exercises Solution
Or 508 Exercises Solution
CS Diploma
1
Prepared by: Youssry Hamdy-CS Diploma
0
0.05
1
0.12
2
0.15
3
0.25
4
0.22
5
0.15
6
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
Probability
Minor
0.30
Regular
0.56
Major
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 fiveperson 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
.12
.17
6-17
.15
.32
18-32
.25
.57
33-57
.22
.79
58-79
.15
.94
80-94
.06
1.00
95-99
1.00
Emergency
Type
Minor
Probability
Cumulative
Probability
.30
.30
1-30
2
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
65
08
05
5
89
06
62
17
77
Regular
18
Minor
12
Minor
17
Minor
89
Major
18
Minor
83
Regular
90
Major
2
48
71
18
Minor
08
Minor
26
Minor
47
Regular
94
Major
72
Regular
47
Regular
68
Regular
60
Regular
88
Major
36
Regular
43
Regular
28
Minor
31
Regular
3
Prepared by: Youssry Hamdy-CS Diploma
10
14
14
10
10
68
06
Minor
39
Regular
71
Regular
22
Minor
76
Regular
11
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:
0
100
200
300
400
500
Demand (yd.)
0.3
0.12
0.20
0.35
0.20
0.10
Probability
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
0
100
200
300
400
500
Probability
0.3
0.12
0.20
0.35
0.20
0.10
Cumulative Probability
0.3
0.15
0.35
0.70
0.90
1.00
Range
0-2
3-14
15-34
35-69
70-89
90-99
4
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
1
2
3
4
5
Rn1
0.59
0.43
0.11
0.82
0.35
Production
300
300
100
400
300
1400
Step: 3 Computations:
Average weekly capacity production:
Rn2
0.18
0.86
0.22
0.62
0.70
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
0
1
2
3
4
Total
Frequency of Demand
20
40
20
10
10
100
Cumulative Probability
0.2
0.6
0.8
0.9
1.0
1.0
Ranges of Random
number
0.0-19
20-59
60-79
80-89
90-99
73
72
75
37
02
87
98
10
47
93
21
95
97
69
2
2
2
1
0
3
4
0
1
4
0
4
4
2
31
8,600
8,600
8,600
4,300
0
12,900
17,200
0
4,300
17,200
0
17,200
17,200
8,600
$ 133,300
Step: 1 Develop Random number ranges for the probability distribution for arrival intervals:
Arrival interval (Days), x
1
2
3
4
Probability
20
40
30
10
Cumulative Probability
20
60
90
100
Range
0-19
20-59
60-89
90-99
Develop Random number ranges for the probability distribution of service times:
Service Time (Days), y
5
1
2
Probability
20
50
30
Cumulative Probability
20
70
100
6
Prepared by: Youssry Hamdy-CS Diploma
Range
0-19
20-69
70-99
Rn1
Enter
Facility clock
0.0
3.0
4.0
6.0
8.0
10.0
12.0
14.0
14.5
16.0
Waiting
time
0.0
0.0
0.0
0.0
1.0
2.0
3.0
4.0
2.5
0.0
12.5
Rn2
65
18
17
89
83
90
89
08
47
06
Service
Time, y
1.0
0.5
0.5
2.0
2.0
2.0
2.0
5.0
1.0
0.5
Departure
Clock
1.0
3.5
4.5
8.0
10.0
12.0
14.0
14.5
15.5
16.5
Time in
system
1.0
0.5
0.5
2.0
3.0
4.0
5.0
4.5
3.5
0.5
24.5
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
0
1
2
3
4
5
Total
Frequency
10
20
40
60
40
30
200
Probability
5
10
20
30
20
15
100.0
Step: 1 Develop Random number ranges for the probability distribution of tires demand:
Demand for Tires
0
1
2
3
4
Probability
5
10
20
30
20
Cumulative Probability
5
15
35
65
85
7
Prepared by: Youssry Hamdy-CS Diploma
Range
0-4
5-14
15-34
35-64
65-84
100
85-99
Days
1
2
3
4
5
6
7
8
9
10
Rn
52
37
82
69
98
96
33
50
88
90
Demand
3
3
4
4
5
5
2
3
5
5
39
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
Increase
Same
Decrease
Probability
0.45
0.3
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
12.50%
25%
37.50%
Increase
0.4
0.17
0.12
Decrease
0.12
0.15
0.18
8
Prepared by: Youssry Hamdy-CS Diploma
0.1
0.08
0.07
0.04
0.02
1
The price of the stock is currently 62.
0.21
0.14
0.1
0.05
0.05
1
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
Increase
Same
Decrease
Probability
45
30
25
100.0
Cumulative Probability
45
75
100
Range
0-44
45-74
75-99
Develop Random number ranges for the probability distribution for the percentage of increases and
decreases in stock price:
Increase:
Stock Price
Change
12.50%
25%
37.50%
50%
62.50%
75%
87.50%
Probability
Cumulative Probability
Range
40
17
12
10
8
7
6
40
57
69
79
87
94
100
0-39
40-56
57-68
69-78
79-86
87-93
94-99
Probability
Cumulative Probability
Range
12
15
18
21
12
27
45
66
0-11
12-26
27-44
45-65
Decrease:
Stock Price
Change
12.50%
25%
37.50%
50%
9
Prepared by: Youssry Hamdy-CS Diploma
80
90
100
66-79
80-89
90-99
Rn1
1
2
3
4
5
6
7
8
9
10
17
95
21
78
58
24
33
45
77
48
Stock Price
Movement
Increase
Decrease
Increase
Decrease
Same
Increase
Increase
Same
Decrease
Same
Rn2
37
79
49
12
38
48
13
93
55
96
Stock Price
Change
12.5%
62.5%
25%
25%
0
25%
12.5%
0
50%
0
Price
=7.75+62= 70
23.25
77.5
46.5
62
77.5
70
62
31
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
10
Prepared by: Youssry Hamdy-CS Diploma
Range
0
1
2
3
4
5
9
17
27
20
15
12
9
26
53
73
88
100
0-8
9-25
26-52
53-72
73-87
88-99
Service Time
Probability
Cumulative Probability
Range
1
2
3
4
20
40
28
12
20
60
88
100
0-19
20-59
60-87
88-99
Customer
Rn for
Arrival
Interarrival
Time
Clock
Time
1
2
3
4
5
6
7
8
9
10
30
46
39
86
63
83
07
37
69
78
2
2
2
4
3
4
0
2
3
4
2
4
6
10
13
17
17
19
22
26
Rn for
Service
Time
27
26
99
72
12
17
78
91
82
62
Service
Time
No. in
Queue
2
2
4
3
1
1
3
4
3
3
1
0
0
0
0
0
1
1
0
0
Time
Service
Begin
4
6
10
13
17
18
22
26
Time
Service
Ends
6
10s
13
14
18
21
25
29
Go into the
Bank?
Yes
No
Rn
0.6953
0.0082
0.1514
0.4013
0.3125
0.8166
0.9439
0.5448
12
Prepared by: Youssry Hamdy-CS Diploma
87
90
Rn
0.7005
0.3204
0.9868
0.1804
0.4346
0.9605
0.5647
0.7334
0.0216
0.3218
Demand
17,366
12,900
20,686
10,888
14,259
22,904
15,732
17,804
5,902
12,918
Tabular Simulation
Trials
1
2
3
4
5
6
7
8
9
10
Total
Average
Units Sold
17,366
12,900
20,686
10,888
14,259
22,904
15,732
17,804
5,902
12,918
151,359
15,359
Profits $
1,023,570
461,828
1,288,906
169,807
648,911
1,526,769
814,686
1,165,501
-350,131
385,585
7,137,432
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
Convert Maintenance =
Step: 1 Develop probability distribution ranges: (Car life cost)
Trials
1
2
3
4
5
6
7
8
9
10
Rn
0.405
0.173
0.011
0.529
0.004
0.514
0.691
0.654
0.709
0.412
Rn
0.726
0.009
0.369
0.571
0.828
0.237
0.605
0.275
0.949
0.865
14
Prepared by: Youssry Hamdy-CS Diploma
Rn
0.930
0.014
0.995
0.796
0.588
0.758
0.040
0.607
0.286
0.351
Trials
Mile driven/Year
Maintenance
cost/mile
1
2
3
4
5
6
7
8
9
10
Average
2.43
1.038
0.066
3.174
0.024
3.084
4.146
3.924
4.254
2.472
0.672
0.008
0.342
0.529
0.767
0.219
0.560
0.255
0.879
0.672
4.903
0.0891
0.033
0.117
0.280
0.103
0.197
0.017
0.150
0.099
0.137
0.033
2.272
0.0313
24.612
0.4475
Next Sunday
Daily News
15
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
Tribune
Daily News
Probability
0.65
0.35.
Cumulative Probability
0.65
1.00
1.00
Range
0-64
65-99
Cumulative Probability
0.45
1.00
1.00
Range
0-44
45-99
Probability
0.45
0.55
Rn
1
2
3
4
5
6
7
8
9
10
66
09
39
60
66
20
19
71
86
82
Total
Newspaper
Daily News
1
0
0
0
1
0
0
1
1
1
Tribune
0
1
1
1
0
1
1
0
0
0
16
Prepared by: Youssry Hamdy-CS Diploma
1100
0.13
1200
0.25
1300
0.13
5
0.6
1400
0.0
1500
0.12
10
0.3
1600
0.02
1700
0.06
15
1.0
Probability
0.6
0.3
Cumulative probability
0.6
0.9
17
Prepared by: Youssry Hamdy-CS Diploma
Range
0-9
10-22
23-47
48-60
61-69
70-81
82-85
84-89
90-94
95-99
Range
0-5
6-8
1800
0.05
1900
0.05
0.1
1.0
9-00
Bearing 2
Bearing3
Delay
Life
Delay
Delay
Trials Rd1
Rd3
Rd4
Rd5
Life Hours
Rd6
Time
Hours
Time
Time
1
67
10
71
1500
8
10
18
1100
6
10
2
55
5
21
1100
3
5
17
1100
2
5
3
98
5
79
1600
3
5
65
1400
2
5
4
76
10
88
1700
1
5
03
1000
9
15
5
53
5
93
1800
0
5
54
1300
8
10
6
69
10
77
1500
6
10
17
1100
3
5
7
80
5
08
1000
9
15
19
1100
6
10
8
93
10
21
1100
8
10
09
1000
7
10
9
35
5
13
1100
3
5
61
1400
1
5
10
02
5
03
1000
2
5
84
1700
0
15
11
99
15
14
1100
1
5
11
1100
5
5
12
65
5
05
1000
0
5
25
1200
2
5
13
53
19
29
1200
2
5
86
1700
8
10
14
87
5
07
1000
4
5
65
1400
3
5
15
90
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:
Trails
1
2
3
4
5
6
7
8
9
10
11
12
Bearing1
Life(hours)
1700
1000
1500
1300
1200
1000
1500
1300
1800
1300
1400
1500
Bearing2 Life
(hours)
1100
1800
1700
1100
1100
1200
1700
1700
1200
1300
1300
1300
Bearing3Life
First Failure
(hours)
(hours)
1000
1000
1200
1000
1300
1300
1800
1100
1300
1100
1000
1100
1200
1200
1000
1000
1100
1100
1100
1100
1900
1300
1400
1300
18
Prepared by: Youssry Hamdy-CS Diploma
Delay (minute)
10
5
5
5
5
10
5
10
15
5
10
5
Good
0.03
0.05
0.15
0.20
0.35
0.15
0.07
40
50
60
70
80
90
100
poor
0.44
0.22
0.16
0.12
0.06
0.00
0.00
Probability
0.35
0.45
0.20
Solution:
Step: 1 Develop probability distribu on range for newspapers demand .
Type of News
Good
Probability
0.35
Cumulative Distribution
0.35
19
Prepared by: Youssry Hamdy-CS Diploma
Range
0-34
Good
0.03
0.08
0.23
0.43
0.78
0.93
1.0
Cumulative Distribution
Fair
0.10
0.28
0.68
0.88
0.96
0.1
0.1
Poor
0.44
0.66
0.82
0.94
0.1
0.1
0.1
35-74
75-99
Good
0-2
3-7
8-22
23-42
43-77
78-92
93-99
Ranges
Fair
0-9
10-27
28-67
68-87
88-95
96-97
98-99
Poor
0-43
44-65
66-81
82-93
94-95
96-97
98-99
Rn1 for
newspaper
type
58
17
21
45
43
36
27
73
86
19
Type of
newspaper
Rn2 for
Demand
Demand
Fair
Good
Good
Fair
Fair
Fair
Good
Fair
Poor
Good
Total
93
63
31
19
75
84
37
23
02
53
80
80
70
50
70
80
70
50
40
70
Revenue
from sales
$35.00
35.00
35.00
25.00
35.00
35.00
35.00
30.00
20.00
20.00
$ 300.00
Lost profit
from excess
Demand
$1.70
1.7
1.70
3.40
$ 17.00
Salvage
from sale of
scrap
1.00
0.50
1.50
1.50
$10.00
Daily
profit
$ 10.2
10.20
11.90
2.90
10.20
11.90
8.50
7.40
-1.60
-1.60
$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:
1
2
3
4
Time Between Arrivals (min.)
0.15
0.30
0.40
0.15
Probability
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
Solution:
Step:1 Develop probability distribution range for Time between Arrivals .
Time Between
Arrivals (min.)
Probability
Cumulative Distribution
Range
1
2
3
4
0.15
0.30
0.40
0.15
0.15
0.45
0.85
1.00
0-14
15-44
45-84
85-99
Rn
71
18
12
17
89
18
83
90
18
08
24
=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
Probability
0
0.10
1
0.10
2
0.20
3
0.25
4
0.30
5
0.5
Probability
0.10
0.10
0.20
0.25
Cumulative Distribution
0.10
0.20
0.40
0.65
21
Prepared by: Youssry Hamdy-CS Diploma
Range
0-9
10-19
20-39
40-64
0.30
0.5
0.95
1.00
65-94
95-99
Rn1
Machine 1
Breakdown
Rn2
Machine 2
Breakdown
Rn3
Machine 3
Breakdown
Rn4
Machine 4
Breakdown
Rn5
Machine
Breakdown 5
1
2
3
4
5
6
7
8
9
10
65
48
08
05
89
06
62
17
77
68
4
3
0
0
4
0
3
1
4
4
71
18
12
17
89
18
83
90
18
08
4
1
1
1
4
1
4
4
1
0
26
47
94
72
47
68
60
88
36
43
2
3
4
4
3
4
3
4
2
3
28
31
06
39
71
22
76
80
95
11
2
2
0
2
4
2
4
4
5
1
77
35
0
90
69
55
10
72
06
40
4
2
0
4
4
3
1
4
0
3
23
21
32
26
25
23 + 21 + 32 + 26 + 25
= 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:
1
0.30
2
0.50
3
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
Probability
0
1
2
3
4
0.20 0.30 0.20 0.15 0.10
5
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 .
Probability
0.30
0.50
Cumulative Distribution
0.30
0.80
22
Prepared by: Youssry Hamdy-CS Diploma
Range
0-29
30-79
0.20
1.00
80-99
1
2
3
4
5
6
7
8
9
10
Rn1
Machine 1
Repair Time
Rn2
Machine 2
Repair Time
Rn3
Machine 3
Repair Time
Rn4
Machine 4
Repair Time
Rn5
Machine 5
Repair Time
2
2
3
2
1
3
3
3
3
1
77
35
18
79
75
92
48
13
56
85
2
2
1
2
2
3
2
1
2
3
30
71
18
01
85
83
67
53
88
04
2
2
1
1
3
3
2
2
3
1
62
27
73
84
81
26
38
0
64
96
2
1
2
3
3
1
2
1
2
3
16
52
98
79
82
34
51
65
16
09
1
2
3
2
3
2
2
2
1
1
62
54
82
48
10
82
82
81
95
05
23
20
20
20
19
23 + 20 + 20 + 20 + 19
= 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:
Average weekly Repair Time =
Weeks
Rn1
Machine 1
Repair Time
Rn2
Machine 2
Repair Time
Rn3
Machine 3
Repair Time
Rn4
Machine 4
Repair Time
Rn5
Machine 5
Repair Time
1
2
3
4
5
6
7
8
9
10
65
48
08
05
89
06
62
17
77
68
2
2
1
1
3
1
2
1
2
2
71
18
12
17
89
18
83
90
18
08
2
1
1
1
3
1
3
3
1
1
26
47
94
72
47
68
60
88
36
43
1
2
3
2
2
2
2
3
2
2
28
31
06
39
71
22
76
80
95
11
1
2
1
2
2
1
2
3
3
1
77
35
0
90
69
55
10
72
06
40
2
2
1
3
2
2
1
2
1
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
Probability
Cumulative Distribution
23
Prepared by: Youssry Hamdy-CS Diploma
Range
Weeks
1
2
3
4
5
6
7
8
9
10
Rn1
62
54
82
48
10
82
82
81
95
05
22
0.30
0.20
0.20
0.15
0.10
0.5
0.30
0.50
0.70
0.85
0.95
1.00
0-29
30-49
50-69
70-83
84-94
95-99
Machine 1
Breakdown
Rn2
Machine 2
Breakdown
Rn3
Machine 3
Breakdown
Rn4
Machine 4
Breakdown
Rn5
Machine
Breakdown 5
2
2
3
1
0
3
3
3
5
0
77
35
18
79
75
92
48
13
56
85
3
1
0
3
3
4
1
0
2
4
30
71
18
01
85
83
67
53
88
04
1
3
0
0
4
4
2
0
4
0
62
27
73
84
81
26
38
0
64
96
2
0
2
4
4
0
1
0
2
5
16
52
98
79
82
34
51
65
16
09
0
2
5
3
3
1
2
2
0
0
21
18
20
18
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:
0
0.4
1
0.8
2
0.28
3
0.40
4
0.16
5
0.2
6
0.2
The time required to receive an order once it is placed has the following probability distribution:
1
0.60
2
0.30
3
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:
Probability
0
0.4
1
0.8
2
0.28
3
0.40
4
0.16
5
0.2
6
0.2
Develop probability distribution for Time receives order:
Cumulative Distribution
0.8
0.12
0.40
0.80
0.96
0.98
1.00
Probability
0.60
0.30
0.10
Range
0-7
8-11
12-39
40-79
80-95
96-97
98-99
Cumulative Distribution
0.60
0.90
1.00
Range
0-59
60-89
90-99
Months
Rn1 for
Demand
1
2
3
4
39
65
76
45
Demand
Rn2 for
Time to
receive an
order
Time to
receive
and order
Sales
stock
2
3
3
3
19
90
69
64
1
3
2
2
3
2
0
3
2
0
0
2
40x2=$80
1x100x400=$40,000
3x100x400=$120,000
40x2=$80
25
Prepared by: Youssry Hamdy-CS Diploma
5
6
7
8
9
10
96
73
71
00
70
99
5
3
3
0
3
6
31
61
20
31
99
00
85
2
1
1
3
1
2
18
2
0
3
0
0
3
0
3
0
0
3
0
3x100x400=$120,000
40x3=$120
0
0
3x100x400=$120,000
2x100x400=$80,000
$ 480,280
$480,280
= $ 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.)
Probability
5
0.06
10
0.10
Doctor alone
0.50
15
0.23
20
0.29
25
0.18
Nurse alone
0.20
30
0.14
Both
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
10
15
20
25
30
Probability
0.22
0.31
0.25
0.12
0.10
Nurse
5
10
15
20
Probability
.08
.24
.51
.17
Both
15
20
25
30
35
40
Probability
0.07
0.16
0.21
0.28
0.17
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
5
Probability
0.06
Cumulative Probability
0.06
26
Prepared by: Youssry Hamdy-CS Diploma
Range
0-5
10
15
20
25
30
0.16
0.23
0.29
0.18
0.14
0.16
0.39
0.68
0.86
1.00
6-15
16-38
39-67
68-85
86-99
Cumulative Probability
0.50
0.70
1.00
Range
0-49
50-69
70-99
Doctor only
10
15
20
25
30
Probability
0.22
0.31
0.25
0.12
0.10
Cumulative Probability
0.22
0.53
0.78
0.90
1.00
Range
0-21
22-52
53-77
78-89
90-99
Nurse only
5
10
15
20
Probability
0.08
0.24
0.51
0.17
Cumulative Probability
0.08
0.32
0.83
1.00
Range
0-7
8-31
32-82
83-99
Probability
0.07
0.16
0.21
0.28
0.17
0.11
Cumulative Probability
0.07
0.23
0.44
0.72
0.89
1.00
Range
0-6
7-22
23-43
44-71
72-88
89-99
Patient
Rn1
1
2
3
37
90
Time
between
Arrivals
15
25
Arrival
Clock
0.0
15.0
25.0
Enter
Room
Clock
0.0
15.0
30.0
Waiting
Rn2
Time
0.0
0.0
5.0
65
88
30
27
Prepared by: Youssry Hamdy-CS Diploma
Patient
need to
Rn3
Nurse
Both
Doctor
52
60
77
Length Time in
of Visit system
15
30
20
15
30
25
4
5
6
7
8
9
10
40
10
53
08
93
60
96
20
10
20
10
25
20
30
45.0
55.0
75.0
85.0
110.0
130.0
160.0
50.0
65.0
95.0
135.0
145.0
220.0
325.0
5.0
10.0
20.
50.0
35.0
90.0
165.0
380
16
27
99
54
79
14
50
Doctor
Doctor
Both
Nurse
Both
Doctor
Nurse
44
67
08
15
90
35
24
15
20
20
10
40
15
10
20
30
40
60
75
105
175.0
575
Step: 3 Computation:
Average waiting time =
380
=38 Minutes per patient
10
Material
A
B
C
Weight (Kilograms)
200
100
50
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
28
Prepared by: Youssry Hamdy-CS Diploma
Range
3
4
5
6
7
0.2
0.2
0.2
0.2
0.2
0.2
0.4
0.6
0.8
1.0
0-19
20-39
40-59
60-79
80-99
Material A (200kg/box)
Box
1
2
3
4
5
6
7
8
9
10
Rn
55
89
17
38
69
71
90
18
94
47
Interarrival Time
5
7
4
4
6
6
7
3
7
5
Clock Time
5
12
16
20
26
32
39
42
49
54
Material B (100kg/box)
Box
1
2
3
4
5
6
7
8
9
10
Clock Time
6
12
18
24
30
36
42
48
54
60
Material C (50kg/box)
Interarrival Time
2
3
Box
1
Probability
0.33
0.67
Rn
39
Cumulative Probability
0.33
1.00
Interarrival Time
3
29
Prepared by: Youssry Hamdy-CS Diploma
Range
0-32
33-99
Clock Time
3
2
3
4
5
6
7
8
9
10
Clock Time
3
6
7
9
11
12
15
18
19
21
73
72
75
02
87
98
10
47
21
3
3
3
2
3
3
2
3
2
Material( A) Arrival
1
2
-
6
9
12
14
17
20
22
25
27
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)
Probability
1
0.5
2
0.10
3
0.20
4
0.30
5
0.20
6
0.10
7
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)
Probability
3
0.10
4
0.20
5
0.40
6
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)
3
4
Probability
0.5
0.10
Cumulative Probability
0.5
0.15
30
Prepared by: Youssry Hamdy-CS Diploma
Range
0-4
5-14
5
6
5
6
7
0.20
0.30
0.20
0.10
0.5
0.35
0.65
0.85
0.95
1.00
15-34
35-64
65-84
85-94
95-99
Cumulative Probability
0.10
0.30
0.70
1.00
Range
0-9
10-29
30-69
70-99
Develop Random Number Ranges for Time to Fill and prepare (days)
Time to Fill and Prepare (days)
3
4
5
6
Probability
0.10
0.20
0.40
0.30
1
2
3
4
5
6
7
8
9
10
Rn1
17
06
47
80
23
25
77
32
96
71
Time
between
Arrivals
3
2
4
5
3
3
5
3
6
5
39
Arrival
Clock
Enter
Clock
Waiting
Time
6
7
8
9
10
11
12
13
14
6
12
17
22
27
33
36
41
44
4
5
9
13
17
22
24
28
30
152
Rn2
95
62
31
36
63
76
01
66
03
55
Time to Fill
and Prepare
(days)
6
5
5
5
5
6
3
5
3
5
No. in
Queue
1
1
1
2
1
1
1
1
1
10
Time
Service
begin
Time
Service
End
Time
in
system
3
6
12
17
22
27
33
36
41
44
9
11
17
22
27
33
36
41
44
49
6
11
10
14
18
23
25
29
31
35
202
Step: 3 Computations
39
=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
Average Time between Arrivals =
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
31
Prepared by: Youssry Hamdy-CS Diploma
0.50
Probability
0.30
0.20
2
0.30
3
0.40
4
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
1
2
3
Probability
0.50
0.30
0.20
Cumulative Probability
0.50
0.80
1.00
Range
0-49
50-79
80-99
Probability
0.10
0.30
0.40
0.20
Cumulative Probability
0.10
0.40
0.80
1.00
Range
0-9
10-39
40-79
80-99
Rn1
71
12
48
18
08
94
26
83
63
05
Rn2
65
18
19
89
83
90
89
08
74
69
32
Prepared by: Youssry Hamdy-CS Diploma
Demand
3
2
2
4
4
4
4
1
3
3
30
The Average number of Cars demanded during the time required to receive an order =
30
=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
Probability
Price $
Probability
300
0.12
400
0.18
22
0.07
23
0.16
8
0.17
Variable Cost $
Probability
500
0.20
600
0.23
24
0.24
25
0.25
9
0.32
10
0.29
700
0.17
26
0.18
11
0.14
800
0.10
27
0.10
12
0.08
Solution:
Step: 1 Develop Random Number Ranges for Sales Volume
Sales Volume
300
400
500
600
700
800
Probability
0.12
0.18
0.20
0.23
0.17
0.10
Cumulative Probability
0.12
0.30
0.50
0.73
0.90
1.00
Range
0-11
12-29
30-49
50-72
73-89
90-99
Cumulative Probability
0.07
Range
0-6
Probability
0.07
33
Prepared by: Youssry Hamdy-CS Diploma
23
24
25
26
27
0.16
0.24
0.25
0.18
0.10
0.23
0.47
0.72
0.90
1.00
7-22
23-46
47-71
72-89
90-99
Cumulative Probability
0.17
0.49
0.78
0.92
1.00
Range
0-16
17-48
49-77
78-91
92-99
Probability
0.17
0.32
0.29
0.14
0.08
71
12
48
18
08
94
26
83
63
05
Sales
Volume
600
400
500
400
300
800
400
700
600
300
50,000
Rn2
65
18
19
89
83
90
89
08
74
69
Price $ Rn3
25
23
23
26
26
27
26
22
26
25
17
06
47
80
23
25
77
32
96
71
Variable
Cost $
9
8
9
11
9
9
10
9
12
10
Profits $
Loss $
$600
5,400
100
$ 6,100
-3,000
-2,900
-3,000
-3,900
-2,600
-600
-4,500
$ 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
1
0.27
2
0.35
3
0.14
4
0.9
5
0.15
Intelligence
Probability
1
0.10
2
0.16
3
0.45
4
0.17
5
0.12
Personality
Probability
1
0.15
2
0.30
3
0.33
4
0.07
5
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
1
2
3
4
5
Probability
0.27
0.35
0.14
0.09
0.15
Cumulative Probability
0.27
0.62
0.76
0.85
1.00
Range
0-26
27-61
62-75
76-84
85-99
Cumulative Probability
0.10
Range
0-9
Intelligence
1
Probability
0.10
35
Prepared by: Youssry Hamdy-CS Diploma
2
3
4
5
0.16
0.45
0.17
0.12
0.26
0.71
0.88
1.00
10-25
26-70
71-87
88-99
Cumulative Probability
0.15
0.35
0.78
0.85
1.00
Range
0-14
15-34
35-77
78-84
85-99
Personality
1
2
3
4
5
Probability
0.15
0.30
0.33
0.07
0.15
Date
Rn1
2
2
3
4
5
6
7
8
9
10
71
12
48
18
08
94
26
83
63
05
Physical
Attractiveness
3
1
2
1
1
5
1
4
3
1
22
Rn2
Intelligence
Rn3
Personality
65
18
19
89
83
90
89
08
74
69
3
2
2
5
4
5
4
1
4
3
33
55
89
17
38
69
71
90
18
94
47
3
5
2
3
3
3
5
2
5
2
33
Step: 3 Computa on
Average Physical Attractiveness =
22
=2.2
10
33
=3.3
10
33
Average Personality =
=3.3
10
Average Intelligence =
, i =1, 2, 3, .
Example: 7.1 Page: 254
36
Prepared by: Youssry Hamdy-CS Diploma
= 0.02
R1 =
63
=0.63
100
R2 =
51
=0.51
100
R3 =
55
=0.55
100
R4 =
87
=0.87
100
R5 =
43
=0.43
100
The Sequence of Random integer numbers are {63, 51, 55, 87, 43}
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
Probability
3
0.23
8
0.28
13
0.33
18
0.27
23
0.05
28
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
Solution:
R3
+5k+1-0.25
0.25
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
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
1.
2.
3.
4.
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