This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Mathematical Functions / Random Numbers  /
SeedRandom

  • SeedRandom[ n ] resets the pseudorandom number generator, using the integer n as a seed.
  • SeedRandom[ ] resets the generator, using as a seed the time of day.
  • You can use SeedRandom[ n ] to make sure you get the same sequence of pseudorandom numbers on different occasions.
  • You can also use SeedRandom[" string "], although the seed set in this way may be different on different computer systems.
  • See the Mathematica book: Section 3.2.3.
  • See also: Random, $RandomState.

    Further Examples

    This seeds the random number generator.

    In[1]:=

    Here is a list of 4 random numbers between 0 and 1.

    In[2]:=

    Out[2]=

    In[3]:=

    After reseeding the random number generator, you get the same sequence of random numbers.

    In[4]:=

    Out[4]=