Abstract
The article “Fast Random Integer Generation in an Interval” by Lemire (2018) addressed the problem of reducing the cost of machine instructions needed for the random generation of integer values in a generic interval [0,s). The approach taken by the author is the one of exploiting the rejection method (Neumann 1951) to build an algorithm that almost eliminates the need for performing integer division operations—the algorithm still exploits divisions by powers of two, implemented in the form of cheap shift operations. In more details, the likelihood of not requiring an integer division in the proposed algorithm is 2L − s / 2L, where L denotes the number of bits used to represent integer values. The author also presents a comparative experimental study where the new algorithm, and its implementation for x86 processors, are compared with solutions offered by common software libraries for different programming languages.
- D. E. Knuth. 1969. The Art of Computer Programming, Volume II: Seminumerical Algorithms. Addison-Wesley.Google Scholar
- D. Lemire. 2018. Fast random integer generation in an interval. ACM Trans. Model. Comput. Simul. 29, 1, Article 3. Google ScholarDigital Library
- J. V. Neumann. 1951. Various techniques used in connection with random digits. Nat. Bureau Stand. 12, 36--38.Google Scholar
Recommendations
Fast Random Integer Generation in an Interval
In simulations, probabilistic algorithms, and statistical tests, we often generate random integers in an interval (e.g., [0,s)). For example, random integers in an interval are essential to the Fisher-Yates random shuffle. Consequently, popular ...
Bit-Wise Behavior of Random Number Generators
In 1985, G. Marsaglia proposed the m-tuple test, a runs test on bits, as a test of nonrandomness of a sequence of pseudorandom integers. We try this test on the outputs from a large set of pseudorandom number generators and discuss the behavior of the ...
Recycling random bits in parallel
HICSS '95: Proceedings of the 28th Hawaii International Conference on System SciencesShows that r pseudo-random bits can be obtained by concatenating t blocks of r/t pseudo-random bits, where the blocks are generated in parallel. This can be considered as a parallel version of R. Impagliazzo and D. Zuckerman's (1989) method of recycling ...
Comments