Recently I was kicking around the idea of calculating and storing every possible series of random numbers. Possessing every random number seems comforting... sort of the same feeling as having just done a load of laundry and every piece of your clothes is clean and folded in a dresser.
Isn't the number of random number series infinite? Not on computers. Computers use formulas to generate series of random numbers and those formulas have limitations (usually stemming from the default maximum integer value for the operating system).
Because the random numbers are created using formulas, they're more correctly referred to as pseudorandom
When using a pseudorandom number generator, programmers prime the pump by providing it a seed
value. The seed is an arbitrary number (most often the current time) and is the source of unpredictability for the number generator. A series of random numbers created by a pseudorandom number generator (using a particular seed value) will begin repeating within 2n
-1 results (where n is the bit size of the seed number). A Sony PS3 console runs at 218 gigaFLOPS—i.e, 218 billion floating-point operations per second. Assuming a 32-bit seed value and 100 floating-point operations for each generated pseudorandom number, a PS3 could run through the entire series of random numbers associated with a particular seed in 1.97 seconds. A 32-bit number has 4,294,967,295 possible seeds values (again, 2n
-1 where n is 32), so it would take 268 years for a single PS3 to go through every possible series of random numbers.
Still with me?
It occurred to me that using distributed computing
(where many people allow me to use a bit of their computers' processing power) it would be possible to calculate every series of random numbers in a reasonable amount of time (perhaps a year or two, depending on how many people were participating in the project). However, there's the problem of storage.
Assuming the generated random numbers can have up to 5 digits, each number would require 17-bits of storage. So the storage space would be (using hard drive manufacturer's standard of expressing storage size in powers of 10 rather than powers of 2):
17 [bits] * 232
-1 [seeds] * 232
-1 [length of series]
/ (8 [bytes] * 1000 [KB] * 1000 [MB] * 1000 [GB] * 1000 [TB])
So, unfortunately, such a project would require 3.92 * 107
terabytes... that's just not possible. I'm sure before too long that sort of storage will be possible & affordable, but by then 64-bit operating systems will be the standard, so the number of seeds and the length of the number series increase to 264