This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
[an error occurred while processing this directive] $RandomState

  • $RandomState gives a representation of the internal state of the pseudorandom generator used by Random.
  • The value of $RandomState changes every time Random is called.
  • You can use s = $RandomState to explicitly save the value of $RandomState, and $RandomState = s to restore.
  • The value of $RandomState is always a long integer chosen from a certain large set of possibilities. You can assign $RandomState only to values in this set.
  • You can use Block[ $RandomState , expr ] to localize the value of $RandomState during the evaluation of expr.
  • See the Mathematica book: Section 3.2.3.
  • See also: SeedRandom.