Beruflich Dokumente
Kultur Dokumente
HOMEWORK 5 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.
0 , x <1
F (x)
{
1−
( x−1)2
(10−1)(4−1)
(10−x )2
( 10−1 )( 10−4 )
1 ,10 ≤ x
,1 ≤ x ≤ 4
, 4 ≤ x ≤ 10
0 , x ≤1
F (x)
{
1−
(x−1)2
27
( 10−x )2
54
,1 ≤ x ≤ 4
, 4 ≤ x ≤ 10
1, 10 ≤ x
2
1
x=√ 27 r +1 , 0 ≤ Ri ≤ For : ( x−1) i n x=1 Ri=0 ,i n x=4 R i=0.33
3 27
1
x=10−√54 ( 1−r ) , ≤ Ri ≤ 1
3
( 10−x )2
For :1− i n x=4 R i=0,33 i n x=10 Ri =1
54
xi =√ 27 Ri +1 ,0 ≤ Ri ≤0.33
Generador=
{
x i=10− √54 ( 1−Ri ) , 0.33≤ Ri ≤1
r x
0,64 5.59
0,52 4.90
0,56 5.12
0,06 2.27
0,03 1.9
0,33 3.98
0,80 6.71
0,72 6.11
0,37 4.16
0,21 3.38
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.
2
1x 1x
x=6 r −3
{{
F(x)=¿{0, x≤−3¿ + , −3<x≤0¿ + , 0<x≤4¿ ¿
2 6 2 32
1 x
For + :i n x=−3 R i=0 , in x=0 Ri =1/2 x=√ 32 r−16
2 6
1 x2 xi =6 Ri−3 , 0 ≤ R i ≤ 0.50
For + :i n x=0 Ri=0 ,∈x=4 Ri=1 Genera t∨¿
2 32 {
x i=√ 32 R i−16 , 0.50 ≤ Ri ≤ 1
3. Given the cdf F(x) = x 4/16 on 0<=x<=2, develop a generator for this distribution.
Generate 10 values of the random variable.
Xi=√4 16 Ri , 0 ≤ Ri ≤ 1
x4
For :i n x=0 Ri=0 , en x=2 Ri=1
16
4. Data have been collected on service times at a drive-in bank window at the Shady
Lane National Bank. This data is summarized into intervals.
Consider data as empirical continuous distribution and generate five values of
service time, using four-digit random numbers
( i−1 )
X =X ( i−1 )+ ai ( R− )
n
i Ri Xi-1 ai Ci-1 Xi
1 0,506 60,00 90,00 0,37 72,52
2 0,66 90,00 128,57 0,60 98,26
3 0,55 60,00 90,00 0,37 76,43
4 0,95 180,00 450,00 0,93 185,81
5 0,54 60,00 90,00 0,37 75,70
5. Lead times have been found to be exponentially distributed with mean 3.7 days.
Generate five random lead times from this distribution.
−x
1 3.7
f ( x )= e , x ≥0
3.7
1
Generator: Ri=F ( x ) F ( X )=1−e−x( β )
x i=−βln (1−Ri )x i=−βln ( Ri )
x i=−3.7 ln (Ri)
i Ri Xi
1 0,48 2.72
2 0,82 0.73
3 0,69 1.37
4 0,67 1.48
5 0,14 7.27
C8 3, 5, 6, 11, 17