Most computers use pseudo-random number generation. They start with a number, called the “seed” that they get from somewhere (often the exact time when the request is made, represented as the number of milliseconds from some fixed reference time). Then they run that number through a bunch of mathematical functions. It’s not really important what these functions are so long as, to a human, it’s very hard to predict what number will come out.
So, without knowing what code Siri actually uses, a rough approximation of the process is:
1. Siri notes that the time is 2:10 and sets the seed, S, to 210
2. Siri calculates X = floor(sqrt(S^3/150 + 10709))
3. Turns out X is 269 (could you have guessed?)
4. Siri returns the last digit, 9
To get another number, Siri can use the one it just generated as the new seed. In principle, if you know the code in the random number generator and you know the seed, you can predict not just the next number but the whole series of numbers it will generate. This is fine for casual purposes like games and simple decisions, but it’s not great for high-security things like cryptography. In those cases, they use “truly random” sources, like the weather or (no joke) a lava lamp.
Latest Answers