Fast Random Integer Generation in an Interval

@article{Lemire2018FastRI,  title={Fast Random Integer Generation in an Interval},  author={Daniel Lemire},  journal={ACM Transactions on Modeling and Computer Simulation (TOMACS)},  year={2018},  volume={29},  pages={1 - 12},  url={https://api.semanticscholar.org/CorpusID:44061046}}
An unbiased function to generate ranged integers from a source of random words that avoids integer divisions with high probability is reviewed and it is shown that this algorithm can multiply the speed of unbiased random shuffling on x64 processors.

Figures and Tables from this paper

51 Citations

Random Variate Generation with Formal Guarantees

A universal and fully automated method to synthesize exact random variate generators given any numerical CDF implemented in any binary number format, such as floating-point, fixed-point, and posits, is presented.

Replicated Computational Results (RCR) Report for “Fast Random Integer Generation in an Interval”

The approach taken by the author is the one of exploiting the rejection method to build an algorithm that almost eliminates the need for performing integer division operations, and its implementation for x86 processors is compared with solutions offered by common software libraries for different programming languages.

Batched ranged random integer generation

This work presents an efficient algorithm to generate multiple independent uniformly‐random bounded integers from a single uniformly‐random binary word, without any bias, and can more than double the speed of unbiased random shuffling for small to moderately large arrays.

Engineering Shared-Memory Parallel Shuffling to Generate Random Permutations In-Place

This work engineer, for the first time, a practically fast, parallel shuffling algorithm with parallel depth that requires only poly-logarithmic auxiliary memory and demonstrates that the runtime of the parallel algorithm is comparable to the time that other algorithms may take to acquire the memory from the operating system to copy the input.

Algorithms for generating small random samples

An algorithm for sampling a pair of distinct integers, and an algorithm for sampling a triple of distinct integers for generating small random samples without replacement are presented.

Randen - fast backtracking-resistant random generator with AES+Feistel+Reverie

This work introduces a new open-sourced generator called Randen, an instantiation of Reverie, a recently published robust sponge-like random generator, with a new permutation built from an improved generalized Feistel structure with 16 branches, which can protect randomized algorithms such as reservoir sampling from attack.

Drawing Random Floating-point Numbers from an Interval

This work investigates and quantify precisely the shortcomings of floating-point arithmetic's location-scale transformation while reviewing the actual implementations of the method in major programming languages and libraries, and proposes a simple algorithm to avoid these shortcomings without compromising performances.

$\rho\mu$: A Java library of randomization enhancements and other math utilities

The library includes implementations of efficient algorithms for randomly sampling indexes into arrays and other sequential structures, randomly sampling pairs and triples of distinct indexes, and random generation from non-uniform distributions, such Gaussian, Cauchy, and Binomial.

Secure Sampling of Constant-Weight Words â€" Application to BIKE

A new variant of the Fisher-Yates shuffle is proposed which is very well suited for secure implementations against timing and cache attacks, and produces constant weight words with a distribution close enough to uniform.

Efficient Online Random Sampling via Randomness Recycling

The empirical side, it is shown that randomness recycling enables state-of-the-art runtime performance on the Fisher-Yates shuffle when using a cryptographically secure pseudorandom number generator; and it can also speed up discrete Gaussian samplers.
...

40 References

Engineering Parallel In-Place Random Generation of Integer Permutations

This work tackles the feasibility and efficiency of two new parallel algorithms that sample random permutations of the integers [M] = {1, ..., M} and shows high scalability and outperforms the previously known approaches by far.

Random Number Generation

    R. Rubinstein
    Computer Science, Mathematics
    Encyclopedia of Algorithms
  • 2008
The main goal is to reproduce the statistical properties on which these methods are based, so that the Monte Carlo estimators behave as expected, whereas for gambling machines and cryptology, observing the sequence of output values for some time should provide no practical advantage for predicting the forthcoming numbers better than by just guessing at random.

Romu: Fast Nonlinear Pseudo-Random Number Generators Providing High Quality

The Romu family of pseudo-random number generators (PRNGs) which combines the nonlinear operation of rotation with the linear operations of multiplication and (optionally) addition achieves a greater degree of randomness using the same number of arithmetic operations, resulting in higher speed.

TestU01: A C library for empirical testing of random number generators

We introduce TestU01, a software library implemented in the ANSI C language, and offering a collection of utilities for the empirical statistical testing of uniform random number generators (RNGs).

Random numbers for simulation

This paper focuses mainly on efficient and recently proposed techniques for generating uniform pseudorandom numbers, and aims to design more robust generators without having to pay too much in terms of portability, flexibility, and efficiency.

Algorithm 235: Random permutation

The Romberg integration algorithm has been used with great success by many groups [1, 2], and appears to be among the most generally reliable quadrature methods available.

Generating Random Permutations by Coin Tossing

Several simple, classical, little-known algorithms for generating random permutations by coin tossing are examined, analyzed, and implemented, and asymptotically optimal approximations to the expected complexity are made.

History of uniform random number generation

A historical account on the design, implementation, and testing of uniform random number generators used for simulation is given.

A search for good multiple recursive random number generators

An extensive computer search for good multiple recursive generators, in terms of their lattice structure and implementation speed, finds generators that are a little slower than the usual linear congruential generators, but have much longer periods and much better statistical properties.

Related Papers

Showing 1 through 3 of 0 Related Papers