SlideShare a Scribd company logo
RANDOM-NUMBER
GENERATION
BY
S.KANNAPPAN
AP-MTRE
INTRODUCTION
• Random numbers are a necessary basic ingredient in
the simulation of almost all discrete systems.
• Most computer languages have a subroutine, object,
or function that will generate a random number.
• Random numbers that are used to generate event
times and other random variables.
Properties of Random Numbers
• A sequence of random numbers, R1, R2... must
have two important statistical properties,
uniformity and independence.
• Each random number Ri, is an independent
sample drawn from a continuous uniform
distribution between 0 and 1.
Properties of Random Numbers
• That is, the pdf is given by
• The density function is shown below:
Properties of Random Numbers
• Some consequences of the uniformity and independence
properties are :
1. If the interval (0, 1) is divided into n classes, or
subintervals of equal length, the expected number of
observations m each interval is N/n where N is the total
number of observations.
2. The probability of observing a value in a particular
interval is independent of the previous values drawn.
Generation of Pseudo-Random Numbers
• Pseudo means false, so false random numbers
are being generated.
• The goal of any generation scheme, is to produce
a sequence of numbers between zero and 1
• Which simulates, or initiates, the ideal properties
of uniform distribution and independence as
closely as possible.
Generation of Pseudo-Random Numbers
• When generating pseudo-random numbers,
certain problems or errors can occur.
• These errors, or departures from ideal
randomness, are all related to the properties
stated previously.
• Some examples include the following
Generation of Pseudo-Random Numbers
1) The generated numbers may not be uniformly
distributed.
2) The generated numbers may be discrete -valued instead
continuous valued.
3) The mean of the generated numbers may be too high or
too low.
4) The variance of the generated numbers may be too high
or low.
Considerations in RN routine
• The routine should be fast
• The routine should be portable
• The routine should have a sufficiently long cycle
• The random numbers should be replicable.
• Random numbers should closely approximate the
ideal statistical properties of uniformity and
independences
Techniques for Generating Random Numbers
The linear congruential method
• It widely used technique, initially proposed by
Lehmer [1951]
• It produces a sequence of integers, X1, X2,...
Between zero and m — 1 according to the following
recursive relationship:
Xi+1 = (aXi + c) mod m, i = 0, 1, 2....
The linear congruential method
• If c ≠ 0then the form is called mixed congruential
method.
• When c = 0, the form is known as the multiplicative
congruential method.
• The selection of the values for a, c, m and X0
drastically affects the statistical properties and the
cycle length.
Multiplicative Congruential Method:
• Most natural choice for m is one that equals to the
capacity of a computer word.
• m = 2b (binary machine), where b is the number of bits in
the computer word.
• m = 10d (decimal machine), where d is the number of
digits in the computer word.
Xi+1 = a Xi (mod m), where a ≥ 0 and m ≥ 0 …
Tests For Random Numbers
1. Frequency test. Uses the Kolmogorov-Smirnov or the
chi-square test to compare the distribution of the set
of numbers generated to a uniform distribution.
2. Runs test. Tests the runs up and down or the runs
above and below the mean by comparing the actual
values to expected values. The statistic for
comparison is the chi-square.
Tests For Random Numbers
3. Autocorrelation test. Tests the correlation between
numbers and compares the sample correlation to the
expected correlation of zero.
4. Gap test. Counts the number of digits that appear
between repetitions of a particular digit and then
uses the Kolmogorov-Smirnov test to compare with
the expected number of gaps.
Tests For Random Numbers
5. Poker test. Treats numbers grouped together as a
poker hand. Then the hands obtained are compared
to what is expected using the chi-square test.
• In testing for uniformity, the hypotheses are as
follows:
 H0: Ri ~ U[0,1]
 H1: Ri ɫ U[0,1]
Tests For Random Numbers
• The null hypothesis, H0, reads that the numbers are
distributed uniformly on the interval [0, 1].
• In testing for independence, the hypotheses are as
follows
 H0: Ri ~ independently
 H1: Ri ɫ independently
