A number generator starts with an initial number s0 and
produces a sequence of numbers
.
This initial
number s0 is called the seed for the sequence.
If the number generator was
producing a truly random sequence of numbers, then having seen the
partial sequence
,
for any i, it
is impossible to predict the number si+1.
Producing truly random sequences is impossible or at least extremely
difficult (and hints at some deep philosophic issues).
Instead, most languages
provide functions to generate pseudo random
numbers. Pseudo-random sequences also begin with a seed s0 and
produce a sequence
.
However, pseudo-random
sequences have a period, that is, there exists an i such that
and it is theoretically possible
to invert the generation function which takes
and produces si. In other words, we could deduce the
si having seen
.
In practice, for most
applications, these pseudo random generators are more than sufficient.