Finally, a theory of random number generation

Size: px
Start display at page:

Download "Finally, a theory of random number generation"

Transcription

1 Finally, a theory of random number generation F. James, CERN, Geneva Abstract For a variety of reasons, Monte Carlo methods have become of increasing importance among mathematical methods for solving all kinds of computational problems in science and medecine. As the size and complexity of such problems increases, the quality of the random number generator becomes critical even as it becomes difficult if not impossible to verify whether a given generator is good enough for the problem at hand. All this has changed in recent years as it becomes clear that the work of Martin Lüscher provides the first operational definition of randomness in the sense required for Monte Carlo calculations, and that the generator he proposed is the first for which there is a convincing argument that it must produce random sequences in which no defect can be observed. Not surprisingly, after six years of intensive use, no departures from randomness have been found in his generator. paper presented at the Fifth Internatioal Workshop On Mathematical Methods in Scattering Theory and Biomedical Technology Corfu, Greece, October 2001 appears in the proceedings published as Scattering and Biomedical Engineering D. Fotiadis and C. Massalas (eds.) World Scientific (2002) 1

2 1 Introduction. Pseudorandom Numbers The random numbers discussed here are technically referred to as pseudorandom, meaning that they are not really random in the sense of being unpredictable and unrepeatable, but they should appear in every way to be really random and are unpredictable to someone who does not know the algorithm used to generate them. Random numbers of this sort are of the greatest (and still increasing) importance in many areas of computing, particularly in scientific applications involving largescale calculations. The importance of the methods making use of random numbers is partly due to the discovery in the early days of computing that a very simple and fast numerical algorithm could produce long sequences of numbers suitable for calculations which soon became known as Monte Carlo, in honour of the famous gambling casino located there. 2 Traditional Random Number Generators There is a large body of knowledge concerning pseudorandom number generators built up over more than fifty years. The time-honoured procedure for making a new improved RNG usually goes as follows: 1. Choose an algorithm based on a simple arithmetic operation known from experience to work reasonably well. 2. Adjust available constants to give the longest possible period and to avoid or minimize all known defects. 3. If necessary apply additional tricks such as shuffling or combining two algorithms. 4. Do extensive testing of the sequences to demonstrate that the resulting algorithm is good. Some years later, even the best RNGs produced according to this method are invariably found to fail some stringent test or give the wrong answer in some calculation. Nowhere in the above is there any credible reason why the algorithm should produce random or even random-looking numbers. It is in fact amazing that the usual operations like integer multiply and modulo a large integer, which are perfectly repeatable and predictable, should produce random-looking output. The difficulty in understanding this random behaviour is often attributed to the fact that it is hard even to define what one means by random. In particular, one common definition is based on algorithmic complexity. Essentially, it says that the randomness of a sequence is related to the length of the 2

3 shortest algorithm that could generate the sequence. This is intuitively easy to understand for the limiting cases: a very random sequence could not be generated by any algorithm except the sequence itself, which is the longest possible algorithm; and a very bad sequence (like all zeros) can be generated by a very short algorithm. However, this definition is not very helpful for evaluating the quality of a particular RNG, and it is relatively easy to produce examples where increasing the complexity of the algorithm decreases the quality of the generator. Similarly, definitions based on passing statistical tests are unusable because the number of possible tests is uncountably infinite. 3 Classical mechanical systems A radically different approach has been attempted in recent years, based on dynamical systems with strongly stochastic properties. Perhaps because it is so different, this work seems to have been largely ignored by the traditional random number community. Classical dynamical systems can be divided into two categories, those that conserve energy (Hamiltonian systems) and those that do not (dissipative). The behaviour of dissipative systems on long timescales has been the subject of considerable interest in recent years because they often show chaotic properties and unusual behaviour associated with attractors (especially strange attractors) which are closed or restricted orbits within the total available space of motion. However, dissipative systems, although they can be chaotic, are not good candidates for modeling random numbers because they do not fill up the whole available space (do not generate all possible sets of numbers). Hamiltonian systems turn out to be the interesting systems for our purposes. Traditionally, at least in Western countries, interest in Hamiltonian systems has been concentrated on those for which the Hamiltonian is separable and integrable, that is, exactly soluble. Fortunately, however, the Russian school of mathematicians and physicists has been interested in the properties of systems which cannot be solved exactly. It has long been known, for instance that a system as simple as the double pendulum is not soluble and indeed behaves very unpredictably. Largely through the work of Kolmogorov and Arnold, a whole theory was developed, establishing a hierarchy of chaotic behaviour of such systems. At the bottom of the hierarchy, just above the soluble (completely predictable) systems, come the ergodic systems which sweep out the entire space available to them, but not necessarily in a random way, where this randomness has a very precise meaning indicated below. At the top of the randomness hierarchy are systems called C-systems and K-systems. Most importantly, it was shown that this hierarchy is real: Every system at a given level in the hierarchy possesses all the properties of all the lower levels, but fails to possess at least one property of all the higher levels. And it is possible to find at least one system at every level (of which there are an infinite number). 3

4 4 Kolmogorov K-systems K-systems are a class of continuous (classical) Hamiltonian systems whose important property for our purposes is the mixing property. Let x i and x j represent the state of the dynamical system at two times i and j. Let {A 1 } and {A 2 } be any two subspaces of the entire allowed space of points x, with measures (volumes relative to the total allowed volume) respectively A 1 and A 2. Then the dynamical system is said to be a 2-system if P (x i {A 1 } and x j {A 2 }) = A 1 A 2 for all i and j sufficiently far apart, and for all subspaces {A}. Similarly, a 3-system has the same property for three points and three subvolumes, etc. A K-system has the same property for an arbitrarily large number of points and subvolumes. This property for K-systems, called K-mixing or strong mixing, is easily seen to be nothing other than statistical independence, which is exactly what we mean by randomness. Each point is (asymptotically) independent of all the other points in the sense that the probability of finding it in any volume is independent of all the other states it has been in. 5 Random Number Generators based on K-systems 5.1 MIXMAX G. Savvidy and his co-workers in Armenia may have been the first to recognize the possibility of generating demonstrably random numbers using K-systems. Unfortunately, their generator MIXMAX, based on matrix multiplication, is slow and clumsy to use and never attracted much attention. Some of their work is published in J. Comp. Phys. 97 (1991) 566 and 97(1991) 573. Further papers appear only in conference proceedings and internal reports. 5.2 Other chaotic maps Several other random number generators have been proposed based on different dynamical systems known to have strong chaotic or stochastic properties. The most popular systems are the logistic map and Arnold s cat map. These generators suffer from the same kind of problems as MIXMAX. Often the period is not even known. In addition, they may yield non-uniform random numbers which must be transformed back into a uniform distribution. 4