Frequency Tests
• To validate a new generator is the test of uniformity.
• Two types - Kolmogorov-Smirnov and Chi-square test.
• Both measure the degree of agreement between the
distribution of a sample of generated random numbers and
the theoretical uniform distribution.
• Both tests are on the null hypothesis of no significant
difference between the sample distribution and the
theoretical distribution.
The Kolmogorov-Smirnov test
The Kolmogorov-Smirnov test
• Suppose that the five numbers 0.44, 0.81,
0.14, 0.05, 0.93 were generated, and it is
desired to perform a test for uniformity using
the Kolmogorov-Smirnov test with a level of
significance of 0.05.
Chi-Square Test
Use the chi-square test with level of significance 0.05 to
test whether the data shown below are uniformly
distributed. The test uses n = 10 intervals of equal length
Chi-Square Test
Run Test
Run Test
Based on runs up and runs down, determine whether the
following sequence of 40 numbers is such that the hypothesis
of independence can be rejected where a = 0.05.

More Related Content

What's hot

Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
Rachana Pathak
 
trapezoidal and simpson's 1/3 and 3/8 rule
trapezoidal and simpson's 1/3 and 3/8 ruletrapezoidal and simpson's 1/3 and 3/8 rule
trapezoidal and simpson's 1/3 and 3/8 rule
hitarth shah
 
Cauchy riemann equations
Cauchy riemann equationsCauchy riemann equations
Cauchy riemann equationssajidpk92
 
Euler and improved euler method
Euler and improved euler methodEuler and improved euler method
Euler and improved euler method
Sohaib Butt
 
Moments in statistics
Moments in statisticsMoments in statistics
Moments in statistics
515329748
 
Double Integral Powerpoint
Double Integral PowerpointDouble Integral Powerpoint
Double Integral Powerpoint
oaishnosaj
 
Numerical analysis ppt
Numerical analysis pptNumerical analysis ppt
Numerical analysis ppt
MalathiNagarajan20
 
Continuous Random variable
Continuous Random variableContinuous Random variable
Continuous Random variable
Jay Patel
 
Probability and Random Variables
Probability and Random VariablesProbability and Random Variables
Probability and Random Variables
Subhobrata Banerjee
 
Bender schmidt method
Bender schmidt methodBender schmidt method
Bender schmidt method
Vaitheeswaran Gnanaraj
 
Roll's theorem
Roll's theoremRoll's theorem
Roll's theorem
Md. Mizanur Rahaman
 
Cayley Hamilton Theorem
Cayley Hamilton Theorem Cayley Hamilton Theorem
Cayley Hamilton Theorem
Umur Gümüşbaş
 
Real analysis
Real analysis Real analysis
Real analysis
Kalaiselviprakash
 
Geometric algorithms
Geometric algorithmsGeometric algorithms
Geometric algorithms
Ganesh Solanke
 
numerical differentiation&integration
numerical differentiation&integrationnumerical differentiation&integration
numerical differentiation&integration8laddu8
 
Pigeonhole Principle
Pigeonhole PrinciplePigeonhole Principle
Pigeonhole Principlenielsoli
 
carry look ahead adder
carry look ahead addercarry look ahead adder
carry look ahead adder
ASHISH MANI
 

What's hot (20)

Functions in discrete mathematics
Functions in discrete mathematicsFunctions in discrete mathematics
Functions in discrete mathematics
 
trapezoidal and simpson's 1/3 and 3/8 rule
trapezoidal and simpson's 1/3 and 3/8 ruletrapezoidal and simpson's 1/3 and 3/8 rule
trapezoidal and simpson's 1/3 and 3/8 rule
 
Romberg’s method
Romberg’s methodRomberg’s method
Romberg’s method
 
Mean Value Theorems
Mean Value TheoremsMean Value Theorems
Mean Value Theorems
 
Diagonalization
DiagonalizationDiagonalization
Diagonalization
 
Cauchy riemann equations
Cauchy riemann equationsCauchy riemann equations
Cauchy riemann equations
 
Euler and improved euler method
Euler and improved euler methodEuler and improved euler method
Euler and improved euler method
 
Moments in statistics
Moments in statisticsMoments in statistics
Moments in statistics
 
