Skip to content

SeedRandom ​

Reseeds the random generator RandomInteger draws from.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageSeedRandom!
SeedRandom(seed)reseeds the generator; returns Nothing.
Typed signatures
TypePackageApplies
(integer?) state -> anycombinatoricsalways
(integer?) state -> anystatisticsreplaces combinatoricsalways

Domain: Collections

Details
  • One generator per engine instance: RandomInteger draws from it, and the same seed always starts the same sequence.
  • Our generator is our own (a small deterministic PRNG), not Wolfram's Mersenne-twister-based one — a shared seed value does not draw the same numbers as Wolfram would.

Examples

Basic #
live ↗
InSeedRandom(7)\mathrm{SeedRandom}(7)OutNothing\mathrm{Nothing}
Scope #

Seeding pins the next RandomInteger draw

live ↗
InLast([SeedRandom(7),RandomInteger(100)])\mathrm{Last}(\bigl\lbrack\mathrm{SeedRandom}(7), \mathrm{RandomInteger}(100)\bigr\rbrack)Out11
About
Examples2
Checked againstWolfram Language 2 differ
CrosswalkWolfram Language

See also: RandomInteger