Professional Documents
Culture Documents
of Manufacturing Systems
Example A lamp failure rate is 1/3 per hour, that mean on average 1 failure per 3 hours
The probability that the lamp will last more than its mean life is
P(X>3)= 1 – P(X<3)
−3
=1 – (1 - 𝑒 ) = e-1= 0.368
3
The probability that the lamp will lasts more than 2 hours but less than 3 hours is:
P(2≤X≤3)= F(3) - F(2)
−3 −2
= (1 − 𝑒 ) − (1 − 𝑒 )=0.148
3 3
The probability that the lamp will lasts for 1 more hour , it is given that the lamp is
already operated 2.5 hours :
−1
P(X<3.5| X>2.5) = P(X>1)=𝑒 =0.717 3
• It has 3 parameters:
• Location parameter: , (- < < )
• Scale parameter: β, (β>0)
• Shape parameter: , (>0)
• Example: =0 and = 1:
• For β = 1, = 0
• Find out the probability that the vessel is loaded in less than 10
hours
10 − 12
𝐹 10 = ϕ ቆ ቇ = ϕ −1 = 1 − ϕ 1
2
=0.1587
2
𝜇+𝜎 ൗ2
• Mean: E(X)= 𝑒
𝜎2 2
• Variance: V(X) = 𝑒 2𝜇+ ൗ2 (𝑒 𝜎 − 1)
The most common set from which random numbers are derived is the
set of double digit decimal number. {0,0.11,0.82,0.63,0.44,0.65,
0.36,0.27,0.18,0.99}
• Uniformity
• If the interval [0,1] is divided into n classes, or subintervals
of equal length, the expected number of observations in
each interval is N/n, Where N is the total number of
observations
• Independence
• The probability of observing a value in a particular interval
is independent of previous values drawn
• Uniformity
• If the interval [0,1] is divided into n classes, or subintervals
of equal length, the expected number of observations in
each interval is N/n, Where N is the total number of
observations
• Independence
• The probability of observing a value in a particular interval
is independent of previous values drawn
Seed number X0
is not making
any difference in
terms of increase
in the numbers
of distinct
random numbers
generation
Increment is Not
making much
difference in
most cases in
terms of increase
in the numbers
of distinct
random numbers
generation
Multiplier a is
making much
difference in
terms of increase
in the numbers
of distinct
random numbers
generation
Modulo m is
making much
difference in
terms of increase
in the numbers
of distinct
random numbers
generation
• Maximum density
• Numbers are generated only from the set {0 , 1/m, 2/m, 3/m, …..
(m-1)/m}, because each 𝑋𝑖 is an integer in the set of {0,1,2….m-1}
• The difference between two successive numbers determine the
density, always try to keep maximum
• to obtain maximum density, m should be very large integer,
• Maximum period
• Recurrence of the same sequence after certain number of values
• Period can be maximum by proper selection of a, c, m and 𝑋0
24.03.2021 Dr. Ashish Kumar Saxena 9
Few methods to maximise density and period
• For m a power of 2, say 𝑚 = 2𝑏 and c0, the longest possible period
is P= 𝑚 = 2𝑏 , this can be achieved, if c is relatively prime to m and
a=1+4k
• Autocorrelation test:
This test does not imply that further testing of the generator for
uniformity is unnecessary.
This test does not imply that further testing of the generator for
independence is unnecessary.
If the sample from the random number generator is R1, R2, ………. RN
then the empirical cdf SN(x) is defined by
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑅1 , 𝑅2 ………….𝑅𝑁 ,𝑤ℎ𝑖𝑐ℎ 𝑎𝑟𝑒 ≤𝑥
𝑆𝑁 𝑥 =
𝑁
This test is based on the largest absolute deviation between F(x) and
SN(x) over the range of variables. i.e.
𝐷 = 𝑚𝑎𝑥 𝐹 𝑥 − 𝑆𝑁 (𝑥)
The26.03.2021
sampling distribution of DDr.isAshish
known and is tabulated as function 8of N
Kumar Saxena
Kolmogorov-Smirnov Test
Procedural steps:
Step 1: Rank the data from smallest to large. Let 𝑅(𝑖) denote the ith
smallest observation so that
𝑅(1) ≤ 𝑅 2 ≤ 𝑅 3 ≤ ⋯ … … … … … … … … … … … … . ≤ 𝑅(𝑁)
Step 2: Compute
+
𝑖
𝐷 = 𝑚𝑎𝑥1≤𝑖≤𝑁 { − 𝑅(𝑖) }
𝑁
−
𝑖−1
𝐷 = 𝑚𝑎𝑥1≤𝑖≤𝑁 {𝑅 𝑖 − }
𝑁
Step 3: Compute D = max(𝐷 , 𝐷 ) + −
Step 4: Determine the critical value of 𝐷𝛼 from the table for specified
significance level and given sample size
Step 5: If the sample statistic D is greater than the critical value 𝐷𝛼 , the
null hypothesis that data are sample from a uniform distribution is
rejected
If D≤𝐷𝛼 , Conclude as No difference has been detected between the true
distribution
26.03.2021 of {𝑅1 , 𝑅2 ,……𝑅𝑁 } Dr.
and Ashishthe
Kumaruniform
Saxena distribution. 9
Kolmogorov-Smirnov
critical values Table
• Autocorrelation test:
Step 4: Determine the critical value of 𝐷𝛼 from the table for specified
significance level and given sample size
Step 5: If the sample statistic D is greater than the critical value 𝐷𝛼 , the
null hypothesis that data are sample from a uniform distribution is
rejected
If D≤𝐷𝛼 , Conclude as No difference has been detected between the true
distribution
26.03.2021 of {𝑅1 , 𝑅2 ,……𝑅𝑁 } Dr.
and Ashishthe
Kumaruniform
Saxena distribution. 3
Chi-Square Test
The Chi-square test uses the sample statistic
𝑛
(𝑂𝑖 − 𝐸𝑖 )2
0 2 =
𝐸
𝑖=1
• Chi-square test uses frequency interval rather than all individual values
• Chi-square test can be suitable for testing large stream of numbers
Procedural steps:
Step 1: Divide the range into equally spaced subranges
(𝑂−𝐸)2
Step 4: Determine the chi square statistic 0 = 2 σ
𝐸
Step 5: If calculated value is less than the chi-square value in the table
accept the null hypothesis (i.e.) The sequence is random
0.34 0.90 0.25 0.89 0.87 0.44 0.12 0.21 0.46 0.67
0.83 0.76 0.79 0.64 0.70 0.81 0.94 0.74 0.22 0.74
0.96 0.99 0.77 0.67 0.56 0.41 0.52 0.73 0.99 0.02
0.47 0.30 0.17 0.82 0.56 0.05 0.45 0.31 0.78 0.05
0.79 0.71 0.23 0.19 0.82 0.93 0.65 0.37 0.39 0.42
0.99 0.17 0.99 0.46 0.05 0.66 0.10 0.42 0.18 0.49
0.37 0.51 0.54 0.01 0.81 0.28 0.69 0.34 0.75 0.49
0.72 0.43 0.56 0.97 0.30 0.94 0.96 0.58 0.73 0.05
0.06 0.39 0.84 0.24 0.40 0.64 0.40 0.19 0.79 0.62
0.18 0.26 0.97 0.88 0.64 0.47 0.60 0.11 0.29 0.78
Take n=10 interval of equal length namely [0.0, 0.1), [0.1, 0.2), [0.2, 0.3), [0.3, 0.4), [0.4,
0.5), [0.5, 0.6), [0.6, 0.7), [0.7, 0.8), [0.8, 0.9) and [0.9, 1.0)
The observed value of 2 is 3.4 this is compared with the critical value 2 0.05,10 = 18.31, Since
2 is much smaller than the tabulated value of 2 0.05,10 ,
Thus, the null hypothesis of uniform distribution is not rejected
𝑀
1
𝜌ෞ
𝑖,𝑚 = 𝑅𝑖+𝑘𝑚 𝑅𝑖+ 𝑘+1 𝑚 − 0.25
𝑀+1
𝑘=0
13𝑀 + 7
𝜎ො𝜌 𝑖,𝑚 =
12(𝑀 + 1)
• After computing
Analyse 𝑍0 , if −𝑧𝛼/2 ≤ 𝑍0 ≤ 𝑧𝛼/2 , it do not reject the hypothesis of independence
• Autocorrelation test:
Step 2: Find the value of i and lag m. i is the sequence of first number is
given Random number data set and m is interval of numbers in
tested data sequence
ෝ 𝑖,𝑚
𝜌
Step 6: Obtain the value of 𝑍0 = ෝ 𝜌 𝑖,𝑚
𝜎
Solution: 0.68 0.49 0.05 0.43 0.95 0.58 0.19 0.36 0.69 0.87
ෝ 𝑖,𝑚
𝜌 −0.1945
Step 6: 𝑍0 = = = −1.516
ෝ 𝜌 𝑖,𝑚
𝜎 0.1280
Solution:
Here =0.05, i=3, m=5, N=30 and M=4 (largest integer such that
3+(M+1)5≤30)
1 𝑀
𝜌ෞ
𝑖,𝑚 = σ 𝑘=0 𝑅𝑖+𝑘𝑚 𝑅𝑖+ 𝑘+1 𝑚 − 0.25
𝑀+1
1
𝜌ෞ
3,5 = 0.23 0.28 + 0.28 0.33 + 0.33 0.27 + 0.27 0.05 + 0.05 0.36 −
4+1
0.25
= - 0.1945
13𝑀+7 13(4)+7
𝜎ො𝜌 𝑖,𝑚 = = = 0.128
12(𝑀+1) 12(4+1)
ෝ 𝑖,𝑚 −0.1945
𝜌
𝑍0 = ෝ = = −1.516
𝜎𝜌 𝑖,𝑚 0.1280
𝑍0.025 =1.96
31.03.2021 Dr. Ashish Kumar Saxena 9
Since -1.96≤𝑍0 =-1.516≤1.96, the hypothesis is not rejected
Test for Autocorrelation
• Correlation at lag j
𝐶𝑗
𝜌𝑗 =
𝐶𝑜
𝐶𝑗 = 𝐶𝑜𝑣 𝑋𝑖 , 𝑋𝑖+1 = 𝐸 𝑋𝑖 , 𝑋𝑖+𝑗 − 𝐸 𝑋𝑖 𝐸(𝑋𝑖+𝑗 )
𝐶0 = 𝐶𝑜𝑣 𝑋𝑖 , 𝑋𝑖 = 𝐸 𝑋𝑖 , 𝑋𝑖 − 𝐸 𝑋𝑖 𝐸 𝑋𝑖 = 𝐸 𝑋𝑖2 − [𝐸(𝑋𝑖 )]2
= 𝑉𝑎𝑟(𝑋𝑖 )
𝐸 𝑋𝑖 , 𝑋𝑖+𝑗 − 𝐸 𝑋𝑖 𝐸(𝑋𝑖+𝑗 )
𝜌𝑗 =
𝑉𝑎𝑟(𝑋𝑖 )
Assume 𝑋𝑖 = 𝑈𝑖
1 1
𝐸 𝑈𝑖 = and 𝑉𝑎𝑟 𝑈𝑖 =
2 12
1
𝐸 𝑈𝑖 , 𝑈𝑖+𝑗 −
𝜌𝑗 = 4 = 12𝐸 𝑈 , 𝑈
1 𝑖 𝑖+𝑗 − 3
12
31.03.2021 Dr. Ashish Kumar Saxena 10
Any Question ?
• Random Variate
• Inverse transform technique
• To generate Exponential, Uniform, Triangular and
Weibull distribution
• Acceptance Rejection techniques
• Convolution method
And ITT also used for sampling wide variety of discrete distributions
This method straight forward but not always most efficient computation
technique
Procedural steps:
Step 1: Compute the cdf function of desired random variable
For exponential distribution the cdf function is 𝐹 𝑥 = 1 − 𝑒 −𝜆𝑥 , 𝑥 ≥ 0
Step 3: 1 − 𝑒 −𝜆𝑋 = 𝑅
𝑒 −𝜆𝑋 = 1 − 𝑅 −𝜆𝑋 = ln 1 − 𝑅
1
𝑋 = − ln 1 − 𝑅
𝜆
𝑋 = 𝐹 −1 𝑅
1
𝑋𝑖 = − ln 𝑅𝑖
𝜆
This alternatively justified by the fact that both 𝑅𝑖 and 1-𝑅𝑖 are
uniformly distributed in range [0,1]
1
Solution: As we have 𝑋𝑖 = − 𝜆 ln 1 − 𝑅𝑖 , = 1/mean=1
1
𝑋1 = − ln 1 − 𝑅1 𝑋1 = − ln 1 − 0.1306 = 0.13995
𝜆
1
𝑋2 = − ln 1 − 𝑅2 𝑋2 = − ln 1 − 0.0422 = 0.04311
𝜆
1
𝑋3 = − ln 1 − 𝑅3 𝑋3 = − ln 1 − 0.6597 = 1.0779
𝜆
1
𝑋4 = − ln 1 − 𝑅4 𝑋4 = − ln 1 − 0.7965 = 1.5921
𝜆
1
𝑋5 = − ln 1 − 𝑅5 𝑋5 = − ln 1 − 0.7696 = 1.4679
𝜆
i 1 2 3 4 5
Xi 0.13995 0.04311 1.0779 1.5921 1.4679
𝑏−𝑥 2
𝐹 𝑥 =1− = 𝑅 in the range 𝑐 < 𝑥 ≤ 𝑏
𝑏−𝑎 𝑏−𝑐
0.263 1.986
0.340 2.258
0.697 3.259
0.349 2.288
0.530 2.820
0.805 3.604
0.223 1.829
0.819 3.655
0.996 4.800
0.507 2.758
0.263 1.986
1
Where = 𝜆 and 𝛽=𝜅
𝛼
Generate uniform random numbers, one should accept random numbers, which fall in
required interval and reject those random numbers which are outside the required
interval
Each time step 1 is executed a new random number R must be generated. Step 2a is an
“Acceptance” and step 2b is a “rejection” in this acceptance rejection technique.
Solution
ෑ 𝑅𝑖 = 𝑅1 + 𝑅1 𝑅2 + 𝑅1 𝑅2 𝑅3 + ⋯ + 𝑅1 𝑅2 𝑅3 . . 𝑅𝑛
𝑖=1
• Finally we have
𝑛 𝑛+1
𝑙𝑛 ෑ 𝑅𝑖 ≥ −𝜆 ≥ 𝑙𝑛 ෑ 𝑅𝑖
𝑖=1 𝑖=1
𝑛 𝑛+1
ෑ 𝑅𝑖 ≥ 𝑒 −𝜆 ≥ ෑ 𝑅𝑖
𝑖=1 𝑖=1
So we have to find n that satisfies the above relation and n will follow a
Poisson distribution
09.04.2021 Dr. Ashish Kumar Saxena 7
Use acceptance-rejection technique for Generation
Procedural Steps: of Poisson Distribution
Step 1 Set n=0, P=1
Now question come up: How many random numbers will be required on
average to generate one Poisson variate N?
If N=n then n+1 random numbers are required so the average number is
given by E(n+1)=+1
09.04.2021 Dr. Ashish Kumar Saxena 8
Use acceptance-rejection technique for Generation
of Poisson Distribution
Generate three Poisson variate with mean (or )=0.5 and 𝑒 −0.5 =
0.6065 and initial value of P=1
n Ri Accept / Poisson
𝑷 = ෑ𝒏+𝟏
Reject Variate
0 1*R1 A N=0
0.526 1*0.526
0 0.210 1*0.210 A N=0
0 1*R1 R
0.870 1*0.870
1 R1*R2 R
0.859 0.870*0.859=
0.7473
2 R1*R2*R3 A N=2
0.692 0.870*0.859*
0.692=0.5171
𝑋 = 𝑋𝑖
𝑖=1
The convolution approach is to generate 𝑋1 , 𝑋2 ,…. , 𝑋𝑘 . Then sum of
them is obtained to get X.
The 𝑋𝑖 is obtained by exponential random variate equation,
1 1 1
𝑋𝑖 = − ln(𝑅𝑖 ), where =
𝜆 𝜆 𝑘θ
From above expression
𝑘
1
𝑋 = − ln(𝑅𝑖 )
𝜆
𝑖=1
09.04.2021 Dr. Ashish Kumar Saxena 4
Erlang Distribution example
1
After putting value of in obtained expression
𝜆
𝑘
1
𝑋 = − ln(𝑅𝑖 )
𝑘θ
𝑖=1
𝑘
1
𝑋 = − ln ෑ 𝑅𝑖
𝑘𝜃
𝑖=1
It is more efficient computationally to multiply all random numbers and then compute only
one logarithm
Thus, X has the Erlang distribution with k=2 and mean 1/=2/=0.2 hour
Now to generate random variate X, first obtain random number, then used Erlang
distribution expression
1 0.2
𝑋=− ln ς𝑘𝑖=1 𝑅𝑖 𝑋 = − ln ς2𝑖=1 𝑅𝑖 𝑋 =-0.1ln(R1*R2)
𝑘𝜃 2