As of Version 6.0, has been superseded by the scoping construct BlockRandom.

gives a representation of the internal state of the pseudorandom generator used by Random.


  • The value of changes every time Random is called.
  • You can use s=$RandomState to explicitly save the value of , and $RandomState=s to restore.
  • The value of is always a long integer chosen from a certain large set of possibilities. You can assign only to values in this set.
  • You can use Block[{$RandomState}, expr] to localize the value of during the evaluation of expr.
New in 3
New to Mathematica? Find your learning path »
Have a question? Ask support »