5 5.3 RANLUX Contrary to the way the above generators were conceived, Martin Lüscher started with an existing random number generator RCARRY with very good practical properties (fast, uniform, convenient, known long period, etc.) and demonstrated that it had the properties of a K-system and showed how to make it into a high-quality RNG. 6 Is RANLUX a K-system? The reasons why RANLUX is expected to produce very high quality random numbers are well explained in the original paper of Lüscher [Comp. Phys. Comm. 79(1994) 100]. His paper should be consulted for the details; only a rough outline of the key points is given here. The theory of C-systems and K-systems is given in Arnold and Avez, Ergodic Problems of Classical Mechanics, Addison-Wesley, The RCARRY algorithm RANLUX is based on RCARRY, the generator proposed by Marsaglia and Zaman. RCARRY has a period of the order of , is quite fast for a long-period generator, and was at first believed to have good statistical properties, but by the time Lüscher developed the RANLUX algorithm it was already known to fail some tests. The basic algorithm works on an array of 24 numbers, each of which is a floating-point number between zero and one, with a 24-bit mantissa (IEEE single-precision format). It can also work with an array of 24-bit integers which yield exactly the same output. The choice between floating-point and integer array depends on which is faster on the particular processor and does not have any effect on the actual numbers produced. Lüscher had the idea to consider RCARRY as a 24-dimensional discrete dynamical system, and study the properties of the corresponding continuous system. He gives convincing arguments why one can neglect the carry bit for the purpose of studying the dynamical system, and shows that the linear transformation defining the system dynamics can be represented as a matrix composed of elements all of which are either zero or ±1 and having the following properties: The determinant is one (area-conserving). All eigenvalues are complex and distinct. No eigenvalue has modulus one (hyperbolic map). There are four eigenvalues with maximal absolute value = One can conclude from the above that the continuous system is a C-system and therefore a K-system. The Kolmogorov entropy is positive and the Lyapunov exponent is

6 Note however, that all the above is true of RCARRY, the RNG proposed by Marsaglia and Zaman, which was already known (as pointed out in Phys. Rev. Lett. by Ferrenberg et. al.) to have defects. It is therefore not sufficient to identify the dynamical system as the discrete approximation to a continuous K-system. 6.2 Short-term correlations: The Lyapunov exponent The mixing property is only an asymptotic property, and the rate at which the mixing sets in is given by the Kolmogorov entropy. A system with positive Kolmogorov entropy loses information about its past exponentially fast. From Arnold and Avez, p. 43, we have that the entropy = i ν i, where the sum runs over the (positive) exponents of divergence, ν i = ln( λ i ), and λ i are the eigenvalues of the transformation matrix with modulus greater than 1. The Lyapunov exponent determines the rate of divergence of nearby trajectories in state space, and the non-randomness of RCARRY can be viewed as due to the Lyapunov exponent being too small. This can be seen graphically in a very striking way, by plotting the average separation as a function of time, of trajectories that start with minimum separation in the 24-dimensional state space (Fig.1 of Lüscher s paper). From this one sees that after generating a first set of 24 random numbers, one has to wait about sixteen iterations before the next set of 24 numbers is completely independent of the starting configuration. The proposed new generator therefore consists of generating 24 numbers with RCARRY, and throwing away the next = 365 numbers before accepting 24 more, etc. The number 389 is chosen because it is prime and this turns out to preserve the period of the generator in spite of wasting most of the numbers. This highest luxury level with P = 389 is guaranteed to give random numbers with no detectable defects. RANLUX also offers the option of choosing smaller values of P which result in a faster generator of lower quality. For example at P = 223 no defects have yet been detected, but the theory indicates that it could happen under sufficiently stringent conditions. 6.3 Long-term correlations: The period Unlike true continuous K-systems, which cannot have any long-term correlations, RCARRY and RANLUX are only discrete approximations to continuous K-systems. They therefore have a finite period and describe closed orbits in the 24-dimensional state space. Thus, like all RNG s with a finite period, they consume their state space as they progress through it, creating a forbidden zone they cannot re-enter, which violates the definition of K-mixing and introduces defects which grow as the algorithm generates more numbers. It is easy to estimate the size of the resulting correlations. Given that a million years is less than µsec, one can estimate that the total number of random numbers that will be generated on the earth in the next million years will not exceed 6

