A Note on Random Number Generation

Total Page:16

File Type:pdf, Size:1020Kb

A Note on Random Number Generation A note on random number generation Christophe Dutang and Diethelm Wuertz September 2009 1 1 INTRODUCTION 2 \Nothing in Nature is random. number generation. By \random numbers", we a thing appears random only through mean random variates of the uniform U(0; 1) the incompleteness of our knowledge." distribution. More complex distributions can Spinoza, Ethics I1. be generated with uniform variates and rejection or inversion methods. Pseudo random number generation aims to seem random whereas quasi random number generation aims to be determin- istic but well equidistributed. 1 Introduction Those familiars with algorithms such as linear congruential generation, Mersenne-Twister type algorithms, and low discrepancy sequences should Random simulation has long been a very popular go directly to the next section. and well studied field of mathematics. There exists a wide range of applications in biology, finance, insurance, physics and many others. So 2.1 Pseudo random generation simulations of random numbers are crucial. In this note, we describe the most random number algorithms At the beginning of the nineties, there was no state-of-the-art algorithms to generate pseudo Let us recall the only things, that are truly ran- random numbers. And the article of Park & dom, are the measurement of physical phenomena Miller (1988) entitled Random generators: good such as thermal noises of semiconductor chips or ones are hard to find is a clear proof. radioactive sources2. Despite this fact, most users thought the rand The only way to simulate some randomness function they used was good, because of a short on computers are carried out by deterministic period and a term to term dependence. But algorithms. Excluding true randomness3, there in 1998, Japenese mathematicians Matsumoto are two kinds random generation: pseudo and and Nishimura invents the first algorithm whose quasi random number generators. period (219937 −1) exceeds the number of electron spin changes since the creation of the Universe The package randtoolbox provides R func- (106000 against 10120). It was a big breakthrough. tions for pseudo and quasi random number generations, as well as statistical tests to quantify As described in L'Ecuyer (1990), a (pseudo) the quality of generated random numbers. random number generator (RNG) is defined by a structure (S; µ, f; U; g) where 2 Overview of random genera- • S a finite set of states, • µ a probability distribution on S, called the tion algorithms initial distribution, • a transition function f : S 7! S, • a finite set of output symbols U, In this section, we present first the pseudo random • an output function g : S 7! U. number generation and second the quasi random 1quote taken from Niederreiter (1978). Then the generation of random numbers is as 2for more details go to http://www.random.org/ follows: randomness/. 3For true random number generation on R, use the random package of Eddelbuettel (2007). 1. generate the initial state (called the seed) s0 2 OVERVIEW OF RANDOM GENERATION ALGORITHMS 3 according to µ and compute u0 = g(s0), Finally, we generally use one of the three types 2. iterate for i = 1;::: , si = f(si−1) and ui = of output function: g(si). x • g : N 7! [0; 1[, and g(x) = m , Generally, the seed s0 is determined using the x • g : N 7!]0; 1], and g(x) = m−1 , clock machine, and so the random variates x+1=2 • g : N 7!]0; 1[, and g(x) = . u0; : : : ; un;::: seems \real" i.i.d. uniform random m variates. The period of a RNG, a key charac- teristic, is the smallest integer p 2 , such that N Linear congruential generators are implemented 8n 2 ; s = s . N p+n n in the R function congruRand. 2.1.1 Linear congruential generators 2.1.2 Multiple recursive generators There are many families of RNGs : linear congru- ential, multiple recursive,. and \computer oper- A generalisation of linear congruential generators ation" algorithms. Linear congruential generators are multiple recursive generators. They are based have a transfer function of the following type on the following recurrences f(x) = (ax + c) mod m1; xn = (a1xn−1 + ··· + akxn−kc) mod m; where a is the multiplier, c the increment and m the modulus and x; a; c; m 2 N (i.e. S is the set where k is a fixed integer. Hence the nth term of of (positive) integers). f is such that the sequence depends on the k previous one. A particular case of this type of generators is when xn = (axn−1 + c) mod m: x = (x + x ) mod 230; Typically, c and m are chosen to be relatively n n−37 n−100 prime and a such that 8x 2 ; ax mod m 6= 0. N which is a Fibonacci-lagged generator2. The The cycle length of linear congruential generators period is around 2129. This generator has will never exceed modulus m, but can maximised been invented by Knuth (2002) and is generally with the three following conditions called \Knuth-TAOCP-2002" or simply \Knuth- TAOCP"3. • increment c is relatively prime to m, • a − 1 is a multiple of every prime dividing m, An integer version of this generator is im- • a − 1 is a multiple of 4 when m is a multiple plemented in the R function runif (see RNG). of 4, We include in the package the latest double version, which corrects undesirable deficiency. As described on Knuth's webpage4 , the previous see Knuth (2002) for a proof. version of Knuth-TAOCP fails randomness test if we generate few sequences with several seeds. When c = 0, we have the special case of Park- The cures to this problem is to discard the first Miller algorithm or Lehmer algorithm (see Park & 2000 numbers. Miller (1988)). Let us note that the n + jth term can be easily derived from the nth term with a 2see L'Ecuyer (1990). puts to aj mod m (still when c = 0). 3TAOCP stands for The Art Of Computer Program- ming, Knuth's famous book. 1this representation could be easily generalized for 4go to http://www-cs-faculty.stanford.edu/ matrix, see L'Ecuyer (1990). ˜knuth/news02.html#rng. 2 OVERVIEW OF RANDOM GENERATION ALGORITHMS 4 2.1.3 Mersenne-Twister where >> u (resp. << s) denotes a rightshift (leftshift) of u (s) bits. At last, we transform random integers to reals with one of output These two types of generators are in the big fam- functions g proposed above. ily of matrix linear congruential generators (cf. L'Ecuyer (1990)). But until here, no algorithms Details of the order of the successive operations exploit the binary structure of computers (i.e. used in the Mersenne-Twister (MT) algorithm use binary operations). In 1994, Matsumoto and can be found at the page 7 of Matsumoto & Kurita invented the TT800 generator using binary Nishimura (1998). However, the least, we need operations. But Matsumoto & Nishimura (1998) to learn and to retain, is all these (bitwise) greatly improved the use of binary operations and operations can be easily done in many computer proposed a new random number generator called languages (e.g in C) ensuring a very fast algo- Mersenne-Twister. rithm. Matsumoto & Nishimura (1998) work on the The set of parameters used are finite set N2 = f0; 1g, so a variable x is represented by a vectors of ! bits (e.g. 32 bits). They use the following linear recurrence for the n + ith term: • (!; n; m; r) = (32; 624; 397; 31), upp low xi+n = xi+m ⊕ (xi jxi+1)A; upp where n > m are constant integers, xi • a = 0 × 9908B0DF; b = 0 × 9D2C5680; c = low (respectively xi ) means the upper (lower) ! − r 0 × EF C60000, (r) bits of xi and A a ! × ! matrix of N2. j is the upp low operator of concatenation, so xi jxi+1 appends the upper ! − r bits of xi with the lower r bits of • u = 11, l = 18, s = 7 and t = 15. xi+1. After a right multiplication with the matrix 1 A , ⊕ adds the result with xi+m bit to bit modulo two (i.e. ⊕ denotes the exclusive-or called xor). These parameters ensure a good equidistribution n!−r 19937 Once provided an initial seed x0; : : : ; xn−1, and a period of 2 − 1 = 2 − 1. Mersenne Twister produces random integers in 0;:::; 2!−1. All operations used in the recurrence The great advantages of the MT algorithm are are bitwise operations, thus it is a very fast a far longer period than any previous generators computation compared to modulus operations (greater than the period of Park & Miller (1988) used in previous algorithms. sequence of 232 − 1 or the period of Knuth (2002) around 2129), a far better equidistribution (since To increase the equidistribution, Matsumoto & it passed the DieHard test) as well as an very Nishimura (1998) added a tempering step: good computation time (since it used binary operations and not the costly real operation yi xi+n ⊕ (xi+n >> u); modullus). yi yi ⊕ ((yi << s) ⊕ b); yi yi ⊕ ((yi << t) ⊕ c); MT algorithm is already implemented in R (function runif). However the package yi yi ⊕ (yi >> l); randtoolbox provide functions to compute a 0 I 1Matrix A equals to !−1 whose right multi- new version of Mersenne-Twister (the SIMD- a oriented Fast Mersenne Twister algorithm) as well plication can be done with a bitwise rightshift operation and an addition with integer a. See the section 2 of as the WELL (Well Equidistributed Long-period Matsumoto & Nishimura (1998) for explanations. Linear) generator. 2 OVERVIEW OF RANDOM GENERATION ALGORITHMS 5 2.1.4 Well Equidistributed Long-period An usual measure of uniformity is the sum of Linear generators dimension gaps ! X The MT recurrence can be rewritten as ∆1 = δl: l=1 xi = Axi−1; Panneton et al.
Recommended publications
  • Sensor-Seeded Cryptographically Secure Random Number Generation
    International Journal of Recent Technology and Engineering (IJRTE) ISSN: 2277-3878, Volume-8 Issue-3, September 2019 Sensor-Seeded Cryptographically Secure Random Number Generation K.Sathya, J.Premalatha, Vani Rajasekar Abstract: Random numbers are essential to generate secret keys, AES can be executed in various modes like Cipher initialization vector, one-time pads, sequence number for packets Block Chaining (CBC), Cipher Feedback (CFB), Output in network and many other applications. Though there are many Feedback (OFB), and Counter (CTR). Pseudo Random Number Generators available they are not suitable for highly secure applications that require high quality randomness. This paper proposes a cryptographically secure II. PRNG IMPLEMENTATIONS pseudorandom number generator with its entropy source from PRNG requires the seed value to be fed to a sensor housed on mobile devices. The sensor data are processed deterministic algorithm. Many deterministic algorithms are in 3-step approach to generate random sequence which in turn proposed, some of widely used algorithms are fed to Advanced Encryption Standard algorithm as random key to generate cryptographically secure random numbers. Blum-Blum-Shub algorithm uses where X0 is seed value and M =pq, p and q are prime. Keywords: Sensor-based random number, cryptographically Linear congruential Generator uses secure, AES, 3-step approach, random key where is the seed value. Mersenne Prime Twister uses range of , I. INTRODUCTION where that outputs sequence of 32-bit random Information security algorithms aim to ensure the numbers. confidentiality, integrity and availability of data that is transmitted along the path from sender to receiver. All the III. SENSOR-SEEDED PRNG security mechanisms like encryption, hashing, signature rely Some of PRNGs uses clock pulse of computer system on random numbers in generating secret keys, one time as seeds.
    [Show full text]
  • A Secure Authentication System- Using Enhanced One Time Pad Technique
    IJCSNS International Journal of Computer Science and Network Security, VOL.11 No.2, February 2011 11 A Secure Authentication System- Using Enhanced One Time Pad Technique Raman Kumar1, Roma Jindal 2, Abhinav Gupta3, Sagar Bhalla4 and Harshit Arora 5 1,2,3,4,5 Department of Computer Science and Engineering, 1,2,3,4,5 D A V Institute of Engineering and Technology, Jalandhar, Punjab, India. Summary the various weaknesses associated with a password have With the upcoming technologies available for hacking, there is a come to surface. It is always possible for people other than need to provide users with a secure environment that protect their the authenticated user to posses its knowledge at the same resources against unauthorized access by enforcing control time. Password thefts can and do happen on a regular basis, mechanisms. To counteract the increasing threat, enhanced one so there is a need to protect them. Rather than using some time pad technique has been introduced. It generally random set of alphabets and special characters as the encapsulates the enhanced one time pad based protocol and provides client a completely unique and secured authentication passwords we need something new and something tool to work on. This paper however proposes a hypothesis unconventional to ensure safety. At the same time we need regarding the use of enhanced one time pad based protocol and is to make sure that it is easy to be remembered by you as a comprehensive study on the subject of using enhanced one time well as difficult enough to be hacked by someone else.
    [Show full text]
  • Package 'Randtoolbox'
    Package ‘randtoolbox’ January 31, 2020 Type Package Title Toolbox for Pseudo and Quasi Random Number Generation and Random Generator Tests Version 1.30.1 Author R port by Yohan Chalabi, Christophe Dutang, Petr Savicky and Di- ethelm Wuertz with some underlying C codes of (i) the SFMT algorithm from M. Mat- sumoto and M. Saito, (ii) the Knuth-TAOCP RNG from D. Knuth. Maintainer Christophe Dutang <[email protected]> Description Provides (1) pseudo random generators - general linear congruential generators, multiple recursive generators and generalized feedback shift register (SF-Mersenne Twister algorithm and WELL generators); (2) quasi random generators - the Torus algorithm, the Sobol sequence, the Halton sequence (including the Van der Corput sequence) and (3) some generator tests - the gap test, the serial test, the poker test. See e.g. Gentle (2003) <doi:10.1007/b97336>. The package can be provided without the rngWELL dependency on demand. Take a look at the Distribution task view of types and tests of random number generators. Version in Memoriam of Diethelm and Barbara Wuertz. Depends rngWELL (>= 0.10-1) License BSD_3_clause + file LICENSE NeedsCompilation yes Repository CRAN Date/Publication 2020-01-31 10:17:00 UTC R topics documented: randtoolbox-package . .2 auxiliary . .3 coll.test . .4 coll.test.sparse . .6 freq.test . .8 gap.test . .9 get.primes . 11 1 2 randtoolbox-package getWELLState . 12 order.test . 12 poker.test . 14 pseudoRNG . 16 quasiRNG . 22 rngWELLScriptR . 26 runifInterface . 27 serial.test . 29 soboltestfunctions . 31 Index 33 randtoolbox-package General remarks on toolbox for pseudo and quasi random number generation Description The randtoolbox-package started in 2007 during an ISFA (France) working group.
    [Show full text]
  • Cryptanalysis of the Random Number Generator of the Windows Operating System
    Cryptanalysis of the Random Number Generator of the Windows Operating System Leo Dorrendorf School of Engineering and Computer Science The Hebrew University of Jerusalem 91904 Jerusalem, Israel [email protected] Zvi Gutterman Benny Pinkas¤ School of Engineering and Computer Science Department of Computer Science The Hebrew University of Jerusalem University of Haifa 91904 Jerusalem, Israel 31905 Haifa, Israel [email protected] [email protected] November 4, 2007 Abstract The pseudo-random number generator (PRNG) used by the Windows operating system is the most commonly used PRNG. The pseudo-randomness of the output of this generator is crucial for the security of almost any application running in Windows. Nevertheless, its exact algorithm was never published. We examined the binary code of a distribution of Windows 2000, which is still the second most popular operating system after Windows XP. (This investigation was done without any help from Microsoft.) We reconstructed, for the ¯rst time, the algorithm used by the pseudo- random number generator (namely, the function CryptGenRandom). We analyzed the security of the algorithm and found a non-trivial attack: given the internal state of the generator, the previous state can be computed in O(223) work (this is an attack on the forward-security of the generator, an O(1) attack on backward security is trivial). The attack on forward-security demonstrates that the design of the generator is flawed, since it is well known how to prevent such attacks. We also analyzed the way in which the generator is run by the operating system, and found that it ampli¯es the e®ect of the attacks: The generator is run in user mode rather than in kernel mode, and therefore it is easy to access its state even without administrator privileges.
    [Show full text]
  • Gretl User's Guide
    Gretl User’s Guide Gnu Regression, Econometrics and Time-series Allin Cottrell Department of Economics Wake Forest university Riccardo “Jack” Lucchetti Dipartimento di Economia Università Politecnica delle Marche December, 2008 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation (see http://www.gnu.org/licenses/fdl.html). Contents 1 Introduction 1 1.1 Features at a glance ......................................... 1 1.2 Acknowledgements ......................................... 1 1.3 Installing the programs ....................................... 2 I Running the program 4 2 Getting started 5 2.1 Let’s run a regression ........................................ 5 2.2 Estimation output .......................................... 7 2.3 The main window menus ...................................... 8 2.4 Keyboard shortcuts ......................................... 11 2.5 The gretl toolbar ........................................... 11 3 Modes of working 13 3.1 Command scripts ........................................... 13 3.2 Saving script objects ......................................... 15 3.3 The gretl console ........................................... 15 3.4 The Session concept ......................................... 16 4 Data files 19 4.1 Native format ............................................. 19 4.2 Other data file formats ....................................... 19 4.3 Binary databases ..........................................
    [Show full text]
  • Random Number Generation Using MSP430™ Mcus (Rev. A)
    Application Report SLAA338A–October 2006–Revised May 2018 Random Number Generation Using MSP430™ MCUs ......................................................................................................................... MSP430Applications ABSTRACT Many applications require the generation of random numbers. These random numbers are useful for applications such as communication protocols, cryptography, and device individualization. Generating random numbers often requires the use of expensive dedicated hardware. Using the two independent clocks available on the MSP430F2xx family of devices, software can generate random numbers without such hardware. Source files for the software described in this application report can be downloaded from http://www.ti.com/lit/zip/slaa338. Contents 1 Introduction ................................................................................................................... 1 2 Setup .......................................................................................................................... 1 3 Adding Randomness ........................................................................................................ 2 4 Usage ......................................................................................................................... 2 5 Overview ...................................................................................................................... 2 6 Testing for Randomness...................................................................................................
    [Show full text]
  • (Pseudo) Random Number Generation for Cryptography
    Thèse de Doctorat présentée à L’ÉCOLE POLYTECHNIQUE pour obtenir le titre de DOCTEUR EN SCIENCES Spécialité Informatique soutenue le 18 mai 2009 par Andrea Röck Quantifying Studies of (Pseudo) Random Number Generation for Cryptography. Jury Rapporteurs Thierry Berger Université de Limoges, France Andrew Klapper University of Kentucky, USA Directeur de Thèse Nicolas Sendrier INRIA Paris-Rocquencourt, équipe-projet SECRET, France Examinateurs Philippe Flajolet INRIA Paris-Rocquencourt, équipe-projet ALGORITHMS, France Peter Hellekalek Universität Salzburg, Austria Philippe Jacquet École Polytechnique, France Kaisa Nyberg Helsinki University of Technology, Finland Acknowledgement It would not have been possible to finish this PhD thesis without the help of many people. First, I would like to thank Prof. Peter Hellekalek for introducing me to the very rich topic of cryptography. Next, I express my gratitude towards Nicolas Sendrier for being my supervisor during my PhD at Inria Paris-Rocquencourt. He gave me an interesting topic to start, encouraged me to extend my research to the subject of stream ciphers and supported me in all my decisions. A special thanks also to Cédric Lauradoux who pushed me when it was necessary. I’m very grateful to Anne Canteaut, which had always an open ear for my questions about stream ciphers or any other topic. The valuable discussions with Philippe Flajolet about the analysis of random functions are greatly appreciated. Especially, I want to express my gratitude towards my two reviewers, Thierry Berger and Andrew Klapper, which gave me precious comments and remarks. I’m grateful to Kaisa Nyberg for joining my jury and for receiving me next year in Helsinki.
    [Show full text]
  • Random-Number Functions
    Title stata.com Random-number functions Contents Functions Remarks and examples Methods and formulas Acknowledgments References Also see Contents rbeta(a,b) beta(a,b) random variates, where a and b are the beta distribution shape parameters rbinomial(n,p) binomial(n,p) random variates, where n is the number of trials and p is the success probability rcauchy(a,b) Cauchy(a,b) random variates, where a is the location parameter and b is the scale parameter rchi2(df) χ2, with df degrees of freedom, random variates rexponential(b) exponential random variates with scale b rgamma(a,b) gamma(a,b) random variates, where a is the gamma shape parameter and b is the scale parameter rhypergeometric(N,K,n) hypergeometric random variates rigaussian(m,a) inverse Gaussian random variates with mean m and shape param- eter a rlaplace(m,b) Laplace(m,b) random variates with mean m and scale parameter b p rlogistic() logistic variates with mean 0 and standard deviation π= 3 p rlogistic(s) logistic variates with mean 0, scale s, and standard deviation sπ= 3 rlogistic(m,s) logisticp variates with mean m, scale s, and standard deviation sπ= 3 rnbinomial(n,p) negative binomial random variates rnormal() standard normal (Gaussian) random variates, that is, variates from a normal distribution with a mean of 0 and a standard deviation of 1 rnormal(m) normal(m,1) (Gaussian) random variates, where m is the mean and the standard deviation is 1 rnormal(m,s) normal(m,s) (Gaussian) random variates, where m is the mean and s is the standard deviation rpoisson(m) Poisson(m)
    [Show full text]
  • A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications
    Special Publication 800-22 Revision 1a A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications AndrewRukhin,JuanSoto,JamesNechvatal,Miles Smid,ElaineBarker,Stefan Leigh,MarkLevenson,Mark Vangel,DavidBanks,AlanHeckert,JamesDray,SanVo Revised:April2010 LawrenceE BasshamIII A Statistical Test Suite for Random and Pseudorandom Number Generators for NIST Special Publication 800-22 Revision 1a Cryptographic Applications 1 2 Andrew Rukhin , Juan Soto , James 2 2 Nechvatal , Miles Smid , Elaine 2 1 Barker , Stefan Leigh , Mark 1 1 Levenson , Mark Vangel , David 1 1 2 Banks , Alan Heckert , James Dray , 2 San Vo Revised: April 2010 2 Lawrence E Bassham III C O M P U T E R S E C U R I T Y 1 Statistical Engineering Division 2 Computer Security Division Information Technology Laboratory National Institute of Standards and Technology Gaithersburg, MD 20899-8930 Revised: April 2010 U.S. Department of Commerce Gary Locke, Secretary National Institute of Standards and Technology Patrick Gallagher, Director A STATISTICAL TEST SUITE FOR RANDOM AND PSEUDORANDOM NUMBER GENERATORS FOR CRYPTOGRAPHIC APPLICATIONS Reports on Computer Systems Technology The Information Technology Laboratory (ITL) at the National Institute of Standards and Technology (NIST) promotes the U.S. economy and public welfare by providing technical leadership for the nation’s measurement and standards infrastructure. ITL develops tests, test methods, reference data, proof of concept implementations, and technical analysis to advance the development and productive use of information technology. ITL’s responsibilities include the development of technical, physical, administrative, and management standards and guidelines for the cost-effective security and privacy of sensitive unclassified information in Federal computer systems.
    [Show full text]
  • Scope of Various Random Number Generators in Ant System Approach for Tsp
    AC 2007-458: SCOPE OF VARIOUS RANDOM NUMBER GENERATORS IN ANT SYSTEM APPROACH FOR TSP S.K. Sen, Florida Institute of Technology Syamal K Sen ([email protected]) is currently a professor in the Dept. of Mathematical Sciences, Florida Institute of Technology (FIT), Melbourne, Florida. He did his Ph.D. (Engg.) in Computational Science from the prestigious Indian Institute of Science (IISc), Bangalore, India in 1973 and then continued as a faculty of this institute for 33 years. He was a professor of Supercomputer Computer Education and Research Centre of IISc during 1996-2004 before joining FIT in January 2004. He held a Fulbright Fellowship for senior teachers in 1991 and worked in FIT. He also held faculty positions, on leave from IISc, in several universities around the globe including University of Mauritius (Professor, Maths., 1997-98), Mauritius, Florida Institute of Technology (Visiting Professor, Math. Sciences, 1995-96), Al-Fateh University (Associate Professor, Computer Engg, 1981-83.), Tripoli, Libya, University of the West Indies (Lecturer, Maths., 1975-76), Barbados.. He has published over 130 research articles in refereed international journals such as Nonlinear World, Appl. Maths. and Computation, J. of Math. Analysis and Application, Simulation, Int. J. of Computer Maths., Int. J Systems Sci., IEEE Trans. Computers, Internl. J. Control, Internat. J. Math. & Math. Sci., Matrix & Tensor Qrtly, Acta Applicande Mathematicae, J. Computational and Applied Mathematics, Advances in Modelling and Simulation, Int. J. Engineering Simulation, Neural, Parallel and Scientific Computations, Nonlinear Analysis, Computers and Mathematics with Applications, Mathematical and Computer Modelling, Int. J. Innovative Computing, Information and Control, J. Computational Methods in Sciences and Engineering, and Computers & Mathematics with Applications.
    [Show full text]
  • Gretl 1.6.0 and Its Numerical Accuracy - Technical Supplement
    GRETL 1.6.0 AND ITS NUMERICAL ACCURACY - TECHNICAL SUPPLEMENT A. Talha YALTA and A. Yasemin YALTA∗ Department of Economics, Fordham University, New York 2007-07-13 This supplement provides detailed information regarding both the procedure and the results of our testing GRETL using the univariate summary statistics, analysis of variance, linear regression, and nonlinear least squares benchmarks of the NIST Statis- tical Reference Datasets (StRD), as well as verification of the random number generator and the accuracy of statistical distributions used for calculating critical values. The numbers of accurate digits (NADs) for testing the StRD datasets are also supplied and compared with several commercial packages namely SAS v6.12, SPSS v7.5, S-Plus v4.0, Stata 7, and Gauss for Windows v3.2.37. We did not perform any accuracy tests of the latest versions of these programs and the results that we supply for packages other than GRETL 1.6.0 are those independently verified and published by McCullough (1999a), McCullough and Wilson (2002), and Vinod (2000) previously. Readers are also referred to McCullough (1999b) and Keeling and Pavur (2007), which examine software accuracy and supply the NADS across four and nine software packages at once respectively. Since all these programs perform calculations using 64-bit floating point arithmetic, discrepan- cies in results are caused by differences in algorithms used to perform various statistical operations. 1 Numerical tests of the NIST StRD benchmarks For the StRD reference data sets, NIST provides certified values calculated with multiple precision in 500 digits of accuracy, which were later rounded to 15 significant digits (11 for nonlinear least squares).
    [Show full text]
  • Random.Org: Introduction to Randomness and Random Numbers
    random.org: Introduction to Randomness and Random Numbers Mads Haahr June 1999* Background Oh, many a shaft at random sent Finds mark the archer little meant! And many a word at random spoken May soothe, or wound, a heart that's broken!" | Sir Walter Scott Randomness and random numbers have traditionally been used for a variety of purposes, for ex- ample games such as dice games. With the advent of computers, people recognized the need for a means of introducing randomness into a computer program. Surprising as it may seem, however, it is difficult to get a computer to do something by chance. A computer running a program follows its instructions blindly and is therefore completely predictable. Computer engineers chose to introduce randomness into computers in the form of pseudo- random number generators. As the name suggests, pseudo-random numbers are not truly random. Rather, they are computed from a mathematical formula or simply taken from a precalculated list. A lot of research has gone into pseudo-random number theory and modern algorithms for generating them are so good that the numbers look exactly like they were really random. Pseudo- random numbers have the characteristic that they are predictable, meaning they can be predicted if you know where in the sequence the first number is taken from. For some purposes, predictability is a good characteristic, for others it is not. Random numbers are used for computer games but they are also used on a more serious scale for the generation of cryptographic keys and for some classes of scientific experiments.
    [Show full text]