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


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

- 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 Also
Tech Notes
History
Introduced in 1996 (3.0)
Text
Wolfram Research (1996), $RandomState, Wolfram Language function, https://reference.wolfram.com/language/ref/$RandomState.html.
CMS
Wolfram Language. 1996. "$RandomState." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$RandomState.html.
APA
Wolfram Language. (1996). $RandomState. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$RandomState.html
BibTeX
@misc{reference.wolfram_2025_$randomstate, author="Wolfram Research", title="{$RandomState}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/$RandomState.html}", note=[Accessed: 18-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_$randomstate, organization={Wolfram Research}, title={$RandomState}, year={1996}, url={https://reference.wolfram.com/language/ref/$RandomState.html}, note=[Accessed: 18-August-2025]}