# Sampling Exactly from the Normal Distribution

@article{Karney2016SamplingEF, title={Sampling Exactly from the Normal Distribution}, author={Charles F. F. Karney}, journal={ACM Transactions on Mathematical Software (TOMS)}, year={2016}, volume={42}, pages={1 - 14} }

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…

## 55 Citations

Improved Bernoulli Sampling for Discrete Gaussian Distributions over the Integers

- Computer Science, MathematicsMathematics
- 2021

This paper revisits the Bernoulli(-type) sampling for centered discrete Gaussian distributions over the integers and proposes a noncentered version of Bernoullis sampling algorithm for discreteGaussian distributions with varying centers over the arithmetic integers.

Count-then-Permute: A Precision-Free Alternative to Inversion Sampling

- Computer Science, MathematicsCT-RSA
- 2018

This proposal uses a block cipher as an efficient, computationally-secure instantiation of uniform sampling without replacement, also known as a pseudorandom permutation (PRP) in the cryptographic terminology, and pre-processing based on a recent polynomial-time exact sampling for binomial distribution.

A rejection sampling algorithm for off-centered discrete Gaussian distributions over the integers

- Computer Science, MathematicsScience China Information Sciences
- 2017

It is interesting to design more efficient SampleZ algorithms for off-centered discrete Gaussian distributions over the integers, which support arbitrary and varying centers.

Gaussian Sampling over the Integers: Efficient, Generic, Constant-Time

- Computer Science, MathematicsCRYPTO
- 2017

This work presents new algorithms for discrete Gaussian sampling that are both generic (application independent), efficient, and more easily implemented in constant time without incurring a substantial slow-down, making them more resilient to side-channel attacks.

CDT-Based Gaussian Sampling: From Multi to Double Precision

- Computer ScienceIEEE Transactions on Computers
- 2018

It is shown that it can be used to bound the precision requirement in Gaussian sampling to the IEEE 754 floating-point standard double precision for usual lattice-based signature parameters by using a modified cumulative distribution table (CDT), which reduces the memory needed by CDT-based algorithms and, makes their constant-time implementation faster and simpler.

An improved exact sampling algorithm for the standard normal distribution

- Computer Science, MathematicsComput. Stat.
- 2022

An estimate of the expected number of uniform deviates used by Karney's exact sampling algorithm until outputting a sample value, and an improved algorithm with lower uniform deviate consumption is presented.

Exact Sublinear Binomial Sampling

- Computer Science, MathematicsAlgorithmica
- 2015

This paper presents the first algorithm, to the best of the knowledge, that samples binomial distributions in sublinear time with no precision loss, and assumes each bit of p can be obtained in O(1) time.

Exact Sampling and Prefix Distributions

- Mathematics
- 2018

EXACT SAMPLING AND PREFIX DISTRIBUTIONS by Sebastian Oberhoff The University of Wisconsin-Milwaukee, 2018 Under the Supervision of Professor Chao Zhu This thesis explores some new means to generate…

Sampling from Arbitrary Centered Discrete Gaussians for Lattice-Based Cryptography

- Computer Science, MathematicsACNS
- 2017

This work study how to reduce the number of centers for which the authors have to precompute tables and propose a non-centered CDT algorithm with practicable size of precomputed tables as fast as its centered variant.

Generic, efficient and isochronous Gaussian sampling over the integers

- Computer Science, MathematicsIACR Cryptol. ePrint Arch.
- 2021

A secure, efficient exponential Bernoulli sampling algorithm that can securely sample from Gaussian distributions with different standard deviations and arbitrary centers and is developed an isochronous Gaussian sampler based on rejection sampling.

## References

SHOWING 1-10 OF 43 REFERENCES

A fast normal random number generator

- Computer ScienceTOMS
- 1992

A method is presented for generating pseudorandom numbers with a normal distribution using the ratio of uniform deviates method discovered by Kinderman and Monahan with an improved set of bounding curves and can be implemented in 15 lines of FORTRAN.

Von Neumann''s comparison method for random sampling from the normal and other distributions.

- Mathematics
- 1972

The author presents a generalization he worked out in 1950 of von Neumann''s method of generating random samples from the exponential distribution by comparisons of uniform random numbers on (0,1).…

Extensions of Forsythe’s method for random sampling from the normal distribution

- Mathematics
- 1973

This article is an expansion of G. E. Forsythe's paper "Von Neumann's com- parison method for random sampling from the normal and other distributions" (5). It is shown that Forsythe's method for the…

Algorithm 488: A Gaussian pseudo-random number generator

- Mathematics, Computer ScienceCACM
- 1974

The algorithm calculates the exact cumulative distribution of the two-sided Kolmogorov-Smirnov statistic for samples with few observations for data sampling and discrete system simulation.

The Ziggurat Method for Generating Random Variables

- Mathematics
- 2000

We provide a new version of our ziggurat method for generating a random variable from a given decreasing density. It is faster and simpler than the original, and will produce, for example, normal or…

Computer Generation of Random Variables Using the Ratio of Uniform Deviates

- MathematicsTOMS
- 1977

The ratio-of-uniforms method for generating random variables having continuous nonuniform distributions is presented and can be used for generating short and often as fast algorithms as well as longer algorithms.

Optimal Discrete Uniform Generation from Coin Flips, and Applications

- Computer Science, MathematicsArXiv
- 2013

The algorithm aims to be simple to implement and optimal both with regards to the amount of random bits consumed, and from a computational perspective---allowing for faster and more efficient Monte-Carlo simulations in computational physics and biology.

Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator

- Computer Science, MathematicsTOMC
- 1998

A new algorithm called Mersenne Twister (MT) is proposed for generating uniform pseudorandom numbers, which provides a super astronomical period of 2 and 623-dimensional equidistribution up to 32-bit accuracy, while using a working area of only 624 words.

On Buffon machines and numbers

- Mathematics, Computer ScienceSODA '11
- 2011

This work provides human-accessible Buffon machines, which require a dozen coin flips or less, on average, and produces experiments whose probabilities of success are expressible in terms of numbers such as π, exp(−1), log2, √3, cos(1/4), ζ(5).

Sampling from discrete Gaussians for lattice-based cryptography on a constrained device

- Computer Science, MathematicsApplicable Algebra in Engineering, Communication and Computing
- 2014

The paper surveys algorithms to implement such sampling efficiently, with particular focus on the case of constrained devices with small on-board storage and without access to large numbers of external random bits.