A *number generator* starts with an initial number *s*_{0} and
produces a sequence of numbers
.
This initial
number *s*_{0} 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 *s*_{i+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 *s*_{0} 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 *s*_{i}. In other words, we could deduce the
*s*_{i} having seen
.
In practice, for most
applications, these pseudo random generators are more than sufficient.