Home/Glossary/Pseudorandom number generator

Glossary · Probability

Pseudorandom number generator

A pseudorandom number generator is a deterministic algorithm that turns a starting value called a seed into a long stream of numbers that pass statistical tests for randomness while remaining exactly reproducible from that seed.

Pseudorandom number generator, in full

Category
Probability
Also called
PRNG, Seeded random number generator
In the glossary
All 75 terms, A–Z

A worked example

The same idea with real numbers attached.

Ask for today's numbers with no birth date saved and the seed is just the ISO date and the tool name joined by a middle dot. xmur3 hashes that short string down to one 32-bit integer, the integer initialises mulberry32, and the stream that follows picks the set. Reload the page, switch device, come back at 11pm: identical numbers. At midnight the date changes, the hash changes, and everything downstream changes with it.

Sources

Every dated or checkable claim above, with where it came from.

See also

The terms that sit closest to this one.

Where it comes up on this site

Pseudorandom number generator: frequently asked

No. The whole sequence is fixed the moment the seed is chosen, and anyone holding the seed and the algorithm can reproduce it exactly. What a good PRNG gives you is output that passes statistical tests, which is enough for simulation, games and a daily pick you want to stay put.

Yes. V8 uses xorshift128+, and the specification promises no security and no way to set the seed.

So the numbers hold still. Same date and same birth date, same set, at 9am and at 11pm, on a phone and on a laptop.

More probability terms

The rest of the vocabulary

Lottery mechanics, probability, numerology and astrology, defined in one A–Z.

Open the glossary