You are on page 1of 5

Jose Alejandro Bastidas B.

SIMULATION

HOMEWORK 4 CHAPTER 2
RANDOM NUMBERS

1. Develop a generator for a triangular distribution with range (1, 10) and mode
at x=4. Generate 10 values of the random variable.

We know that: a= 1, c = 10 and b = 4

r x

0,22 3,44

0,55 5,07

0,82 6,88

0,05 2,16

0,19 3,26

0,59 5,29

0,52 4,91

0,01 1,52

0,97 8,73

0,31 3,89
Jose Alejandro Bastidas B.

2. Given the following cdf for a continuous variable with range from – 3 to 4,
develop a generator for the variable, generate 30 values, and plot a
histogram.
0, x  −3
1 x
 + , −3 x  0
2 6
F ( x) =  2
1 + x , 0  x  4
 2 32
1, x4

r x
0,25 -1,49
0,97 3,87
0,47 -0,16
0,64 2,15
0,03 -2,84
0,15 -2,08
0,28 -1,34
0,59 1,73
0,42 -0,46
0,27 -1,39
0,95 3,78
0,73 2,71
0,17 -1,97
0,46 -0,25
0,96 3,82
0,07 -2,58
0,26 -1,46
0,15 -2,09
0,77 2,92
0,85 3,37
0,97 3,86
0,60 1,82
0,96 3,84
0,84 3,32
0,55 1,20
0,90 3,56
0,01 -2,95
0,08 -2,51
0,61 1,85
0,05 -2,72
Jose Alejandro Bastidas B.

3. Given the cdf F(x) = x4/16 on 0<=x<=2, develop a generator for this
distribution. Generate 10 values of the random variable.

r x
0,47 1,66
0,87 1,93
0,77 1,88
0,17 1,29
0,85 1,92
0,64 1,79
0,60 1,76
0,21 1,36
0,31 1,49
0,74 1,86
Jose Alejandro Bastidas B.

4. Data have been collected on service times at a drive-in bank window at the
Shady Lane National Bank. This data are summarized into intervals as
follows:

Interval (seconds) Frequency


15-30 10
30-45 20
45-60 25
60-90 35
90-120 30
120-180 20
180-300 10

Consider data as empirical continuous distribution and generate five values


of service time, using four-digit random numbers

i Interval(seconds) Frequency Relative Frequency Cumulative Frequency Ci Ai


1 15<x<30 10 0,06666666 0,066666 225
2 30<x<45 20 0,13333333 0,1999 113
3 45<x<60 25 0,16666666 0,366666 90
4 60<x<90 35 0,23333333 0,60 129
5 90<x<120 30 0,20 0,80 150
6 120<x<180 20 0,133333333 0,933333 450
7 180<x<300 10 0,066666666 1,00 1800
150
Jose Alejandro Bastidas B.

5. Lead times have been found to be exponentially distributed with mean 3.7
days. Generate five random lead times from this distribution.

r x
0,79 0,86
0,42 3,20
0,51 2,50
0,70 1,32
0,29 4,52

C8 3, 5, 6, 11, 17

You might also like