Generating Random Numbers

Slides:



Advertisements
Similar presentations
High Performance Computing 1 Random Numbers. High Performance Computing 1 What is a random number generator? Most random number generators generate a.
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,
History of Random Number Generators Bob De Vivo Probability and Statistics Summer 2005.
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 generation Algorithms and Transforms to Univariate Distributions.
Stream cipher diagram + + Recall: One-time pad in Chap. 2.
The Problem With The Linpack Benchmark 1.0 Matrix Generator Jack J. Dongarra and Julien Langou International Journal of High Performance Computing Applications.
Pseudorandom Number Generators
Pseudorandom Bit Generation Artur Gadomski Piero Giammarino Henrik Goldman Massimo Giulio Caterino.
Random Number Generation
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.
15-853Page :Algorithms in the Real World Generating Random and Pseudorandom Numbers.
Pseudorandom Number Generators. Randomness and Security Many cryptographic protocols require the parties to generate random numbers. All the hashing algorithms.
Random Number Generation Pseudo-random number Generating Discrete R.V. Generating Continuous R.V.
ETM 607 – Random Number and Random Variates
Random Number Generators CISC/QCSE 810. What is random? Flip 10 coins: how many do you expect will be heads? Measure 100 people: how are their heights.
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.
The Shrinking Rule 30 Cellular Automata Pseudorandom Number Generator University of the Philippines Cebu Department of Computer Science Cmsc142, Cmsc190,
Random Number Generators Tamer ÖZ. Random Number Generators OUTLINE Randomness And Random Number Usefulness Of Random Numbers Random Number Generators.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.
CPSC 531: RN Generation1 CPSC 531:Random-Number Generation Instructor: Anirban Mahanti Office: ICT Class Location:
Chapter 7 Random-Number Generation
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
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.
Experimental Method and Data Process: “Monte Carlo Method” Presentation # 1 Nafisa Tasneem CHEP,KNU
Session 1 Stream ciphers 1.
Random Number Generator. Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence.
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.
PRNGs Pseudo-random number generation. Randomness and Cryptography Randomness and pseudo-randomness are useful in cryptography: –To generate random and.
Random Numbers RANDOM VS PSEUDO RANDOM. Truly Random numbers  From Wolfram: “A random number is a number chosen as if by chance from some specified distribution.
R ANDOM N UMBER G ENERATORS Modeling and Simulation CS
0 Simulation Modeling and Analysis: Input Analysis 7 Random Numbers Ref: Law & Kelton, Chapter 7.
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.
MONTE CARLO METHOD DISCRETE SIMULATION RANDOM NUMBER GENERATION Chapter 3 : Random Number Generation.
1.  How does the computer generate observations from various distributions specified after input analysis?  There are two main components to the generation.
Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Chapter 2 – Stream Ciphers These slides were.
Test for randomness : Chi square test
Pedro Giffuni apache.org Apache OpenOffice committer
Random Numbers All stochastic simulations need to “generate” IID U(0,1) “random numbers” Other random variates coming from other distribution can be generated.
Probabilistic Algorithms
Issues of Random Numbers and Cryptography
Why they aren't really random
3. Random Number Generator
Random Number Generators
A cryptographically secure pseudorandom number generator for Julia
Random Number Generation
Random-Number Generation
Random vs pseudo random
Chapter 7 Random Number Generation
CS 475/575 Slide set 4 M. Overstreet Old Dominion University
Chapter 7 Random-Number Generation
Properties of Random Numbers
Computing and Statistical Data Analysis Stat 3: The Monte Carlo Method
Cryptography and Network Security Chapter 7
Hashing Sections 10.2 – 10.3 Lecture 26 CS302 Data Structures
Pseudorandom number, Universal Hashing, Chaining and Linear-Probing
Computer Simulation Techniques Generating Pseudo-Random Numbers
A d-Sequence based Recursive Random Number Generator
Random Number Generation
Generating Random and Pseudorandom Numbers
Where real stuff starts
Generating Random and Pseudorandom Numbers
Crypto for CTFs.
Presentation transcript:

Generating Random Numbers a presentation by: Matthew Jobrack

What is randomness? Governed by, or involving equal chance for each item.

Two Categories There are two basic categories of methods for generating random numbers: Physical Methods (Hardware Random Number Generation) Computational Methods Humans (really bad at this)* We will now take an adventure through each of these methods, and then discover how randomness is tested!

Physical Methods The most early, primitive forms of random number generation (originally used for gambling) fell into this category. This includes methods such as dice rolling, coin flipping and other things you might still see in gambling today. These methods can be pretty random, but very slow, and can have several other problems.

Physical Methods In modern times, several physical methods have been discovered to generate random numbers, usually based on natural phenomena that are inherently unpredictable.

Physical Methods These methods include: Measuring time intervals between radioactive decays using a Geiger counter. Clock drift (minute differences in synchronized clocks) White noise on a radio

Physical Methods Hardware random number generation is safer for encryption purposes. However, in many cases it is less practical. Physical random number generators are also prone to “breaking” and becoming less random, with no obvious signs that it has done so.

Computational Methods Pseudo-Random number generators (PRNG) are algorithms designed to produce a sequence of numbers that pass tests for statistical randomness. They are programmable algorithms though, and are therefore not completely random. If you used these enough, you would begin to find periodic patterns. They approximate the properties of random numbers.

Computational Methods There are several advantages to PRNGs: They are programmable, and therefore obviously very convenient. They are reproducible. They are much faster.

Computational Methods There are many different types of PRNGs, including but not limited to: Middle Square Method Lagged Fibonacci Generators Linear Congruential Generators Mersenne Twister Linear Feedback Registers Blum Blum Shub

Middle Square Method For a generator of n-digit numbers, the period using this method can be no longer than 8n. All this method involves is squaring a number, then taking its middle digits. Ex. To generate 6-digit numbers, start with a random seed, say, 675248. Square this number to get: 455959861504. Take the middle 6 digits of this number to get the next random number: 959861. This method has several problems, one of which is that the sequence of numbers often converge to 0.

Lagged Fibonacci Generators Random numbers generated by: Where is some binary operation. m is often a power of 2, such as 232 or 264. This is to help a computer calculate faster, because if m is 2p, the computer can divide by 2p and calculate the remainder by truncating all but the rightmost 2p digits. The maximum period depends on the binary operation used, and on values of j and k. This means that arbitrarily choosing j and k may not result in a very random sequence. Using this method, a computer must also keep track of the previous k numbers in the sequence.

Linear Congruential Generators Random numbers generated recursively by: Again, choosing m to be a power of 2 is the most efficient choice, in terms of computer power. However, choosing this modulus can lead to less randomness. The period length is at most m, but whether or not the sequence achieves a period of this length is very sensitive to the choices of a and c. In particular, the period length will be m iff: c and m are relatively prime, and a-1 is divisibe by all prime factors of m a-1 is a multiple of 4 if m is a multiple of 4

Linear Congruential Generators Advantages: They are very easily (quickly) calculated The are decently random Disadvantages: Not super random In particular, there is a serial correlation between successive values. If we plot successive 3 points on a 3 dimensional plot, they will not be truly random points, and will lie on various planes. The RANDU number generator, which uses the recurrence Was used in the 60’s and 70’s, before people realized that it fails practically every random number test.

Mersenne Twister Can produce a period of 219937-1 with the correct choice of parameters. Passes almost all tests for statistical randomness. Uses a working area of only 624 words. There are no efficient algorithms with integers using a Mersenne twister. The Mersenne twister uses polynomial algebra over the two-element field. The recurrence is defined: For k=(0,1,2,..). The seed is given as x1, x2, …, xn-1.

Blum Blum Shub Method If M is the product of 2 large primes which are congruent to 3 (mod4), then this method is the recurrence: The seed should be chosen such that it is coprime to M. This PRNG is notable because each number in the sequence can be calculated directly.

Tests for Randomness Frequency test Serial test Poker test Gap test Diehard tests