7 If all these were generated by RANLUX, it would not consume more than of its period. Long-term correlations should therefore exist, but at a level more than one hundred orders of magnitude too small to be detected. Another important point concerns the relation between the discrete trajectories and the full state space. Every discrete trajectory fills (almost) 1/48th of the full (discrete) space of states and thus is essentially ergodic. In the continuum system only almost every trajectory is guaranteed to fill the space; in this sense the discrete trajectories represent the typical case. 7 Testing RANLUX Of course it is important to test the random numbers produced by RANLUX. However, this testing is fundamentally different from the testing of traditional RNG s. Traditional RNG s must be tested because, apart from the testing, there is no reason to believe they are at all random. Indeed, it always turns out that even after extensive testing, defects are eventually found, and sometimes understood. Experience shows that testing is necessary but not sufficient. RANLUX, on the other hand, has a good underlying theory, so the purpose of testing is to make sure that the theory has been understood, applied and programmed correctly. Testing is not necessary to prove the randomness of the algorithm. 7.1 The spectral test It was known already by the time of Lüscher s paper that RCARRY is closely related to a linear congruential generator of enormous modulus and multiplier. It is therefore possible to apply the powerful spectral test to establish its underlying lattice structure. Since this is a full-period test, it is in some sense not very relevant for a generator for which it is physically impossible to generate the full period, but it is nevertheless good to know the lattice structure in low dimensions. While RCARRY fails this test badly, discarding improves the lattice structure exactly as one would expect from the Lyapunov exponent and the exponential divergence of nearby trajectories. 8 Related work It is interesting to consider the possible relation between RANLUX and other proposed generators besides RCARRY. The existing random number literature makes very little reference to Lüscher s work. One notable exception is Donald Knuth s Art of Computer Programming, of which volume two is devoted mostly to pseudorandom number generation. The latest edition of this classic makes several references 7

8 to Lüscher s work, and even makes the rather strong statement (in italics in the original!): This method has modest theoretical support and no known defects. However, upon closer inspection one notices that Knuth refers only to one aspect of Lüscher s theory (the discarding) and makes no mention of K-systems or Kolmogorov entropy or even Lyapunov exponents. He gives the impression that discarding is another trick, like shuffling, and can be used to improve any generator. He fails to mention, for example, that in the case of RANLUX, one can calculate exactly how many random numbers must be rejected in order to eliminate all detectable correlations. An important question is whether the theory of K-systems can explain why other generators work, and why they often don t work very well. To my knowledge, RCARRY is the only algorithm studied extensively from this angle, but it is likely that similar reasoning can be applied to other existing generators to explain their good and bad properties and to indicate whether they can be improved. In particular, ordinary Fibonacci generators that operate in the space of real numbers can immediately be mapped to dynamical systems. In all these cases the discrete trajectory only fills a very small part of the full space of discrete states, i.e. there are zillions of disjoint trajectories, an indication that one could expect long-term correlations. Bit-shuffling algorithms, such as the Mersenne Twistor are, on the other hand, not obviously related to an underlying continuous dynamical system. This kind of analysis could lead to finding better algorithms (for example, K- systems with bigger Lyapunov exponents requiring less discarding). To conclude, there is no doubt that reasoning based on dynamical systems gives the best understanding we currently have of why certain RNG s work. This does not exclude the possible existence of other theories that could shed more light on this question in the future, but it makes arguments for randomness based on testing look very weak. 8

A Repetition Test for Pseudo-Random Number Generators

A Repetition Test for Pseudo-Random Number Generators Monte Carlo Methods and Appl., Vol. 12, No. 5-6, pp. 385 393 (2006) c VSP 2006 A Repetition Test for Pseudo-Random Number Generators Manuel Gil, Gaston H. Gonnet, Wesley P. Petersen SAM, Mathematik, ETHZ,

More information

Cryptographic Pseudo-random Numbers in Simulation

Cryptographic Pseudo-random Numbers in Simulation Cryptographic Pseudo-random Numbers in Simulation Nick Maclaren University of Cambridge Computer Laboratory Pembroke Street, Cambridge CB2 3QG. A fruitful source of confusion on the Internet is that both

More information

PHY411 Lecture notes Part 5

PHY411 Lecture notes Part 5 PHY411 Lecture notes Part 5 Alice Quillen January 27, 2016 Contents 0.1 Introduction.................................... 1 1 Symbolic Dynamics 2 1.1 The Shift map.................................. 3 1.2

More information

Random numbers and generators

Random numbers and generators Chapter 2 Random numbers and generators Random numbers can be generated experimentally, like throwing dice or from radioactive decay measurements. In numerical calculations one needs, however, huge set

More information

THE GOLDEN MEAN SHIFT IS THE SET OF 3x + 1 ITINERARIES

THE GOLDEN MEAN SHIFT IS THE SET OF 3x + 1 ITINERARIES THE GOLDEN MEAN SHIFT IS THE SET OF 3x + 1 ITINERARIES DAN-ADRIAN GERMAN Department of Computer Science, Indiana University, 150 S Woodlawn Ave, Bloomington, IN 47405-7104, USA E-mail: dgerman@csindianaedu

More information

Numerical methods for lattice field theory

Numerical methods for lattice field theory Numerical methods for lattice field theory Mike Peardon Trinity College Dublin August 9, 2007 Mike Peardon (Trinity College Dublin) Numerical methods for lattice field theory August 9, 2007 1 / 37 Numerical

More information

Chaos and Liapunov exponents

Chaos and Liapunov exponents PHYS347 INTRODUCTION TO NONLINEAR PHYSICS - 2/22 Chaos and Liapunov exponents Definition of chaos In the lectures we followed Strogatz and defined chaos as aperiodic long-term behaviour in a deterministic

More information

Physics 509: Bootstrap and Robust Parameter Estimation

Physics 509: Bootstrap and Robust Parameter Estimation Physics 509: Bootstrap and Robust Parameter Estimation Scott Oser Lecture #20 Physics 509 1 Nonparametric parameter estimation Question: what error estimate should you assign to the slope and intercept

More information

What Every Programmer Should Know About Floating-Point Arithmetic DRAFT. Last updated: November 3, Abstract

What Every Programmer Should Know About Floating-Point Arithmetic DRAFT. Last updated: November 3, Abstract What Every Programmer Should Know About Floating-Point Arithmetic Last updated: November 3, 2014 Abstract The article provides simple answers to the common recurring questions of novice programmers about

More information

Chaotic motion. Phys 750 Lecture 9

Chaotic motion. Phys 750 Lecture 9 Chaotic motion Phys 750 Lecture 9 Finite-difference equations Finite difference equation approximates a differential equation as an iterative map (x n+1,v n+1 )=M[(x n,v n )] Evolution from time t =0to

More information

MIXMAX Random Number Generator Implementation into ROOT and GEANT4 Anosov-Kolmogorov C-systems

