is an option that specifies what seeding of pseudorandom generators should be done inside the operation of a function.
RandomSeeding
is an option that specifies what seeding of pseudorandom generators should be done inside the operation of a function.
Details
- Possible settings are:
-
Automatic automatically reseed every time the function is called Inherited use externally seeded random numbers RandomGeneratorState[…] a RandomGeneratorState object seed use an explicit integer or string as a seed
Examples
open all close allBasic Examples (1)
Give an explicit random seeding for FindInstance:
FindInstance[Element[x, Reals], {x}, RandomSeeding -> 1234]The result will always be the same with this seeding:
FindInstance[Element[x, Reals], {x}, RandomSeeding -> 1234]With the default Automatic seeding, a different seed is used for each instance:
FindInstance[Element[x, Reals], {x}, RandomSeeding -> Automatic]FindInstance[Element[x, Reals], {x}, RandomSeeding -> Automatic]Scope (1)
Use externally seeded random numbers for FindInstance:
SeedRandom[1234]FindInstance[Element[x, Integers], {x}, RandomSeeding -> Inherited]Repeated evaluations with no intervening use of randomness will give the same result:
FindInstance[Element[x, Integers], {x}, RandomSeeding -> Inherited]If randomness is requested between evaluations, the state will change:
RandomInteger[9, 10]FindInstance[Element[x, Integers], {x}, RandomSeeding -> Inherited]RandomSeeding->Inherited causes FindInstance to effectively use BlockRandom:
BlockRandom[RandomInteger[9, 10]]FindInstance[Element[x, Integers], {x}, RandomSeeding -> Inherited]Properties & Relations (1)
RandomSeeding->Inherited uses the current random state:
SeedRandom[2];BlockRandom[RandomReal[], RandomSeeding -> Inherited]RandomReal[]RandomSeeding->Automatic completely ignores the current random state:
SeedRandom[2];BlockRandom[RandomReal[], RandomSeeding -> Automatic]RandomReal[]See Also
Text
Wolfram Research (2017), RandomSeeding, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomSeeding.html (updated 2020).
CMS
Wolfram Language. 2017. "RandomSeeding." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/RandomSeeding.html.
APA
Wolfram Language. (2017). RandomSeeding. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RandomSeeding.html
BibTeX
@misc{reference.wolfram_2026_randomseeding, author="Wolfram Research", title="{RandomSeeding}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RandomSeeding.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_randomseeding, organization={Wolfram Research}, title={RandomSeeding}, year={2020}, url={https://reference.wolfram.com/language/ref/RandomSeeding.html}, note=[Accessed: 12-June-2026]}