Double Integral Powerpoint
Double Integral PowerpointDouble Integral Powerpoint
Double Integral Powerpoint
 
Numerical analysis ppt
Numerical analysis pptNumerical analysis ppt
Numerical analysis ppt
 
Continuous Random variable
Continuous Random variableContinuous Random variable
Continuous Random variable
 
Probability and Random Variables
Probability and Random VariablesProbability and Random Variables
Probability and Random Variables
 
Bender schmidt method
Bender schmidt methodBender schmidt method
Bender schmidt method
 
Roll's theorem
Roll's theoremRoll's theorem
Roll's theorem
 
Cayley Hamilton Theorem
Cayley Hamilton Theorem Cayley Hamilton Theorem
Cayley Hamilton Theorem
 
Real analysis
Real analysis Real analysis
Real analysis
 
Geometric algorithms
Geometric algorithmsGeometric algorithms
Geometric algorithms
 
numerical differentiation&integration
numerical differentiation&integrationnumerical differentiation&integration
numerical differentiation&integration
 
Pigeonhole Principle
Pigeonhole PrinciplePigeonhole Principle
Pigeonhole Principle
 
carry look ahead adder
carry look ahead addercarry look ahead adder
carry look ahead adder
 

Similar to MT6702 Unit 2 Random Number Generation

Unit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generationUnit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generation
raksharao
 
Pseudo Random Number
Pseudo Random NumberPseudo Random Number
Pseudo Random Number
Hemant Chetwani
 
Random number generation
Random number generationRandom number generation
Random number generation
vinay126me
 
Data Structures - Lecture 1 [introduction]
Data Structures - Lecture 1 [introduction]Data Structures - Lecture 1 [introduction]
Data Structures - Lecture 1 [introduction]
Muhammad Hammad Waseem
 
AN ALTERNATIVE APPROACH FOR SELECTION OF PSEUDO RANDOM NUMBERS FOR ONLINE EXA...
AN ALTERNATIVE APPROACH FOR SELECTION OF PSEUDO RANDOM NUMBERS FOR ONLINE EXA...AN ALTERNATIVE APPROACH FOR SELECTION OF PSEUDO RANDOM NUMBERS FOR ONLINE EXA...
AN ALTERNATIVE APPROACH FOR SELECTION OF PSEUDO RANDOM NUMBERS FOR ONLINE EXA...
cscpconf
 
Chi square
Chi squareChi square
Unit 3 – AIML.pptx
Unit 3 – AIML.pptxUnit 3 – AIML.pptx
Unit 3 – AIML.pptx
hiblooms
 
ORMR_Monte Carlo Method.pdf
ORMR_Monte Carlo Method.pdfORMR_Monte Carlo Method.pdf
ORMR_Monte Carlo Method.pdf
SanjayBalu7
 
Testing Numbers for Randomness Chi Square test
Testing Numbers for Randomness Chi Square testTesting Numbers for Randomness Chi Square test
Testing Numbers for Randomness Chi Square test
RachitSharma6516
 
Modeling & Simulation Lecture Notes
Modeling & Simulation Lecture NotesModeling & Simulation Lecture Notes
Modeling & Simulation Lecture Notes
FellowBuddy.com
 
Random number generation
Random number generationRandom number generation
Random number generation
De La Salle University-Manila
 
Applied numerical methods lec3
Applied numerical methods lec3Applied numerical methods lec3
Applied numerical methods lec3
Yasser Ahmed
 
C1. probability distribution
C1. probability distributionC1. probability distribution
C1. probability distributionAnkita Darji
 
ch09-Simulation.ppt
ch09-Simulation.pptch09-Simulation.ppt
ch09-Simulation.ppt
LuckySaigon1
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
Ganesh Solanke
 
cs 601 - lecture 1.pptx
cs 601 - lecture 1.pptxcs 601 - lecture 1.pptx
cs 601 - lecture 1.pptx
GopalPatidar13
 
Module 1 sp
Module 1 spModule 1 sp
Module 1 sp
Vijaya79
 
