Probability

Random Seed

Two pupils initialize matching patterned machines with identical tokens.

Random Seed definition

A random seed is a value used to initialize a pseudorandom number generator.

In Spanish
semilla aleatoria
Topic
Probability simulation and sampling

Random Seed in a picture

Random Seed diagramTwo copies of the same setup initialized with seed 42 produce the same sequence of outputs.Choose seed 42Use it to initialize the stateRun the simulationThe generator makes each draw in orderRestart with the same setupThe same draws can be reproduced
Two copies of the same setup initialized with seed 42 produce the same sequence of outputs.

How it works

With a specified generator and setup, using the same seed gives the same starting state and reproducible sequence. Record the generator and software configuration if exact reproduction matters, since the same numerical seed can map to different sequences in different systems.

Worked examples

How can you repeat a particular simulation run?

Record the seed, generator, and configuration, and repeat the same calls.

Should you reset to the same seed before every trial in one experiment?

Usually no. That can repeat the same draws instead of producing different trials.

Must a seed itself be generated randomly?

No. A fixed seed is useful when reproducing a run.

Common mistake

Set a reproducibility seed at the start of an experiment. Reinitializing on every draw can keep returning the same first value.

Quick check

What does a seed initialize?

Does the same number guarantee matching outputs across every library?

Show answer

No. The generator and setup also matter.

Can you use a fixed seed for debugging?

Show answer

Yes.

Sources

Flashcard

Random Seed

Reveal the definition

A random seed is a value used to initialize a pseudorandom number generator.

Effortless Math. “Random Seed.” Math Dictionary.