SlideShare una empresa de Scribd logo
1 de 22
Generate and Test Random Numbers Eng. MshariAlabdulkarim
Generate and Test Random Numbers Generate and Test Random Numbers Random Number Generation
Generate and Test Random Numbers Generate and Test Random Numbers Types of Random-number Generators: ,[object Object]
Inversive Generators.,[object Object]
In the simulation of a complex networks, where there are a huge number of users running lots of programs.,[object Object]
If Wi,1, Wi,2,..., Wi,kare independent, discrete-valued random variables, and Wi,1 is uniformly distributed between 0 and m1 – 2, then:    is also uniformly distributed between 0 and m1 – 2.
Generate and Test Random Numbers Generate and Test Random Numbers Combined Linear Congruential Generators (Cont): ,[object Object],With: The maximum possible period will be:
Generate and Test Random Numbers Generate and Test Random Numbers Example: Two generators “k = 2”, a1 = 40014, m1 = 2147483563, a2 = 40692, m2 = 2147483399. Algorithm: Choose two seeds, X1,0 from [1, 2147483562] and X2,0 from [1, 2147483398], Set j = 0. Calculate the values from the two generators:  Then calculate: After that return: Finally:                              j = j + 1, and then go back to step number 2.
Generate and Test Random Numbers Generate and Test Random Numbers Example (Cont.): Period:
Generate and Test Random Numbers Generate and Test Random Numbers InversiveCongruential Generator : ,[object Object]
 The standard formula for an inversivecongruential generator is:,[object Object]
Generate and Test Random Numbers Generate and Test Random Numbers Types of Random-number Testors: ,[object Object]
 Runs Tests.,[object Object]
Designed for continuous distributions.
Difference between the observed CDF (cumulative distribution function) Fo(x) and the expected cdf Fe(x) should be small.Observed Expected
Generate and Test Random Numbers Generate and Test Random Numbers Kolmogorov-Smirnov Test :
Generate and Test Random Numbers Generate and Test Random Numbers Example:
Generate and Test Random Numbers Generate and Test Random Numbers Example (Cont.):
Generate and Test Random Numbers Generate and Test Random Numbers Example (Cont.):
Generate and Test Random Numbers Generate and Test Random Numbers Example (Cont.):
Generate and Test Random Numbers Generate and Test Random Numbers Run Tests (Runs up and runs down): ,[object Object]
A run is defined as a succession of similar events preceded and followed by different event.

Más contenido relacionado

La actualidad más candente

The monte carlo method
The monte carlo methodThe monte carlo method
The monte carlo method
Saurabh Sood
 
Inference in Bayesian Networks
Inference in Bayesian NetworksInference in Bayesian Networks
Inference in Bayesian Networks
guestfee8698
 

La actualidad más candente (20)

Optimization problems and algorithms
Optimization problems and  algorithmsOptimization problems and  algorithms
Optimization problems and algorithms
 
Monte carlo
Monte carloMonte carlo
Monte carlo
 
The monte carlo method
The monte carlo methodThe monte carlo method
The monte carlo method
 
System Of Linear Equations
System Of Linear EquationsSystem Of Linear Equations
System Of Linear Equations
 
Unit 6 input modeling
Unit 6 input modeling Unit 6 input modeling
Unit 6 input modeling
 
MT6702 Unit 2 Random Number Generation
MT6702 Unit 2 Random Number GenerationMT6702 Unit 2 Random Number Generation
MT6702 Unit 2 Random Number Generation
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Recurrent Neural Networks
Recurrent Neural NetworksRecurrent Neural Networks
Recurrent Neural Networks
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
 
Parameter estimation
Parameter estimationParameter estimation
Parameter estimation
 
An overview of gradient descent optimization algorithms
An overview of gradient descent optimization algorithms An overview of gradient descent optimization algorithms
An overview of gradient descent optimization algorithms
 
Reporte de codigo productos medios
Reporte de codigo productos mediosReporte de codigo productos medios
Reporte de codigo productos medios
 
Monte Carlo Simulation
Monte Carlo SimulationMonte Carlo Simulation
Monte Carlo Simulation
 
Overview on Optimization algorithms in Deep Learning
Overview on Optimization algorithms in Deep LearningOverview on Optimization algorithms in Deep Learning
Overview on Optimization algorithms in Deep Learning
 
Output analysis of a single model
Output analysis of a single modelOutput analysis of a single model
Output analysis of a single model
 
Inference in Bayesian Networks
Inference in Bayesian NetworksInference in Bayesian Networks
Inference in Bayesian Networks
 