Parameter Estimation for Semiparametric Models with CMARS and Its Applications
Parameter Estimation for Semiparametric Models with CMARS and Its ApplicationsParameter Estimation for Semiparametric Models with CMARS and Its Applications
Parameter Estimation for Semiparametric Models with CMARS and Its Applications
SSA KPI
 

Similar to MT6702 Unit 2 Random Number Generation (20)

Unit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generationUnit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generation
 
Ppt
PptPpt
Ppt
 
Pseudo Random Number
Pseudo Random NumberPseudo Random Number
Pseudo Random Number
 
Random number generation
Random number generationRandom number generation
Random number generation
 
Data Structures - Lecture 1 [introduction]
Data Structures - Lecture 1 [introduction]Data Structures - Lecture 1 [introduction]
Data Structures - Lecture 1 [introduction]
 
PhysicsSIG2008-01-Seneviratne
PhysicsSIG2008-01-SeneviratnePhysicsSIG2008-01-Seneviratne
PhysicsSIG2008-01-Seneviratne
 
AN ALTERNATIVE APPROACH FOR SELECTION OF PSEUDO RANDOM NUMBERS FOR ONLINE EXA...
AN ALTERNATIVE APPROACH FOR SELECTION OF PSEUDO RANDOM NUMBERS FOR ONLINE EXA...AN ALTERNATIVE APPROACH FOR SELECTION OF PSEUDO RANDOM NUMBERS FOR ONLINE EXA...
AN ALTERNATIVE APPROACH FOR SELECTION OF PSEUDO RANDOM NUMBERS FOR ONLINE EXA...
 
Chi square
Chi squareChi square
Chi square
 
Unit 3 – AIML.pptx
Unit 3 – AIML.pptxUnit 3 – AIML.pptx
Unit 3 – AIML.pptx
 
ORMR_Monte Carlo Method.pdf
ORMR_Monte Carlo Method.pdfORMR_Monte Carlo Method.pdf
ORMR_Monte Carlo Method.pdf
 
Testing Numbers for Randomness Chi Square test
Testing Numbers for Randomness Chi Square testTesting Numbers for Randomness Chi Square test
Testing Numbers for Randomness Chi Square test
 
Modeling & Simulation Lecture Notes
Modeling & Simulation Lecture NotesModeling & Simulation Lecture Notes
Modeling & Simulation Lecture Notes
 
Random number generation
Random number generationRandom number generation
Random number generation
 
Applied numerical methods lec3
Applied numerical methods lec3Applied numerical methods lec3
Applied numerical methods lec3
 
C1. probability distribution
C1. probability distributionC1. probability distribution
C1. probability distribution
 
ch09-Simulation.ppt
ch09-Simulation.pptch09-Simulation.ppt
ch09-Simulation.ppt
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
cs 601 - lecture 1.pptx
cs 601 - lecture 1.pptxcs 601 - lecture 1.pptx
cs 601 - lecture 1.pptx
 
Module 1 sp
Module 1 spModule 1 sp
Module 1 sp
 
Parameter Estimation for Semiparametric Models with CMARS and Its Applications
Parameter Estimation for Semiparametric Models with CMARS and Its ApplicationsParameter Estimation for Semiparametric Models with CMARS and Its Applications
Parameter Estimation for Semiparametric Models with CMARS and Its Applications
 

Recently uploaded

Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 

Recently uploaded (20)

Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 

