OFFSET
1,1
COMMENTS
The knuth_b generator uses "Algorithm B" (described in the Knuth reference) to permute the values produced by the "minimal standard generator".
REFERENCES
Carter Bays and S. D. Durham, "Improving a Poor Random Number Generator", ACM Transactions on Mathematical Software, vol. 2, issue 1 (March 1976), pp. 59-64.
D. E. Knuth, The Art of Computer Programming, 2nd Edition, vol. 2 Seminumerical Algorithms, Addison-Wesley, 1981, pp. 32-33.
LINKS
PROG
(C++)
#include <iostream>
#include <random>
void A221555(int max)
{
std::knuth_b gen;
for (int i = 1; i <= max; ++i)
std::cout << i << ' ' << gen() << '\n';
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric M. Schmidt, Jan 19 2013
STATUS
approved