The program cannot choose what it wants, because the computer doesn’t know what it means. “Choose what you want” is just not in the list of commands it can do. So you need to “explain” it to the computer using only things it can understand.
Moreover, there are usually some requirements on what exactly should be chosen. For example, the program can always “want’ to choose 4. But you would probably say, that a stream of 4s are not really that random. You probably want all numbers to appear equally likely. You may want pairs or triplets of numbers to be as random as singles, or you may not. You might want next number to be very hard to predict, or you might not. You might want a sequence to either be repeatable, or as unrepeatable as possible.
Depending on your needs, there are different programs that produce different random sequences:
* *Pseudo-random* generators are basically a big looping sequence of numbers, generated by some formula. They are repeatable: if you know the initial position, you can “play back” the same numbers. They are also might be predicted, if the someone guesses that initial position. But they are fast, and can have good statistics.
* *True random* generators produce numbers from some real unpredictable process. They cannot be predicted, and cannot be repeated. But real random processes are rarely fast, and rarely “fair” (which means, that different results can have unequal probability). They can also be manipulated, by influencing the “random box” somehow. They are used for random initial values for pseudo-random generators.
* *Cryptographic* generators are very hard to predict by observing only inputs. They are used for ciphering and security. They can be both pseudo-random and true random.
Latest Answers