MT6702 Unit 2 Random Number Generation

  • 2. INTRODUCTION • Random numbers are a necessary basic ingredient in the simulation of almost all discrete systems. • Most computer languages have a subroutine, object, or function that will generate a random number. • Random numbers that are used to generate event times and other random variables.
  • 3. Properties of Random Numbers • A sequence of random numbers, R1, R2... must have two important statistical properties, uniformity and independence. • Each random number Ri, is an independent sample drawn from a continuous uniform distribution between 0 and 1.
  • 4. Properties of Random Numbers • That is, the pdf is given by • The density function is shown below:
  • 5. Properties of Random Numbers • Some consequences of the uniformity and independence properties are : 1. If the interval (0, 1) is divided into n classes, or subintervals of equal length, the expected number of observations m each interval is N/n where N is the total number of observations. 2. The probability of observing a value in a particular interval is independent of the previous values drawn.
  • 6. Generation of Pseudo-Random Numbers • Pseudo means false, so false random numbers are being generated. • The goal of any generation scheme, is to produce a sequence of numbers between zero and 1 • Which simulates, or initiates, the ideal properties of uniform distribution and independence as closely as possible.
  • 7. Generation of Pseudo-Random Numbers • When generating pseudo-random numbers, certain problems or errors can occur. • These errors, or departures from ideal randomness, are all related to the properties stated previously. • Some examples include the following
  • 8. Generation of Pseudo-Random Numbers 1) The generated numbers may not be uniformly distributed. 2) The generated numbers may be discrete -valued instead continuous valued. 3) The mean of the generated numbers may be too high or too low. 4) The variance of the generated numbers may be too high or low.
  • 9. Considerations in RN routine • The routine should be fast • The routine should be portable • The routine should have a sufficiently long cycle • The random numbers should be replicable. • Random numbers should closely approximate the ideal statistical properties of uniformity and independences
  • 10. Techniques for Generating Random Numbers The linear congruential method • It widely used technique, initially proposed by Lehmer [1951] • It produces a sequence of integers, X1, X2,... Between zero and m — 1 according to the following recursive relationship: Xi+1 = (aXi + c) mod m, i = 0, 1, 2....
  • 11. The linear congruential method • If c ≠ 0then the form is called mixed congruential method. • When c = 0, the form is known as the multiplicative congruential method. • The selection of the values for a, c, m and X0 drastically affects the statistical properties and the cycle length.
  • 12. Multiplicative Congruential Method: • Most natural choice for m is one that equals to the capacity of a computer word. • m = 2b (binary machine), where b is the number of bits in the computer word. • m = 10d (decimal machine), where d is the number of digits in the computer word. Xi+1 = a Xi (mod m), where a ≥ 0 and m ≥ 0 …
  • 13. Tests For Random Numbers 1. Frequency test. Uses the Kolmogorov-Smirnov or the chi-square test to compare the distribution of the set of numbers generated to a uniform distribution. 2. Runs test. Tests the runs up and down or the runs above and below the mean by comparing the actual values to expected values. The statistic for comparison is the chi-square.
  • 14. Tests For Random Numbers 3. Autocorrelation test. Tests the correlation between numbers and compares the sample correlation to the expected correlation of zero. 4. Gap test. Counts the number of digits that appear between repetitions of a particular digit and then uses the Kolmogorov-Smirnov test to compare with the expected number of gaps.
  • 15. Tests For Random Numbers 5. Poker test. Treats numbers grouped together as a poker hand. Then the hands obtained are compared to what is expected using the chi-square test. • In testing for uniformity, the hypotheses are as follows:  H0: Ri ~ U[0,1]  H1: Ri ɫ U[0,1]
  • 16. Tests For Random Numbers • The null hypothesis, H0, reads that the numbers are distributed uniformly on the interval [0, 1]. • In testing for independence, the hypotheses are as follows  H0: Ri ~ independently  H1: Ri ɫ independently
  • 17. Frequency Tests • To validate a new generator is the test of uniformity. • Two types - Kolmogorov-Smirnov and Chi-square test. • Both measure the degree of agreement between the distribution of a sample of generated random numbers and the theoretical uniform distribution. • Both tests are on the null hypothesis of no significant difference between the sample distribution and the theoretical distribution.
  • 19. The Kolmogorov-Smirnov test • Suppose that the five numbers 0.44, 0.81, 0.14, 0.05, 0.93 were generated, and it is desired to perform a test for uniformity using the Kolmogorov-Smirnov test with a level of significance of 0.05.
  • 20. Chi-Square Test Use the chi-square test with level of significance 0.05 to test whether the data shown below are uniformly distributed. The test uses n = 10 intervals of equal length
  • 23. Run Test Based on runs up and runs down, determine whether the following sequence of 40 numbers is such that the hypothesis of independence can be rejected where a = 0.05.