PCG, A Family of Better Random Number Generators

submited by
Style Pass
2023-05-26 09:00:03

PCG is a family of simple fast space-efficient statistically good algorithms for random number generation. Unlike many general-purpose RNGs, they are also hard to predict.

Algorithmic random number generators are everywhere, used for all kinds of tasks, from simulation to computational creativity. Learn more about algorithmic random number generation...

Unless you're using a very esoteric RNG, odds are that the RNG you're using is flawed in one way or another. If you're using the Mersenne Twister, arc4random, ChaCha20, Unix's drand48, Unix random, Unix rand, XorShift*, RanQ1, or several others there are flaws you might want to know about. Learn more...

To explain why the PCG family is better, we need to get a little bit technical. There are two parts to a random number generator. We can see them as two functions:

Most RNGs use a very simple output function. Many RNGs just use the identity function! They just return the state as is (making them easily predicted). Some RNGs combine multiple simple RNGs and thus have an output function that just merges them together (e.g., with addition or xor). Again, this is a very simple output function.

Leave a Comment