# 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…

## 57 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.

### On Rejection Sampling Algorithms for Centered Discrete Gaussian Distribution over Integers

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

Three alternative rejection sampling algorithms for centered discrete Gaussian distributions with parameter σ in two specific forms are proposed, designed for the case where σ is an positive integer, and it requires neither pre-computation storage nor floating-point arithmetic.

### 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…

### Random variate generation using only finitely many unbiased, independently and identically distributed random bits.

- Mathematics, Computer Science
- 2020

A universal lower bound for the expected number of perfect coin flips required to reach a desired accuracy is derived in terms of the Wasserstein $L_\infty$-metric.

## 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.

### Accuracy in random number generation

- Computer Science
- 1985

An ideal discrete approximation of a continuous distribution and a measure of error are proposed for the generation of continuous random variables on a digital computer and comments are made for the design of algorithms to reduce the bias and avoid overflow problems.

### 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.