that if is a pseudo-random number generator for the uniform distribution on and if is the CDF of some given probability distribution , then is a pseudo-random number generator for , where is the percentile of , i.e. . Intuitively, an arbitrary distribution can be simulated from a simulation of the standard uniform distribution. 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 then available, 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. A recent innovation is to combine the middle square with a Weyl sequence. This method produces high-quality output through a long period (see middle-square method). Non-uniform generators Numbers selected from a non-uniform probability distribution can be generated using a uniform distribution PRNG and a function that relates the two distributions. First, one needs the cumulative distribution function of the target distribution : Note that . Using a random number c from a uniform distribution as the probability density to "pass by", we get so that