Assgn
Assgn
Manual Simulation
A) simulate 10 individuals Probability of time between Calls
First, simulate for one taxi for 10 days. Then, simulate for two taxis for 10 days.
Comparison
Taxi Company would have to decide which is more important paying for about 43 hours of
production timein a Ten day period with no customers having to wait, or paying for around 4
hours of Production time ina Ten day period, but having a probability of waiting equal to 0.59
with an average waiting time for
those who wait of around 20 minutes.
88
154 50 126 50 920 50 1056
8
B) Compare the two systems with respect to the waiting times
Total idle time = 530 minutes = 8.816 hours
Average idle time per call = 2.7 minutes
Proportion of idle time = 0.11
Total time customers wait = 4266 minutes
Average waiting time per customer = 11.9 minutes
Number of customers that wait = 122 (of 226 customers)
Probability that a customer has to wait = .61
Average waiting time of customers that wait = 20.2 minutes
3. Statistical Models in Simulation
(A) Customers at a restaurant arrive in groups (one to eight persons). The number of
persons(per group) for 300 customers and the relative frequencies are given below.
Draw the empirical cumulative distribution function (cdf)
Arrival per party 1 2 3 4 5 6 7 8
Frequency 30 110 45 71 12 13 7 12
(b) A hurricane is to hit in country, and expected to follow Poisson distribution with a mean of
08 per year.
i. computer the probability of exactly one hurricane in a year will be.
(c) The lifetime, in years, of a satellite place in orbit is given be exponential distribution
withlambda = 0.4
i. what is the probability of the satellite lasting at least five years?
F(x) = 1- Exp[-lambda*x]
F(0) = 1-1 = 0
= 0.135
ii. what is the probability that the satellite dies between three and six years?
Solution:- P(x, 3<x<6) = F(6) – F(3)
= (1- Exp[-lambda*6] ) - ( 1- Exp[-lambda*3])
= ( 1- Exp[-0.4*6]) - (1- Exp[-0.4*3])
= ( 1- Exp[-2.4] ) - (1- Exp[-1.2])
= (1 - 0.09) - ( 1 - 0.301)
= 0.91 – 0.699
= 0.211
i. Find the probability that the battery will fail within 1.5 years.
Solution:-weibull distribution
1 else
= 1 – Exp[ -(1.5/0.5)^0.25 ]
= 1 – 0.268
= 0.732
ii. Find the probability that battery will last for longer than its mean life.
P(x,x>12) = 1 –F(12)
P(x,x>12) = 0.891
iii. Find the probability that battery will last between 1.5 and 2.5 years.
(a) Generate 10 random numbers with the combined generator, using the initial seeds
X(i,0) = 100, 300, 500, for the individual generators i = 1, 2, 3.
= ( 15700 mod 32363 – 43500 mod 31727 + 71000 mod 31657 ) mod 32362
= ( 15700 - 11773 + 7686 ) mod 32362
= 11613 mod 32362
X(1) = 11613
X(2) = 14785
X(1,2) = 5312 X(2,2) = 5600 X(3,2) = 15074
X(3) = 19,973
X(1,3) = 24,909 X(2,3) = 24,425 X(3,3) = 19489
X(4) = [ X(1,4) - X(2,4) + X(3,4) ] mode (m1 – 1)
= ( [ 157 * 24,909 ] mod 32363 - [ 146 * 24,425 ] mod 31727 + [ 142 * 19489 ] mod 31657 )
mod (32362 )
X(4) = 27,806
X(1,4) = 27153 X(2,4) = 12626 X(3,4) = 12626
X(6) = 3052
X(1,6) = 27457 X(2,6) = 13402 X(3,6) = 17924
X(7) = 1741
X(1,7) = 6470 X(2,6) = 21345 X(3,6) = 16616
X(8) = 28793
X(1,8) = 12537 X(2,8) = 598 X(3,8) = 16854
X(9) = [ X(1,9) - X(2,9) + X(3,9) ] mode (m1 – 1)
= ( [ 157 * 12537 ] mod 32363 - [ 146 * 598 ] mod 31727 + [ 142 * 16854 ] mod 31657 )
mod (32362 )
X(9) = 21668
X(1,9) = 26529 X(2,9) = 23854 X(3,9) = 18993
X(10) = 4309
X(1,10) = 22589 X(2,10) = 24441 X(3,10) = 6161
(b) Apply the uniformity and independence tests to the generator and comment on the results.
1741, 3052, 4309, 11613, 13417, 14785, 19973, 21668, 27806 ,28793
D+ => [ 0.05, 0.11, 0.167, 0.042, 0.086, 0.144, 0.083, 0.131, 0.041, 0.111 ]
D- => [ 0.05, -0.01, -0.067, 0.058, 0.014, -0.044, 0.017, -0.031, 0.059, -0.011]
Independence test
at R(10), the value of D+ is given by 10/20 − R(10) = 0.5 − 0.474 =0.26 and that
of D− is given by R(10) − 9/10 = 0.474 − 0.45= 0.24
Answer
Two results that are useful to solve this problem are
and that if g = h mod m, then we can write g = h-km for some integer k >=0. The last result is
true because, by definition, g is the remainder after subtracting the largest integer multiple of m
thatis <= h.
7. Random -Variate Generator
Develop a random-variate generator for a random variable X with the pdf
R = F(x)
8. INPUT MODELING THE TIME REQUIRED FOR THE TRANSMISSION OF A MESSAGE (IN MINUTES) IS
SAMPLED ELECTRONICALLY AT A COMMUNICATIONS CENTER. THE LAST 50 VALUES IN THE SAMPLE ARE AS
FOLLOWS.
7.936 4.612 2.407 4.278 5.132
4.599 5.224 2.003 1.857 2.696
5.259 7.563 3.937 6.908 5.002
6.212 2.759 7.172 6.513 3.326
8.761 4.502 6.188 2.566 5.515
3.785 3.742 4.682 4.346 5.359
3.535 5.061 4.629 5.298 6.492
3.502 4.266 3.129 1.298 3.454
5.289 6.805 3.827 3.912 2.969
4.646 5.963 3.829 4.402 4.924
The data were collected over the interval from 0 to T = 100 minutes. It can be shown that,
if the underlying distribution of Transmission times {T1, T2, . . . } is exponential, the arrival times are
uniformly distributed on the interval [0, T]. The arrival times T1, T1 + T2, T1 + T2 + T3, . . . ,
T1 +· · ·+T50 are obtained by adding Transmission times. The Transmission times are then normalized to a
[0, 1] interval so that the Kolmogorov–Smirnov test can be applied. On a [0, 1] interval, the points
will be [T1/T, (T1 + T2)/T, . . . , (T1 +· · ·+T50)/T]. The resulting 50 data points are as follows
Solution: -
Variance = 103.41
Solution:-
The data were collected over the interval from 0 to T = 100 minutes. It can be shown that,
if the underlying distribution of Transmission times {T1, T2, . . . } is exponential, the arrival times are
uniformly distributed on the interval [0, T]. The arrival times T1, T1 + T2, T1 + T2 + T3, . . . ,
T1 +· · ·+T50 are obtained by adding Transmission times. The Transmission times are then normalized to a
[0, 1] interval so that the Kolmogorov–Smirnov test can be applied. On a [0, 1] interval, the points
will be [T1/T, (T1 + T2)/T, . . . , (T1 +· · ·+T50)/T]. The resulting 50 data points are as follows
0.0066
1 0.05571 0.0965 0.13462 0.2091
0.0578
5 0.15694 0.58752 0.02204 0.04285
0.1417 0.06406 0.01312 0.01626 0.62807
0.1617
3 0.03419 0.18263 0.07336 0.1187
0.0339
2 0.07553 0.17374 0.06353 0.07297
0.0308
1 0.03645 0.11274 0.04488 0.10905
0.0691
6 0.2863 0.12768 0.05297 0.07754
0.0755
3 0.13904 0.13372 0.04072 0.08558
0.1307
4 0.0283 0.01582 0.02561 0.00976
0.0503
1 0.01038 0.09724 0.02536 0.01451