1. Kamla Nehru Institude of Technology, UP
Submitted To: Submitted By:
Dr. Aruni Singh Amit Agarwal
Assistant Professor M.Tech (FT)
Knit Sultanpur (UP) 2010202
2. Content
2
• Random number generation
• Properties of random numbers
• Generation of pseudo-random numbers
• Techniques for generating random numbers
• Tests for Random Numbers
• Random-Variate Generation:
• Inverse transform technique
• Acceptance-Rejection technique
• Special properties
3. 3
Properties of RandomNumbers
• The main properties of random numbers are
• Uniformity
• Independence
• Maximum density
• Maximum period
• Maximum density means that the gaps between random numbers
should not be large, can be achieved by having maximum period.
• Maximum period refers the length of the sequence of random
numbers which are going to repeat after a certain random numbers.
6. 6
Generation of Pseudo RandomNumbers
• Pseudo means false , here it implies generating random numbers by
known method to remove the potential for true randomness.
• If the method is known then set of random numbers can be repeated.
• Which means that numbers are not random
• The main goal of random generation technique is to produce a
sequence of numbers between 0 and 1 that simulates or imitates the
ideal properties of uniform distribution and independence
• Random numbers are generated by digital computer as part of
simulation, there are numerous ways to generate these values
7. 7
•The following are few important considerations:
• The method should be fast, simulation process requires millions of
random numbers hence it has to be fast
• The method has to be portable to different computer
• The method should have sufficiently long cycle, means there
should be long gap between the random numbers once generated
getting repeated.
• The random numbers should be repeatable
• The generatedrandomnumbersshould closely approximate the
ideal statistical properties of uniformity and independence
8. 8
Errorsor Departuresof Pseudo Random Numbers
• The generated random numbers might not be uniformly distributed.
• Generated numbers might be discrete value instead of continuous
value.
• The mean of generated random numbers might be too high or too
low.
• The variance of generated numbers might be too high or too low.
• There might be dependence
• Authentication between numbers
• Numbers successively higher or lower than adjacent numbers
• Several numbers above the mean followed by several numbers below the
mean.
9. 9
Techniques for Generating RandomNumbers
• Linear congruential method
• Combined linear congruential generators
• Random number streams
10. 10
Linear CongruentialMethod
• Proposed by Lehmer, produces a sequences of integer numbers X1,X2 ,
…between zero and m-1 by following the recursive relationship:
• X i+1= (a Xi+c) mod m, i= 0,1,2,3…
• The initial value i.e. x0 is calledseed
• a is called multiplier
• c is called the increment
• m is called the modulus
11. • If c ≠ 0 then form is called mixed congruential method
• When c= 0, the form is called multiplicative congruential method
• The selection of the values for a, c, m and X0 affects the statistical
properties and the cycle length.
• Random numbers Ri between 0 and 1 can be generated by setting
i
• R =
11
i
m
, i=1,2
Continue
14. 14
Combined Linear Congruential Generators
• Combine two or more multiplicative congruential generators in such a
way that the combined generator has good statistical properties and
longer period.
• The following result from L’Ecuyer suggest how this can be done:
19. Kolmogorov- Smirnov Test –for uniformity(Procedure)
1. Formulate the hypothesis
H0:Ri ~U[0,1] H1:Ri ~U[0,1]
2. Rank the data from smallest to largest
R(1) ≤ R(2) ≤R(3)…
3. Calculate the values of D+ and D-
19
20. 20
4. Find D=max(D+,D-)
5. Find the critical value Dα from the K-S table
6. If D> Dα then
reject the hypothesis H0
else If D < Dα then
accept the hypothesis H0
Continue