Bisf 2308 Apr 2024
Bisf 2308 Apr 2024
Use the chi-square test for uniformity to determine whether the random numbers are uniform in
the interval [0,1] [3mks]
(c) For a discrete event simulation;
i. Illustrate the steps involved in a simulation study using a flow chart diagram. [5mks]
ii. Distinguish between the terms "verification" and "validation" in the context of a
simulation study. [2mks]
(d) Develop a generator for a triangular distribution with range (1,10) and mode at 𝑥 = 4.Generate
10 values of the random variate, compute the sample mean, and compare it to the true mean of
the distribution. [3mks]
1
(e) Lead times have been found to be exponentially distributed with mean 3.7 days. Given the
following sequence of uniform random numbers, 0.465, 0.845, 0.198, 0.618, 0.276, and 0.046
, generate 5 random lead times from the exponential distribution. [3mks]
e if x 0
2x
(a) For a random variable 𝑋 with the pdf, f ( x) = −2 x ,
e if x 0
ii. Transform the random numbers 0.129, 0.974, 0.477, 0.852, 0.508, 0.021 , using the
developed random variate generator in (i) above. [2mks
2
including selling price, unit variable cost, and demand, are depicted in the probability
distribution below:
Selling Prob Unit Prob Sales Prob
Price Variable Units
Cost demand
Sh 10 0.3 Sh 6 0.1 1000 0.2
Sh 15 0.3 Sh 8 0.3 3000 0.2
Sh 10 0.2 Sh 10 0.3 2000 0.2
Sh 70 0.2 Sh 9 0.3 6000 0.4
Using the following uniform random numbers on the interval [0,100]
Trial 1 2 3 4 5 6 7 8 9 10
Selling Price Random
Numbers 81 65 49 4 53 77 2 74 7 29
Unit Variable
Random Numbers 1 53 36 29 11 9 70 9 6 11
Units demand
Random Numbers 99 10 36 23 25 78 52 39 5 66
Carry out 10 Monte Carlo simulations, using random numbers provided for each uncertain
factor, and find the average profit. [6mks]
ii. Perform the Kolmogorov Smirnov (K-S) test to the first 8 random numbers generated
in (i) above for uniformity. [3mks]
(b) A firm has a single channel service station with the following arrival and service time
probability distributions:
Inter-arrival Time Service Time
Minutes Probability Minutes Probability
10 0.10 5 0.08
15 0.25 10 0.14
20 0.30 15 0.18
25 0.25 20 0.24
30 0.10 25 0.22
30 0.14
3
The customer’s arrival at the service station is a random phenomenon and the time between the
arrivals varies from 10 to 30 minutes. The service time varies from 5 minutes to 30 minutes. The
queuing process begins at 10 A.M. and proceeds for nearly 8 hours. An arrival immediately,
goes to the service facility if it is free. Otherwise it waits in a queue. The queue discipline is
first-come first-served. Answer the questions using Monte Carlo simulation technique.
i. Prepare a simulation table that shows system states arrival time, service start time, waiting
time, service time, exit time and time in system for fifteen random arrivals. Use the two
sequences of uniform random numbers, in the interval [0,1], to simulate inter-arrival times
and service times respectively. [5mks]
15 Arrivals 1 2 3 4 5 6 7 8
R for Inter-arrival time 0.20 0.73 0.30 0.99 0.66 0.83 0.32 0.75
R for Service time 0.26 0.43 0.98 0.87 0.58 0.90 0.84 0.60
15 Arrivals 9 10 11 12 13 14 15
R for Inter-arrival time 0.04 0.15 0.29 0.62 0.31 0.68 0.94
R for Service time 0.08 0.50 0.37 0.42 0.28 0.84 0.65
ii. Determine the Average waiting time and Average service time. [2mks]
iii. If the attendant’s wages are KES 10 per hour and the customer’s waiting time costs KES
15 per hour, then would it be an economical proposition to engage a second attendant?
[2mks]
4
Kolmogorov-Smirnov Test
Critical Values
SAMPLE LEVEL OF SIGNIFICANCE FOR D = MAXIMUM [ F0(X) - Sn(X) ]
SIZE (N)
.20 .15 .10 .05 .01
5
TABLE C: Chi-Square distributions
cum probability 0.025 0.80 0.90 0.95 0.975 0.99 0.995 0.999 0.9995
right tail 0.975 0.2 0.1 0.05 0.025 0.01 0.005 0.001 0.0005
df
1 0.00098 1.64 2.71 3.84 5.02 6.63 7.88 10.83 12.12
2 0.051 3.22 4.61 5.99 7.38 9.21 10.60 13.82 15.20
3 0.216 4.64 6.25 7.81 9.35 11.34 12.84 16.27 17.73
4 0.48 5.99 7.78 9.49 11.14 13.28 14.86 18.47 20.00
5 0.83 7.29 9.24 11.07 12.83 15.09 16.75 20.51 22.11
6 1.24 8.56 10.64 12.59 14.45 16.81 18.55 22.46 24.10
7 1.69 9.80 12.02 14.07 16.01 18.48 20.28 24.32 26.02
8 2.18 11.03 13.36 15.51 17.53 20.09 21.95 26.12 27.87
9 2.70 12.24 14.68 16.92 19.02 21.67 23.59 27.88 29.67
10 3.25 13.44 15.99 18.31 20.48 23.21 25.19 29.59 31.42
11 3.82 14.63 17.28 19.68 21.92 24.73 26.76 31.26 33.14
12 4.40 15.81 18.55 21.03 23.34 26.22 28.30 32.91 34.82
13 5.01 16.98 19.81 22.36 24.74 27.69 29.82 34.53 36.48
14 5.63 18.15 21.06 23.68 26.12 29.14 31.32 36.12 38.11
15 6.26 19.31 22.31 25.00 27.49 30.58 32.80 37.70 39.72
16 6.91 20.47 23.54 26.30 28.85 32.00 34.27 39.25 41.31
17 7.56 21.61 24.77 27.59 30.19 33.41 35.72 40.79 42.88
18 8.23 22.76 25.99 28.87 31.53 34.81 37.16 42.31 44.43
19 8.91 23.90 27.20 30.14 32.85 36.19 38.58 43.82 45.97
20 9.59 25.04 28.41 31.41 34.17 37.57 40.00 45.31 47.50
21 10.28 26.17 29.62 32.67 35.48 38.93 41.40 46.80 49.01
22 10.98 27.30 30.81 33.92 36.78 40.29 42.80 48.27 50.51
23 11.69 28.43 32.01 35.17 38.08 41.64 44.18 49.73 52.00
24 12.40 29.55 33.20 36.42 39.36 42.98 45.56 51.18 53.48
25 13.12 30.68 34.38 37.65 40.65 44.31 46.93 52.62 54.95
30 16.79 36.25 40.26 43.77 46.98 50.89 53.67 59.70 62.16
40 24.43 47.27 51.81 55.76 59.34 63.69 66.77 73.40 76.10
50 32.36 58.16 63.17 67.50 71.42 76.15 79.49 86.66 89.56
60 40.48 68.97 74.40 79.08 83.30 88.38 91.95 99.61 102.7
80 57.15 90.41 96.58 101.9 106.6 112.3 116.3 124.8 128.3
100 74.22 111.7 118.5 124.3 129.6 135.8 140.2 149.4 153.2
chisq-table.xls 7/11/2005