MIXMAX Random Number Generator Implementation into ROOT and GEANT4 Anosov-Kolmogorov C-systems MIXMAX Random Number Generator Implementation into ROOT and GEANT4 Anosov-Kolmogorov C-systems George Savvidy Institute of Nuclear and Particle Physics Demokritos National Research Center Athens, Greece

More information

Random processes and probability distributions. Phys 420/580 Lecture 20

Random processes and probability distributions. Phys 420/580 Lecture 20 Random processes and probability distributions Phys 420/580 Lecture 20 Random processes Many physical processes are random in character: e.g., nuclear decay (Poisson distributed event count) P (k, τ) =

More information

Dynamical Systems and Chaos Part I: Theoretical Techniques. Lecture 4: Discrete systems + Chaos. Ilya Potapov Mathematics Department, TUT Room TD325

Dynamical Systems and Chaos Part I: Theoretical Techniques. Lecture 4: Discrete systems + Chaos. Ilya Potapov Mathematics Department, TUT Room TD325 Dynamical Systems and Chaos Part I: Theoretical Techniques Lecture 4: Discrete systems + Chaos Ilya Potapov Mathematics Department, TUT Room TD325 Discrete maps x n+1 = f(x n ) Discrete time steps. x 0

More information

Introduction to Dynamical Systems Basic Concepts of Dynamics

Introduction to Dynamical Systems Basic Concepts of Dynamics Introduction to Dynamical Systems Basic Concepts of Dynamics A dynamical system: Has a notion of state, which contains all the information upon which the dynamical system acts. A simple set of deterministic

More information

Workshop on Heterogeneous Computing, 16-20, July No Monte Carlo is safe Monte Carlo - more so parallel Monte Carlo

Workshop on Heterogeneous Computing, 16-20, July No Monte Carlo is safe Monte Carlo - more so parallel Monte Carlo Workshop on Heterogeneous Computing, 16-20, July 2012 No Monte Carlo is safe Monte Carlo - more so parallel Monte Carlo K. P. N. Murthy School of Physics, University of Hyderabad July 19, 2012 K P N Murthy

More information

Random Number Generators - a brief assessment of those available

Random Number Generators - a brief assessment of those available Random Number Generators - a brief assessment of those available Anna Mills March 30, 2003 1 Introduction Nothing in nature is random...a thing appears random only through the incompleteness of our knowledge.

More information

MAT335H1F Lec0101 Burbulla

MAT335H1F Lec0101 Burbulla Fall 2011 Q 2 (x) = x 2 2 Q 2 has two repelling fixed points, p = 1 and p + = 2. Moreover, if I = [ p +, p + ] = [ 2, 2], it is easy to check that p I and Q 2 : I I. So for any seed x 0 I, the orbit of

More information

Uniform Random Number Generators

Uniform Random Number Generators JHU 553.633/433: Monte Carlo Methods J. C. Spall 25 September 2017 CHAPTER 2 RANDOM NUMBER GENERATION Motivation and criteria for generators Linear generators (e.g., linear congruential generators) Multiple

More information

Algorithms and Networking for Computer Games

Algorithms and Networking for Computer Games Algorithms and Networking for Computer Games Chapter 2: Random Numbers http://www.wiley.com/go/smed What are random numbers good for (according to D.E. Knuth) simulation sampling numerical analysis computer

More information

Uniform and Exponential Random Floating Point Number Generation

Uniform and Exponential Random Floating Point Number Generation Uniform and Exponential Random Floating Point Number Generation Thomas Morgenstern Hochschule Harz, Friedrichstr. 57-59, D-38855 Wernigerode tmorgenstern@hs-harz.de Summary. Pseudo random number generators

More information

Chaotic motion. Phys 420/580 Lecture 10

Chaotic motion. Phys 420/580 Lecture 10 Chaotic motion Phys 420/580 Lecture 10 Finite-difference equations Finite difference equation approximates a differential equation as an iterative map (x n+1,v n+1 )=M[(x n,v n )] Evolution from time t

More information

One dimensional Maps

One dimensional Maps Chapter 4 One dimensional Maps The ordinary differential equation studied in chapters 1-3 provide a close link to actual physical systems it is easy to believe these equations provide at least an approximate

More information

Introduction. An Introduction to Algorithms and Data Structures

Introduction. An Introduction to Algorithms and Data Structures Introduction An Introduction to Algorithms and Data Structures Overview Aims This course is an introduction to the design, analysis and wide variety of algorithms (a topic often called Algorithmics ).

More information

8.3.2 The finite size scaling method

8.3.2 The finite size scaling method 232 Chapter 8: Analysing Monte Carlo data In general we don t know this value, which makes it difficult to perform the fit. It is possible to guess T c and then vary the guess to make the line in Figure

More information

Sum-discrepancy test on pseudorandom number generators

Sum-discrepancy test on pseudorandom number generators Sum-discrepancy test on pseudorandom number generators Makoto Matsumoto a,, Takuji Nishimura b a Faculty of Science, Hiroshima University, Hiroshima 739-8526, JAPAN b Faculty of Science, Yamagata University,

More information

4.5 Applications of Congruences

