SlideShare ist ein Scribd-Unternehmen logo
1 von 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.

Weitere ähnliche Inhalte

Was ist angesagt?

The monte carlo method
The monte carlo methodThe monte carlo method
The monte carlo method
Saurabh Sood
 
Introduction to Simulation
Introduction to SimulationIntroduction to Simulation
Introduction to Simulation
chimco.net
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
MissAnam
 

Was ist angesagt? (20)

Unit 6 input modeling
Unit 6 input modeling Unit 6 input modeling
Unit 6 input modeling
 
The monte carlo method
The monte carlo methodThe monte carlo method
The monte carlo method
 
Simulation and Modeling
Simulation and ModelingSimulation and Modeling
Simulation and Modeling
 
Introduction to Simulation
Introduction to SimulationIntroduction to Simulation
Introduction to Simulation
 
Monte carlo
Monte carloMonte carlo
Monte carlo
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
 
Simulation-Language.pptx
Simulation-Language.pptxSimulation-Language.pptx
Simulation-Language.pptx
 
continuous and discrets systems
continuous  and discrets systemscontinuous  and discrets systems
continuous and discrets systems
 
What is pseudo random number
What is pseudo random numberWhat is pseudo random number
What is pseudo random number
 
Simulation
SimulationSimulation
Simulation
 
Rules of data mining
Rules of data miningRules of data mining
Rules of data mining
 
Discrete event-simulation
Discrete event-simulationDiscrete event-simulation
Discrete event-simulation
 
Output analysis for simulation models / Elimination of initial Bias
Output analysis for simulation models / Elimination of initial BiasOutput analysis for simulation models / Elimination of initial Bias
Output analysis for simulation models / Elimination of initial Bias
 
Associative memory network
Associative memory networkAssociative memory network
Associative memory network
 
Introduction to simulation and modeling
Introduction to simulation and modelingIntroduction to simulation and modeling
Introduction to simulation and modeling
 
System simulation & modeling notes[sjbit]
System simulation & modeling notes[sjbit]System simulation & modeling notes[sjbit]
System simulation & modeling notes[sjbit]
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
 
(언플러그드 활동/언플러그드 교육/언플러그드 컴퓨팅) Unplugged activity 활동지
(언플러그드 활동/언플러그드 교육/언플러그드 컴퓨팅) Unplugged activity 활동지(언플러그드 활동/언플러그드 교육/언플러그드 컴퓨팅) Unplugged activity 활동지
(언플러그드 활동/언플러그드 교육/언플러그드 컴퓨팅) Unplugged activity 활동지
 
Modelling simulation (1)
Modelling simulation (1)Modelling simulation (1)
Modelling simulation (1)
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
 

Andere mochten auch (12)

Simulation-Run-Statistics
Simulation-Run-StatisticsSimulation-Run-Statistics
Simulation-Run-Statistics
 
Power Point Presentation
Power Point PresentationPower Point Presentation
Power Point Presentation
 
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
 
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
 
Pseudo Random Number Generators
Pseudo Random Number GeneratorsPseudo Random Number Generators
Pseudo Random Number Generators
 
Input modeling
Input modelingInput modeling
Input modeling
 
Random variate generation
Random variate generationRandom variate generation
Random variate generation
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

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.