Random Number Generator. Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence.

Slides:



Advertisements
Similar presentations
Mod arithmetic.
Advertisements

Generating Random Numbers
Random Number Generation Graham Netherton Logan Stelly.
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
CS 202 Epp section ?? Aaron Bloomfield
CSE115/ENGR160 Discrete Mathematics 03/15/12
Some Hashing Techniques (used to randomize the relative addresses) 1Prepared by Perla P. Cosme.
The Divisibility & Modular Arithmetic: Selected Exercises Goal: Introduce fundamental number theory concepts: The division algorithm Congruences Rules.
Random Numbers. Two Types of Random Numbers 1.True random numbers: True random numbers are generated in non- deterministic ways. They are not predictable.
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
CSE115/ENGR160 Discrete Mathematics 03/15/11
Using random numbers Simulation: accounts for uncertainty: biology (large number of individuals), physics (large number of particles, quantum mechanics),
Random Numbers Dick Steflik. Pseudo Random Numbers In most cases we do not want truly random numbers –most applications need the idea of repeatability.
Pseudorandom Number Generators
Random Number Generation
Distinguishing Features of Simulation Time (CLK)  DYNAMIC focused on this aspect during the modeling section of the course Pseudorandom variables (RND)
Probability Mass Function Expectation 郭俊利 2009/03/16
1 Random numbers Random  completely unpredictable. No way to determine in advance what value will be chosen from a set of equally probable elements. Impossible.
Compunet Corporation Programming with Visual Basic.NET Random Number Week # 12 Tariq Ibn Aziz & Kevin Jones.
CSCE Monte Carlo Methods When you can’t do the math, simulate the process with random numbers Numerical integration to get areas/volumes Particle.
Random Thoughts 2012 (COMP 066) Jan-Michael Frahm Jared Heinly.
Fall 2011 CSC 446/546 Part 6: Random Number Generation.
Random Number Generation Pseudo-random number Generating Discrete R.V. Generating Continuous R.V.
ETM 607 – Random Number and Random Variates
A SCALABLE LIBRARY FOR PSEUDORANDOM NUMBER GENERATION ALGORITHM 806: SPRNG.
Random Numbers CSE 331 Section 2 James Daly. Randomness Most algorithms we’ve talked about have been deterministic The same inputs always give the same.
One of the positive or negative numbers 1, 2, 3, etc., or zero. Compare whole numbers.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.

Chapter 7 Random-Number Generation
CS 450 – Modeling and Simulation Dr. X. Topics What Does Randomness Mean? Randomness in games Generating Random Values Random events in real life: measuring.
Module 1: Statistical Issues in Micro simulation Paul Sousa.
Basic Concepts in Number Theory Background for Random Number Generation 1.For any pair of integers n and m, m  0, there exists a unique pair of integers.
Modeling and Simulation Random Number Generators
Chapter The Integers and Division Division
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
Pseudo-random generators Random Number Generating There are three types of generators table look-up generators hardware generators algorithmic (software)
Monte Carlo Methods So far we have discussed Monte Carlo methods based on a uniform distribution of random numbers on the interval [0,1] p(x) = 1 0  x.
Introduction to Computer Programming Math Random Dice.
Write Equivalent Fractions
Chapter 10 Hashing. The search time of each algorithm depend on the number n of elements of the collection S of the data. A searching technique called.
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
Quasi-Random Number Sequences from a Long Period TLP Generator with Remarks on Application to Cryptography By Herbert S. Bright and Richard L. Enison Presented.
Number Line Sequences LESSON 4POWER UP A PAGE 26.
Arrival & Service Times for Assignment 3 Byung-Hyun Ha
CHAPTER 5 Simulation Modeling. Introduction In many situations a modeler is unable to construct an analytic (symbolic) model adequately explaining the.
Pseudo-random-number generators. Random numbers: the numbers generated by a stochastic process They are indispensible in any simulations based on radom.
The man who knew 28% of mathematics. John Von Neumann ( ) Hans Bethe: Academic seminars (10.
R ANDOM N UMBER G ENERATORS Modeling and Simulation CS
G. Cowan Lectures on Statistical Data Analysis Lecture 5 page 1 Statistical Data Analysis: Lecture 5 1Probability, Bayes’ theorem 2Random variables and.
0 Simulation Modeling and Analysis: Input Analysis 7 Random Numbers Ref: Law & Kelton, Chapter 7.
Module 9.2 Simulations. Computer simulation Having computer program imitate reality, in order to study situations and make decisions Applications?
PH24010 MathCAD Statistics, Random Numbers & Histograms.
Chapter 3 Generating Uniform Random Variables. In any kind of simulation, we need data, or we have to produce them. Especially in Monte Marco simulation.
Random Numbers All stochastic simulations need to “generate” IID U(0,1) “random numbers” Other random variates coming from other distribution can be generated.
UNIFORM RANDOM NUMBER GENERATION Chapter 7 (first half) The goal is to generate a sequence of The goal is to generate a sequence of Uniformly distributed.
1.  How does the computer generate observations from various distributions specified after input analysis?  There are two main components to the generation.
10.Deterministic Randomness 1.Random Sequences Random Sequences A sequence of numbers r 1, r 2,... is random if there are no discernible patterns.
Test for randomness : Chi square test
Random Numbers All stochastic simulations need to “generate” IID U(0,1) “random numbers” Other random variates coming from other distribution can be generated.
3. Random Number Generator
Generating Random Numbers
Write in digits eight hundred and four thousand.
Random Number Generation
Random-Number Generation
CS 475/575 Slide set 4 M. Overstreet Old Dominion University
Computing and Statistical Data Analysis Stat 3: The Monte Carlo Method
Random Number and Random Variate Generation
Computer Simulation Techniques Generating Pseudo-Random Numbers
Random Number Generation
Presentation transcript:

Random Number Generator

Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence

Midsquare Method Z0=four digit positive integer = 7182 –Z02= Z1=mid four digit of z02 = 5811 –Z12= Z2= mid four digit of Z12 = 7677 Disadvantage: if Zi=XXooooXX and Zi+1=XXooooXX then repeat

Fibonacci Method Xi=(Xi-1+Xi-2) mod m = remainder of (Xi-1+Xi-2)/m Ex: m=100, X0=1, X1=1 X2=(1+1) mod 100 = 2 X3=(2+1) mod 100 = 3 X4=(3+2) mod 100 = 5 Serial Correlation

Linear Congruential Method Z i =(aZ i-1 +C) mod m m: modulus m>0 a: multiplier a<m c: increment c<m Z 0 : seed Z 0 <m 0 ≦ Z i ≦ m-1 Let U i =Z i /m ~ U(0,1) 0 ≦ U i ≦ (m-1)/m