4.5 Applications of Congruences 4.5 Applications of Congruences 287 66. Find all solutions of the congruence x 2 16 (mod 105). [Hint: Find the solutions of this congruence modulo 3, modulo 5, and modulo 7, and then use the Chinese remainder

More information

COLLATZ CONJECTURE: IS IT FALSE?

COLLATZ CONJECTURE: IS IT FALSE? COLLATZ CONJECTURE: IS IT FALSE? JUAN A. PEREZ arxiv:1708.04615v2 [math.gm] 29 Aug 2017 ABSTRACT. For a long time, Collatz Conjecture has been assumed to be true, although a formal proof has eluded all

More information

A Method for Reducing Ill-Conditioning of Polynomial Root Finding Using a Change of Basis

A Method for Reducing Ill-Conditioning of Polynomial Root Finding Using a Change of Basis Portland State University PDXScholar University Honors Theses University Honors College 2014 A Method for Reducing Ill-Conditioning of Polynomial Root Finding Using a Change of Basis Edison Tsai Portland

More information

Are numerical studies of long term dynamics conclusive: the case of the Hénon map

Are numerical studies of long term dynamics conclusive: the case of the Hénon map Journal of Physics: Conference Series PAPER OPEN ACCESS Are numerical studies of long term dynamics conclusive: the case of the Hénon map To cite this article: Zbigniew Galias 2016 J. Phys.: Conf. Ser.

More information

Topics in Computer Mathematics

Topics in Computer Mathematics Random Number Generation (Uniform random numbers) Introduction We frequently need some way to generate numbers that are random (by some criteria), especially in computer science. Simulations of natural

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 10 February 19, 2013 CPSC 467b, Lecture 10 1/45 Primality Tests Strong primality tests Weak tests of compositeness Reformulation

More information

Lecture for Week 2 (Secs. 1.3 and ) Functions and Limits

Lecture for Week 2 (Secs. 1.3 and ) Functions and Limits Lecture for Week 2 (Secs. 1.3 and 2.2 2.3) Functions and Limits 1 First let s review what a function is. (See Sec. 1 of Review and Preview.) The best way to think of a function is as an imaginary machine,

More information

MATH 521, WEEK 2: Rational and Real Numbers, Ordered Sets, Countable Sets

MATH 521, WEEK 2: Rational and Real Numbers, Ordered Sets, Countable Sets MATH 521, WEEK 2: Rational and Real Numbers, Ordered Sets, Countable Sets 1 Rational and Real Numbers Recall that a number is rational if it can be written in the form a/b where a, b Z and b 0, and a number

More information

Primality Testing SURFACE. Syracuse University. Per Brinch Hansen Syracuse University, School of Computer and Information Science,

Primality Testing SURFACE. Syracuse University. Per Brinch Hansen Syracuse University, School of Computer and Information Science, Syracuse University SURFACE Electrical Engineering and Computer Science Technical Reports College of Engineering and Computer Science 6-1992 Primality Testing Per Brinch Hansen Syracuse University, School

More information

Computational project: Modelling a simple quadrupole mass spectrometer

Computational project: Modelling a simple quadrupole mass spectrometer Computational project: Modelling a simple quadrupole mass spectrometer Martin Duy Tat a, Anders Hagen Jarmund a a Norges Teknisk-Naturvitenskapelige Universitet, Trondheim, Norway. Abstract In this project

More information

Random Number Generation. Stephen Booth David Henty

Random Number Generation. Stephen Booth David Henty Random Number Generation Stephen Booth David Henty Introduction Random numbers are frequently used in many types of computer simulation Frequently as part of a sampling process: Generate a representative

More information

OBTAINING SQUARES FROM THE PRODUCTS OF NON-SQUARE INTEGERS

OBTAINING SQUARES FROM THE PRODUCTS OF NON-SQUARE INTEGERS OBTAINING SQUARES FROM THE PRODUCTS OF NON-SQUARE INTEGERS The difference between two neighboring squares n 2 and (n+1) 2 is equal to 2n+1 for any integer n=1,2,3,. Thus the numbers generated by n 2 -A

More information

Application of Chaotic Number Generators in Econophysics

Application of Chaotic Number Generators in Econophysics 1 Application of Chaotic Number Generators in Econophysics Carmen Pellicer-Lostao 1, Ricardo López-Ruiz 2 Department of Computer Science and BIFI, Universidad de Zaragoza, 50009 - Zaragoza, Spain. e-mail

More information

2. FUNCTIONS AND ALGEBRA

2. FUNCTIONS AND ALGEBRA 2. FUNCTIONS AND ALGEBRA You might think of this chapter as an icebreaker. Functions are the primary participants in the game of calculus, so before we play the game we ought to get to know a few functions.

More information

Topic Contents. Factoring Methods. Unit 3: Factoring Methods. Finding the square root of a number

Topic Contents. Factoring Methods. Unit 3: Factoring Methods. Finding the square root of a number Topic Contents Factoring Methods Unit 3 The smallest divisor of an integer The GCD of two numbers Generating prime numbers Computing prime factors of an integer Generating pseudo random numbers Raising

More information

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

6.080 / Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

An analogy from Calculus: limits

An analogy from Calculus: limits COMP 250 Fall 2018 35 - big O Nov. 30, 2018 We have seen several algorithms in the course, and we have loosely characterized their runtimes in terms of the size n of the input. We say that the algorithm

More information

A Search for the Simplest Chaotic Partial Differential Equation

A Search for the Simplest Chaotic Partial Differential Equation A Search for the Simplest Chaotic Partial Differential Equation C. Brummitt University of Wisconsin-Madison, Department of Physics cbrummitt@wisc.edu J. C. Sprott University of Wisconsin-Madison, Department

More information

Spectral Analysis of the MIXMAX Random Number Generators

Spectral Analysis of the MIXMAX Random Number Generators Submitted to iinforms Journal on Computing manuscript (Please, provide the manuscript number!) Authors are encouraged to submit new papers to INFORMS journals by means of a style file template, which includes

More information

ONE DIMENSIONAL CHAOTIC DYNAMICAL SYSTEMS

ONE DIMENSIONAL CHAOTIC DYNAMICAL SYSTEMS Journal of Pure and Applied Mathematics: Advances and Applications Volume 0 Number 0 Pages 69-0 ONE DIMENSIONAL CHAOTIC DYNAMICAL SYSTEMS HENA RANI BISWAS Department of Mathematics University of Barisal

More information

NUMERICAL METHODS C. Carl Gustav Jacob Jacobi 10.1 GAUSSIAN ELIMINATION WITH PARTIAL PIVOTING

NUMERICAL METHODS C. Carl Gustav Jacob Jacobi 10.1 GAUSSIAN ELIMINATION WITH PARTIAL PIVOTING 0. Gaussian Elimination with Partial Pivoting 0.2 Iterative Methods for Solving Linear Systems 0.3 Power Method for Approximating Eigenvalues 0.4 Applications of Numerical Methods Carl Gustav Jacob Jacobi

More information

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010 CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010 So far our notion of realistic computation has been completely deterministic: The Turing Machine

More information

IE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N

IE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N IE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N Review of the Last Lecture Continuous Distributions Uniform distributions Exponential distributions and memoryless

More information

An Intuitive Introduction to Motivic Homotopy Theory Vladimir Voevodsky

An Intuitive Introduction to Motivic Homotopy Theory Vladimir Voevodsky What follows is Vladimir Voevodsky s snapshot of his Fields Medal work on motivic homotopy, plus a little philosophy and from my point of view the main fun of doing mathematics Voevodsky (2002). Voevodsky

More information

Review of Statistical Terminology

Review of Statistical Terminology Review of Statistical Terminology An experiment is a process whose outcome is not known with certainty. The experiment s sample space S is the set of all possible outcomes. A random variable is a function

More information

PSEUDORANDOM NUMBER GENERATORS BASED ON THE WEYL SEQUENCE

PSEUDORANDOM NUMBER GENERATORS BASED ON THE WEYL SEQUENCE COMPUTATIONAL METHODS IN SCIENCE AND TECHNOLOGY 5, 81-85 (1999) PSEUDORANDOM NUMBER GENERATORS BASED ON THE WEYL SEQUENCE K. W. WOJCIECHOWSKI Institute of Molecular Physics, Polish Academy of Sciences

More information

6.2 Brief review of fundamental concepts about chaotic systems

6.2 Brief review of fundamental concepts about chaotic systems 6.2 Brief review of fundamental concepts about chaotic systems Lorenz (1963) introduced a 3-variable model that is a prototypical example of chaos theory. These equations were derived as a simplification

More information

Fundamentals of Dynamical Systems / Discrete-Time Models. Dr. Dylan McNamara people.uncw.edu/ mcnamarad

Fundamentals of Dynamical Systems / Discrete-Time Models. Dr. Dylan McNamara people.uncw.edu/ mcnamarad Fundamentals of Dynamical Systems / Discrete-Time Models Dr. Dylan McNamara people.uncw.edu/ mcnamarad Dynamical systems theory Considers how systems autonomously change along time Ranges from Newtonian

More information

HYPERBOLIC DYNAMICAL SYSTEMS AND THE NONCOMMUTATIVE INTEGRATION THEORY OF CONNES ABSTRACT

HYPERBOLIC DYNAMICAL SYSTEMS AND THE NONCOMMUTATIVE INTEGRATION THEORY OF CONNES ABSTRACT HYPERBOLIC DYNAMICAL SYSTEMS AND THE NONCOMMUTATIVE INTEGRATION THEORY OF CONNES Jan Segert ABSTRACT We examine hyperbolic differentiable dynamical systems in the context of Connes noncommutative integration

More information

THREE DIMENSIONAL SYSTEMS. Lecture 6: The Lorenz Equations

THREE DIMENSIONAL SYSTEMS. Lecture 6: The Lorenz Equations THREE DIMENSIONAL SYSTEMS Lecture 6: The Lorenz Equations 6. The Lorenz (1963) Equations The Lorenz equations were originally derived by Saltzman (1962) as a minimalist model of thermal convection in a

More information

2 P. L'Ecuyer and R. Simard otherwise perform well in the spectral test, fail this independence test in a decisive way. LCGs with multipliers that hav

2 P. L'Ecuyer and R. Simard otherwise perform well in the spectral test, fail this independence test in a decisive way. LCGs with multipliers that hav Beware of Linear Congruential Generators with Multipliers of the form a = 2 q 2 r Pierre L'Ecuyer and Richard Simard Linear congruential random number generators with Mersenne prime modulus and multipliers

More information

Binary floating point

Binary floating point Binary floating point Notes for 2017-02-03 Why do we study conditioning of problems? One reason is that we may have input data contaminated by noise, resulting in a bad solution even if the intermediate

More information

CSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function

CSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function CSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function that is reasonably random in behavior, then take any

More information

8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

More information

Chaos in the Hénon-Heiles system

Chaos in the Hénon-Heiles system Chaos in the Hénon-Heiles system University of Karlstad Christian Emanuelsson Analytical Mechanics FYGC04 Abstract This paper briefly describes how the Hénon-Helies system exhibits chaos. First some subjects

More information

Global theory of one-frequency Schrödinger operators

Global theory of one-frequency Schrödinger operators of one-frequency Schrödinger operators CNRS and IMPA August 21, 2012 Regularity and chaos In the study of classical dynamical systems, the main goal is the understanding of the long time behavior of observable

More information

Lecture 35 Minimization and maximization of functions. Powell s method in multidimensions Conjugate gradient method. Annealing methods.

Lecture 35 Minimization and maximization of functions. Powell s method in multidimensions Conjugate gradient method. Annealing methods. Lecture 35 Minimization and maximization of functions Powell s method in multidimensions Conjugate gradient method. Annealing methods. We know how to minimize functions in one dimension. If we start at

More information

Uniform Random Binary Floating Point Number Generation

Uniform Random Binary Floating Point Number Generation Uniform Random Binary Floating Point Number Generation Prof. Dr. Thomas Morgenstern, Phone: ++49.3943-659-337, Fax: ++49.3943-659-399, tmorgenstern@hs-harz.de, Hochschule Harz, Friedrichstr. 57-59, 38855

More information

Parallelization of the Wolff Single-Cluster Algorithm

Parallelization of the Wolff Single-Cluster Algorithm Wilfrid Laurier University Scholars Commons @ Laurier Mathematics Faculty Publications Mathematics 2010 Parallelization of the Wolff Single-Cluster Algorithm Jevgenijs Kaupužs University of Latvia Jānis

More information

Computational Complexity

Computational Complexity p. 1/24 Computational Complexity The most sharp distinction in the theory of computation is between computable and noncomputable functions; that is, between possible and impossible. From the example of

More information

Slope Fields: Graphing Solutions Without the Solutions

Slope Fields: Graphing Solutions Without the Solutions 8 Slope Fields: Graphing Solutions Without the Solutions Up to now, our efforts have been directed mainly towards finding formulas or equations describing solutions to given differential equations. Then,

More information

Physical Tests for Random Numbers. in Simulations. P.O. Box 9 (Siltavuorenpenger 20 C) FIN{00014 University of Helsinki. Finland

Physical Tests for Random Numbers. in Simulations. P.O. Box 9 (Siltavuorenpenger 20 C) FIN{00014 University of Helsinki. Finland Physical Tests for Random Numbers in Simulations I. Vattulainen, 1;2 T. Ala{Nissila, 1;2 and K. Kankaala 2;3 1 Research Institute for Theoretical Physics P.O. Box 9 (Siltavuorenpenger 20 C) FIN{00014 University

More information

Introduction to Computer Science and Programming for Astronomers

Introduction to Computer Science and Programming for Astronomers Introduction to Computer Science and Programming for Astronomers Lecture 8. István Szapudi Institute for Astronomy University of Hawaii March 7, 2018 Outline Reminder 1 Reminder 2 3 4 Reminder We have

More information

Session-Based Queueing Systems

Session-Based Queueing Systems Session-Based Queueing Systems Modelling, Simulation, and Approximation Jeroen Horters Supervisor VU: Sandjai Bhulai Executive Summary Companies often offer services that require multiple steps on the

More information

Tutorial on Mathematical Induction

Tutorial on Mathematical Induction Tutorial on Mathematical Induction Roy Overbeek VU University Amsterdam Department of Computer Science r.overbeek@student.vu.nl April 22, 2014 1 Dominoes: from case-by-case to induction Suppose that you

More information

Thanks to: University of Illinois at Chicago NSF DMS Alfred P. Sloan Foundation

Thanks to: University of Illinois at Chicago NSF DMS Alfred P. Sloan Foundation Building circuits for integer factorization D. J. Bernstein Thanks to: University of Illinois at Chicago NSF DMS 0140542 Alfred P. Sloan Foundation I want to work for NSA as an independent contractor.

More information

Properties of Sequences

Properties of Sequences Properties of Sequences Here is a FITB proof arguing that a sequence cannot converge to two different numbers. The basic idea is to argue that if we assume this can happen, we deduce that something contradictory

More information

Basic Thermodynamics. Prof. S. K. Som. Department of Mechanical Engineering. Indian Institute of Technology, Kharagpur.

Basic Thermodynamics. Prof. S. K. Som. Department of Mechanical Engineering. Indian Institute of Technology, Kharagpur. Basic Thermodynamics Prof. S. K. Som Department of Mechanical Engineering Indian Institute of Technology, Kharagpur Lecture - 06 Second Law and its Corollaries I Good afternoon, I welcome you all to this

More information

898 IEEE TRANSACTIONS ON ROBOTICS AND AUTOMATION, VOL. 17, NO. 6, DECEMBER X/01$ IEEE

898 IEEE TRANSACTIONS ON ROBOTICS AND AUTOMATION, VOL. 17, NO. 6, DECEMBER X/01$ IEEE 898 IEEE TRANSACTIONS ON ROBOTICS AND AUTOMATION, VOL. 17, NO. 6, DECEMBER 2001 Short Papers The Chaotic Mobile Robot Yoshihiko Nakamura and Akinori Sekiguchi Abstract In this paper, we develop a method

More information

Sequential Monte Carlo methods for filtering of unobservable components of multidimensional diffusion Markov processes

Sequential Monte Carlo methods for filtering of unobservable components of multidimensional diffusion Markov processes Sequential Monte Carlo methods for filtering of unobservable components of multidimensional diffusion Markov processes Ellida M. Khazen * 13395 Coppermine Rd. Apartment 410 Herndon VA 20171 USA Abstract

More information

226 My God, He Plays Dice! Entanglement. Chapter This chapter on the web informationphilosopher.com/problems/entanglement

226 My God, He Plays Dice! Entanglement. Chapter This chapter on the web informationphilosopher.com/problems/entanglement 226 My God, He Plays Dice! Entanglement Chapter 29 20 This chapter on the web informationphilosopher.com/problems/entanglement Entanglement 227 Entanglement Entanglement is a mysterious quantum phenomenon

More information

Oscillatory Motion. Simple pendulum: linear Hooke s Law restoring force for small angular deviations. Oscillatory solution

Oscillatory Motion. Simple pendulum: linear Hooke s Law restoring force for small angular deviations. Oscillatory solution Oscillatory Motion Simple pendulum: linear Hooke s Law restoring force for small angular deviations d 2 θ dt 2 = g l θ θ l Oscillatory solution θ(t) =θ 0 sin(ωt + φ) F with characteristic angular frequency

More information

Oscillatory Motion. Simple pendulum: linear Hooke s Law restoring force for small angular deviations. small angle approximation. Oscillatory solution

Oscillatory Motion. Simple pendulum: linear Hooke s Law restoring force for small angular deviations. small angle approximation. Oscillatory solution Oscillatory Motion Simple pendulum: linear Hooke s Law restoring force for small angular deviations d 2 θ dt 2 = g l θ small angle approximation θ l Oscillatory solution θ(t) =θ 0 sin(ωt + φ) F with characteristic

More information

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST JAMES MCIVOR Today we enter Chapter 2, which is the heart of this subject. Before starting, recall that last time we saw the integers have unique factorization

More information

Random number generators

Random number generators s generators Comp Sci 1570 Introduction to Outline s 1 2 s generator s The of a sequence of s or symbols that cannot be reasonably predicted better than by a random chance, usually through a random- generator

More information

Tae-Soo Kim and Young-Kyun Yang

Tae-Soo Kim and Young-Kyun Yang Kangweon-Kyungki Math. Jour. 14 (2006), No. 1, pp. 85 93 ON THE INITIAL SEED OF THE RANDOM NUMBER GENERATORS Tae-Soo Kim and Young-Kyun Yang Abstract. A good arithmetic random number generator should possess

More information

1 Computational problems

1 Computational problems 80240233: Computational Complexity Lecture 1 ITCS, Tsinghua Univesity, Fall 2007 9 October 2007 Instructor: Andrej Bogdanov Notes by: Andrej Bogdanov The aim of computational complexity theory is to study

More information

Pseudo-Random Numbers Generators. Anne GILLE-GENEST. March 1, Premia Introduction Definitions Good generators...

Pseudo-Random Numbers Generators. Anne GILLE-GENEST. March 1, Premia Introduction Definitions Good generators... 14 pages 1 Pseudo-Random Numbers Generators Anne GILLE-GENEST March 1, 2012 Contents Premia 14 1 Introduction 2 1.1 Definitions............................. 2 1.2 Good generators..........................

More information

Lecture 7: More Arithmetic and Fun With Primes

Lecture 7: More Arithmetic and Fun With Primes IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 7: More Arithmetic and Fun With Primes David Mix Barrington and Alexis Maciel July

More information

Turing Machines, diagonalization, the halting problem, reducibility

Turing Machines, diagonalization, the halting problem, reducibility Notes on Computer Theory Last updated: September, 015 Turing Machines, diagonalization, the halting problem, reducibility 1 Turing Machines A Turing machine is a state machine, similar to the ones we have

More information

Any live cell with less than 2 live neighbours dies. Any live cell with 2 or 3 live neighbours lives on to the next step.

Any live cell with less than 2 live neighbours dies. Any live cell with 2 or 3 live neighbours lives on to the next step. 2. Cellular automata, and the SIRS model In this Section we consider an important set of models used in computer simulations, which are called cellular automata (these are very similar to the so-called

More information

2008 Winton. Review of Statistical Terminology

2008 Winton. Review of Statistical Terminology 1 Review of Statistical Terminology 2 Formal Terminology An experiment is a process whose outcome is not known with certainty The experiment s sample space S is the set of all possible outcomes. A random

More information

Errors. Intensive Computation. Annalisa Massini 2017/2018

Errors. Intensive Computation. Annalisa Massini 2017/2018 Errors Intensive Computation Annalisa Massini 2017/2018 Intensive Computation - 2017/2018 2 References Scientific Computing: An Introductory Survey - Chapter 1 M.T. Heath http://heath.cs.illinois.edu/scicomp/notes/index.html

More information

6 Cosets & Factor Groups

6 Cosets & Factor Groups 6 Cosets & Factor Groups The course becomes markedly more abstract at this point. Our primary goal is to break apart a group into subsets such that the set of subsets inherits a natural group structure.

More information

Population Dynamics II

Population Dynamics II Population Dynamics II In this class, we shall analyze behavioral patterns of ecosystems, in which more than two species interact with each other. Such systems frequently exhibit chaotic behavior. Chaotic

More information

14 Random Variables and Simulation

14 Random Variables and Simulation 14 Random Variables and Simulation In this lecture note we consider the relationship between random variables and simulation models. Random variables play two important roles in simulation models. We assume

More information

Random numbers and random number generators

Random numbers and random number generators Random numbers and random number generators It was a very popular deterministic philosophy some 300 years ago that if we know initial conditions and solve Eqs. of motion then the future is predictable.

More information

The Growth of Functions. A Practical Introduction with as Little Theory as possible

The Growth of Functions. A Practical Introduction with as Little Theory as possible The Growth of Functions A Practical Introduction with as Little Theory as possible Complexity of Algorithms (1) Before we talk about the growth of functions and the concept of order, let s discuss why

More information

Numerical Analysis Lecture Notes

Numerical Analysis Lecture Notes Numerical Analysis Lecture Notes Peter J Olver 8 Numerical Computation of Eigenvalues In this part, we discuss some practical methods for computing eigenvalues and eigenvectors of matrices Needless to

More information

The poetry of mathematics

The poetry of mathematics The poetry of mathematics Paul Turner I read in a book by W.W. Sawyer that to be complete, a mathematician needs to be something of a poet. The author was quoting the 19 th century German mathematician

More information

Dynamics of finite linear cellular automata over Z N

Dynamics of finite linear cellular automata over Z N Dynamics of finite linear cellular automata over Z N F. Mendivil, D. Patterson September 9, 2009 Abstract We investigate the behaviour of linear cellular automata with state space Z N and only finitely

More information

Bounds for (generalised) Lyapunov exponents for deterministic and random products of shears

Bounds for (generalised) Lyapunov exponents for deterministic and random products of shears Bounds for (generalised) Lyapunov exponents for deterministic and random products of shears Rob Sturman School of Mathematics University of Leeds Applied & Computational Mathematics seminar, 15 March 2017

More information

Fast and Reliable Random Number Generators for Scientific Computing (extended abstract)

Fast and Reliable Random Number Generators for Scientific Computing (extended abstract) Fast and Reliable Random Number Generators for Scientific Computing (extended abstract) Richard P. Brent 1 Oxford University Computing Laboratory, Wolfson Building, Parks Road, Oxford OX1 3QD, UK random@rpbrent.co.uk

More information

Non-Fixed Point Renormalization Group Flow

Non-Fixed Point Renormalization Group Flow Non-Fixed Point Renormalization Group Flow Gilberto de la Peña May 9, 2013 Abstract: The renormalization group flow of most systems is characterized by attractive or repelling fixed points. Nevertheless,

More information

One-dimensional Schrödinger equation

One-dimensional Schrödinger equation Chapter 1 One-dimensional Schrödinger equation In this chapter we will start from the harmonic oscillator to introduce a general numerical methodology to solve the one-dimensional, time-independent Schrödinger

More information