Early Approaches
An early computer-based PRNG, suggested by John von Neumann in 1946, is known as the middle-square method. The algorithm is as follows: take any number, square it, remove the middle digits of the resulting number as the "random number", then use that number as the seed for the next iteration. For example, squaring the number "1111" yields "1234321", which can be written as "01234321", an 8-digit number being the square of a 4-digit number. This gives "2343" as the "random" number. Repeating this procedure gives "4896" as the next result, and so on. Von Neumann used 10 digit numbers, but the process was the same.
A problem with the "middle square" method is that all sequences eventually repeat themselves, some very quickly, such as "0000". Von Neumann was aware of this, but he found the approach sufficient for his purposes, and was worried that mathematical "fixes" would simply hide errors rather than remove them.
Von Neumann judged hardware random number generators unsuitable, for, if they did not record the output generated, they could not later be tested for errors. If they did record their output, they would exhaust the limited computer memories available then, and so the computer's ability to read and write numbers. If the numbers were written to cards, they would take very much longer to write and read. On the ENIAC computer he was using, the "middle square" method generated numbers at a rate some hundred times faster than reading numbers in from punched cards.
The middle-square method has since been supplanted by more elaborate generators.
Read more about this topic: Pseudorandom Number Generator
Famous quotes containing the words early and/or approaches:
“next to of course god america i
love you land of the pilgrims and so forth oh
say can you see by the dawns early my
country tis of centuries come and go
and are no more what of it we should worry
in every language even deafanddumb
thy sons acclaim your glorious name by gorry
by jing by gee by gosh by gum”
—E.E. (Edward Estlin)
“You should approach Joyces Ulysses as the illiterate Baptist preacher approaches the Old Testament: with faith.”
—William Faulkner (18971962)