ELI5: Explain Like I'm 5

Inversive congruential generator

An inversive congruential generator (ICG) is like a magic box that helps us create a sequence of random numbers. Think of it as a toy that has a number wheel inside and every time you spin the wheel, you get a different number. The ICG is similar in that it takes a starting number (also called a seed) and performs some complicated math to create a new number. Then, it takes that new number and performs the same math to create another number. It keeps going like this, creating a series of random numbers that are related to each other.

The reason it's called "inversive" is because the math involved has something to do with inverses, which is like doing the opposite of something. For example, if you add 2+3 to get 5, the inverse of adding would be subtracting. So if you subtract 2 from 5, you get 3. This is just an example, but the ICG does something similar with numbers.

The "congruential" part of the name comes from the fact that the math involved has to do with modular arithmetic. This is where you take a number and divide it by another number, but you only care about the remainder. For example, if you divide 7 by 3, you get a remainder of 1 (because 7 = 2 x 3 + 1). So, if you do modular arithmetic with a number like 7, you could say that 7 is congruent to 1 modulo 3. This is just a fancy way of saying that 7 and 1 have something in common when you divide by 3.

Now, the ICG takes a starting number (the seed) and performs some modular arithmetic on it to get a new number. Then it takes that new number and performs the same arithmetic to get another number. And so on. The math involved is carefully chosen so that the sequence of numbers appears random, but is actually related to the starting seed number in a very precise way.

One important thing to note is that the ICG is not perfect. It is possible to figure out the starting seed if you have enough of the generated numbers. So it's not suitable for things like encryption or security. But for things like simulations, modeling, and games, it can be really useful for generating random numbers in a predictable way.