Cryptography, gambling, statistical sampling, and computer simulation are all purposes for using a random number generator.