In cryptography, we use random number generators to generate completely random numbers. We then use those completely random numbers to seed random number generators. And finally, we use those completely random numbers to seed completely random number generators. The result?
The idea is that instead of using the output from a completely random bit generator, we can manipulate the output from a completely random bit generator to get an output that is even less likely to repeat.
The average person uses a number generator in about 15 locations throughout their day. It is used for everything from creating random passwords, to controlling the dice roll on your game, to selecting a random number for the lottery. This makes it important to understand how number generators work. As you can see, the odds of a random number generator repeating is often based on its size. Therefore it is important to think about how the size of the multiplier affects the odds. This is what a linear congruential number generator does. When you start a linear congruential generator with an increment of 1, the first number generated will be 2, but the size of the multiplier is 3. The second number generated will be 3, but the size of the multiplier is 7. As you can see, the size of the multiplier is doubling each time. This way we maintain the 1 in the size of the multiplier.
Let’s select a random number for the lottery. Since the size of the multiplier is 3, we will generate 3 at each iteration. The first number generated is 1, the second is 2, and the third is 3. The next number generated will be 4, and the fourth will be 5.
This is where a linear congruential number generator comes in. It has a prime number as its multiplier. The total number of possible iterations that can occur is equal to the size of the multiplier. Because the multiplier is prime (no divisors) the odds of it repeating is 1 in the size of the multiplier. If the size of the multiplier is 3 the odds of it repeating is 1 in 3.