Sampling Exactly from the Normal Distribution

An algorithm for sampling exactly from the normal distribution is given. The algorithm reads some number of uniformly distributed random digits in a given base and generates an initial portion of the representation of a normal deviate in the same base. Thereafter, uniform random digits are copied directly into the representation of the normal deviate. Thus, in contrast to existing methods, it is possible to generate normal deviates exactly rounded to any precision with a mean cost that scales linearly in the precision. The method performs no extended precision arithmetic, calls no transcendental functions, and uses no floating point arithmetic whatsoever; it uses only simple integer operations. It can easily be adapted to sample exactly from the discrete normal distribution whose parameters are rational numbers.

[1]  R. Brent Algorithm 488: A Gaussian pseudo-random number generator , 1974, CACM.

[2]  J. H. Ahrens,et al.  Extensions of Forsythe’s method for random sampling from the normal distribution , 1973 .

[3]  Steven D. Galbraith,et al.  Sampling from discrete Gaussians for lattice-based cryptography on a constrained device , 2014, Applicable Algebra in Engineering, Communication and Computing.

[4]  Philippe Flajolet,et al.  The Complexity of Generating an Exponentially Distributed Variate , 1986, J. Algorithms.

[5]  John F. Monahan,et al.  Accuracy in random number generation , 1985 .

[6]  Makoto Matsumoto,et al.  SIMD-Oriented Fast Mersenne Twister: a 128-bit Pseudorandom Number Generator , 2008 .

[7]  G. Forsythe Von Neumann''s comparison method for random sampling from the normal and other distributions. , 1972 .

[8]  M. E. Muller,et al.  A Note on the Generation of Random Normal Deviates , 1958 .

[9]  Bjarne Stroustrup,et al.  The C++ Programming Language, 4th Edition , 2013 .

[10]  Albert J. Kinderman,et al.  Computer Generation of Random Variables Using the Ratio of Uniform Deviates , 1977, TOMS.

[11]  H. Kahn APPLICATIONS OF MONTE CARLO , 1954 .

[12]  A. W. Kemp,et al.  Characterizations of a discrete normal distribution , 1997 .

[13]  G. Marsaglia,et al.  The Ziggurat Method for Generating Random Variables , 2000 .

[14]  Oded Regev,et al.  On lattices, learning with errors, random linear codes, and cryptography , 2005, STOC '05.

[15]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[16]  Thorsten Gerber,et al.  Handbook Of Mathematical Functions , 2016 .

[17]  Takuji Nishimura,et al.  Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator , 1998, TOMC.

[18]  Andrew Chi-Chih Yao,et al.  The complexity of nonuniform random number generation , 1976 .

[19]  Wayne Luk,et al.  Gaussian random number generators , 2007, CSUR.

[20]  John F. Monahan Extensions of von Neumann’s method for generating random variables , 1979 .

[21]  P. Moore A Million Random Digits with 100,000 Normal Deviates. , 1955 .

[22]  Daniele Micciancio Lattice-Based Cryptography , 2011, Encyclopedia of Cryptography and Security.

[23]  Jérémie O. Lumbroso Optimal Discrete Uniform Generation from Coin Flips, and Applications , 2013, ArXiv.

[24]  Philippe Flajolet,et al.  On Buffon machines and numbers , 2009, SODA '11.

[25]  Vincent Lefèvre,et al.  MPFR: A multiple-precision binary floating-point library with correct rounding , 2007, TOMS.

[26]  Donald Ervin Knuth,et al.  The Art of Computer Programming, 2nd Ed. (Addison-Wesley Series in Computer Science and Information , 1978 .

[27]  J. Hammersley A Million Random Digits with 100,000 Normal Deviates. , 1955 .

[28]  David Thomas,et al.  The Art in Computer Programming , 2001 .

[29]  Thomas Pornin,et al.  Perfect Block Ciphers with Small Blocks , 2007, FSE.

[30]  Joseph L. Leva A fast normal random number generator , 1992, TOMS.