Discrete mathematics counting and logic relation
Discrete mathematics counting and logic relationDiscrete mathematics counting and logic relation
Discrete mathematics counting and logic relation
 
Bayesian network
Bayesian networkBayesian network
Bayesian network
 
Introduction to optimization Problems
Introduction to optimization ProblemsIntroduction to optimization Problems
Introduction to optimization Problems
 
4.1-4.2 Sample Spaces and Probability
4.1-4.2 Sample Spaces and Probability4.1-4.2 Sample Spaces and Probability
4.1-4.2 Sample Spaces and Probability
 

Destacado (10)

Simulation-Run-Statistics
Simulation-Run-StatisticsSimulation-Run-Statistics
Simulation-Run-Statistics
 
Power Point Presentation
Power Point PresentationPower Point Presentation
Power Point Presentation
 
Poisson distribution
Poisson distributionPoisson distribution
Poisson distribution
 
Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?Much ado about randomness. What is really a random number?
Much ado about randomness. What is really a random number?
 
Matlab Distributions
Matlab DistributionsMatlab Distributions
Matlab Distributions
 
Poisson distribution
Poisson distributionPoisson distribution
Poisson distribution
 
Pseudorandom number generators powerpoint
Pseudorandom number generators powerpointPseudorandom number generators powerpoint
Pseudorandom number generators powerpoint
 
Simulation in terminated system
Simulation in terminated system Simulation in terminated system
Simulation in terminated system
 
Input modeling
Input modelingInput modeling
Input modeling
 
Random variate generation
Random variate generationRandom variate generation
Random variate generation
 

Similar a Generate and test random numbers

Simple lin regress_inference
Simple lin regress_inferenceSimple lin regress_inference
Simple lin regress_inference
Kemal İnciroğlu
 
UNIT - I Reinforcement Learning .pptx
UNIT - I Reinforcement Learning .pptxUNIT - I Reinforcement Learning .pptx
UNIT - I Reinforcement Learning .pptx
DrUdayKiranG
 
Simulation - Generating Continuous Random Variables
Simulation - Generating Continuous Random VariablesSimulation - Generating Continuous Random Variables
Simulation - Generating Continuous Random Variables
Martin Kretzer
 
Chi-squared Goodness of Fit Test Project Overview and.docx
Chi-squared Goodness of Fit Test Project  Overview and.docxChi-squared Goodness of Fit Test Project  Overview and.docx
Chi-squared Goodness of Fit Test Project Overview and.docx
bissacr
 
Chi-squared Goodness of Fit Test Project Overview and.docx
Chi-squared Goodness of Fit Test Project  Overview and.docxChi-squared Goodness of Fit Test Project  Overview and.docx
Chi-squared Goodness of Fit Test Project Overview and.docx
mccormicknadine86
 

Similar a Generate and test random numbers (20)

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...
 
Math presentation
Math presentationMath presentation
Math presentation
 
Simple lin regress_inference
Simple lin regress_inferenceSimple lin regress_inference
Simple lin regress_inference
 
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular AutomataCost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
 
Advanced Econometrics L5-6.pptx
Advanced Econometrics L5-6.pptxAdvanced Econometrics L5-6.pptx
Advanced Econometrics L5-6.pptx
 
Or ppt,new
Or ppt,newOr ppt,new
Or ppt,new
 
UNIT - I Reinforcement Learning .pptx
UNIT - I Reinforcement Learning .pptxUNIT - I Reinforcement Learning .pptx
UNIT - I Reinforcement Learning .pptx
 
1608 probability and statistics in engineering
1608 probability and statistics in engineering1608 probability and statistics in engineering
1608 probability and statistics in engineering
 
Stats chapter 15
Stats chapter 15Stats chapter 15
Stats chapter 15
 
Monte Carlo Simulations (UC Berkeley School of Information; July 11, 2019)
Monte Carlo Simulations (UC Berkeley School of Information; July 11, 2019)Monte Carlo Simulations (UC Berkeley School of Information; July 11, 2019)
Monte Carlo Simulations (UC Berkeley School of Information; July 11, 2019)
 
Week08.pdf
Week08.pdfWeek08.pdf
Week08.pdf
 
Trust Measurement Presentation_Part 3
Trust Measurement Presentation_Part 3Trust Measurement Presentation_Part 3
Trust Measurement Presentation_Part 3
 
Simulation - Generating Continuous Random Variables
Simulation - Generating Continuous Random VariablesSimulation - Generating Continuous Random Variables
Simulation - Generating Continuous Random Variables
 
PhysicsSIG2008-01-Seneviratne
PhysicsSIG2008-01-SeneviratnePhysicsSIG2008-01-Seneviratne
PhysicsSIG2008-01-Seneviratne
 
SE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptxSE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptx
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
Chi-squared Goodness of Fit Test Project Overview and.docx
Chi-squared Goodness of Fit Test Project  Overview and.docxChi-squared Goodness of Fit Test Project  Overview and.docx
Chi-squared Goodness of Fit Test Project Overview and.docx
 
Monte Carlo Simulation lecture.pdf
Monte Carlo Simulation lecture.pdfMonte Carlo Simulation lecture.pdf
Monte Carlo Simulation lecture.pdf
 
Chi-squared Goodness of Fit Test Project Overview and.docx
Chi-squared Goodness of Fit Test Project  Overview and.docxChi-squared Goodness of Fit Test Project  Overview and.docx
Chi-squared Goodness of Fit Test Project Overview and.docx
 
Software Testing
Software TestingSoftware Testing
Software Testing
 

Más de Mshari Alabdulkarim (6)

Qo s provisioning for scalable video streaming over ad hoc networks using cro...
Qo s provisioning for scalable video streaming over ad hoc networks using cro...Qo s provisioning for scalable video streaming over ad hoc networks using cro...
Qo s provisioning for scalable video streaming over ad hoc networks using cro...
 
Ad-Hoc Networks
Ad-Hoc NetworksAd-Hoc Networks
Ad-Hoc Networks
 
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...
Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-As...
 
WPA2
WPA2WPA2
WPA2
 
Power Saving in Wireless Sensor Networks
Power Saving in Wireless Sensor NetworksPower Saving in Wireless Sensor Networks
Power Saving in Wireless Sensor Networks
 
CDMA
CDMACDMA
CDMA
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Generate and test random numbers

  • 1. Generate and Test Random Numbers Eng. MshariAlabdulkarim
  • 2. Generate and Test Random Numbers Generate and Test Random Numbers Random Number Generation
  • 3.
  • 4.
  • 5.
  • 6. If Wi,1, Wi,2,..., Wi,kare independent, discrete-valued random variables, and Wi,1 is uniformly distributed between 0 and m1 – 2, then: is also uniformly distributed between 0 and m1 – 2.
  • 7.
  • 8. Generate and Test Random Numbers Generate and Test Random Numbers Example: Two generators “k = 2”, a1 = 40014, m1 = 2147483563, a2 = 40692, m2 = 2147483399. Algorithm: Choose two seeds, X1,0 from [1, 2147483562] and X2,0 from [1, 2147483398], Set j = 0. Calculate the values from the two generators: Then calculate: After that return: Finally: j = j + 1, and then go back to step number 2.
  • 9. Generate and Test Random Numbers Generate and Test Random Numbers Example (Cont.): Period:
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. Designed for continuous distributions.
  • 15. Difference between the observed CDF (cumulative distribution function) Fo(x) and the expected cdf Fe(x) should be small.Observed Expected
  • 16. Generate and Test Random Numbers Generate and Test Random Numbers Kolmogorov-Smirnov Test :
  • 17. Generate and Test Random Numbers Generate and Test Random Numbers Example:
  • 18. Generate and Test Random Numbers Generate and Test Random Numbers Example (Cont.):
  • 19. Generate and Test Random Numbers Generate and Test Random Numbers Example (Cont.):
  • 20. Generate and Test Random Numbers Generate and Test Random Numbers Example (Cont.):
  • 21.
  • 22. A run is defined as a succession of similar events preceded and followed by different event.
  • 23. The length of the run is the number of events that occur in the run.
  • 24. There are two Concerns in a runs test:Number of runs. Length of runs.
  • 25.
  • 26. If α is the total number of runs in a truly random sequence, then:
  • 27. Mean:
  • 29. For N > 20, the distribution of “a” approximated by a normal distribution, N(ma , ).This approximation can be used to test the independence of numbers from a generator.
  • 30.
  • 31. Failure to reject the hypothesis of independence occurs when: Where α is the level of significance. Fail to reject
  • 32.
  • 33. The sequence of runs up and down is as follows:+ + + -+-+- - - + + -+- - +-+- - +- - +-+ + - - + + -+- - + + -
  • 34.
  • 35. Now, the critical value is Z0.025 = 1.96, so the independence of the numbers cannot be rejected on the basis of this test.