Graph
Pseudorandom Number Generator

🔁Pseudorandom Number Generator

NEW

Also known as: PRNG

An algorithm that deterministically expands a short seed into a long sequence whose statistical properties approximate true randomness.

DESCRIPTION

A pseudorandom number generator (PRNG) uses deterministic rules to produce sequences that appear random for simulations, sampling, and algorithms. Quality PRNGs have long periods, good equidistribution, and minimal correlations. For cryptographic use, specialized CSPRNGs resist state recovery and prediction under adversarial models. Popular families include linear congruential generators, Mersenne Twister, xorshift, and PCG, each with trade-offs in speed, quality, and memory. Reproducibility is a major advantage: the same seed yields identical sequences. Selection should consider use case, parallel streams, jump-ahead capabilities, and statistical testing.

ALTERNATIVE DEFINITIONS

Wikipedia

A pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG), is an algorithm for generating a sequence of numbers whose properties approximate the properties of sequences of random numbers.

Connects PRNGs to DRBG terminology and emphasizes approximation of randomness.

Source

NIST SP 800-90A

A DRBG is a mechanism that generates a sequence of bits that appears to be random and is determined by an initial value called a seed.

Formalizes deterministic generation and the role of the seed from a standard body.

Source

Wolfram MathWorld

Pseudorandom numbers are number sequences generated by a deterministic algorithm that mimics true randomness.

Focuses on deterministic generation and mimicry of randomness.

Source

Cloudflare Learning

A pseudorandom number generator is an algorithm for generating a sequence of numbers whose properties approximate those of random numbers.

Accessible explanation targeting practical understanding in security contexts.

Source

Random Number Generator Deterministic Random Bit Generator Seed Mersenne Twister Linear Congruential Generator Xorshift Permuted Congruential Generator SplitMix64 Randomness Testing

COMPETING TERMS

True Random Number Generator Cryptographically Secure Pseudorandom Number Generator

RELATIONS

KNOWLEDGE AREAS

Mathematics Data Security Data Science Testing & Validation Software Engineering

TARGET AUDIENCE

Data Scientist Software Developer Cybersecurity Engineer Security Architect AI Engineer Data Engineer

EXTERNAL SOURCES

TOP QUESTIONS

Why choose a Pseudorandom Number Generator over a True Random Number Generator?

PRNGs are fast, reproducible, and easy to parallelize, making them ideal for simulations and ML pipelines. TRNGs suit unpredictability needs but are slower and harder to replicate.

Category: Opinion

What makes a good Pseudorandom Number Generator?

Long period, strong equidistribution, minimal correlations, efficient jump-ahead/streaming, and consistent performance across platforms define quality.

Category: Requirements

Are all Pseudorandom Number Generators cryptographically secure?

No. Only CSPRNGs withstand adversarial prediction. Many PRNGs like Mersenne Twister are unsuitable for secrets.

Category: Misunderstanding

How does seeding affect a Pseudorandom Number Generator?

Seed determines the output sequence. Use high-quality seeds for independence across streams; document seeds for reproducibility.

Category: BestPractice

What are common mistakes with Pseudorandom Number Generators?

Using small seeds, overlapping streams without jump-ahead, and relying on default PRNGs for cryptography are frequent errors.

Category: Mistakes

PCG, xoshiro/xoroshiro, SplitMix64, and Philox/Threefry (counter-based) are widely used for performance and statistical quality.

Category: Topic

How do you parallelize Pseudorandom Number Generators safely?

Use independent streams via parameterization, jump-ahead, counter-based designs, or splittable generators to prevent overlap.

Category: BestPractice

What tests validate a Pseudorandom Number Generator?

Use TestU01, PractRand, and NIST SP 800-22. Consider structural analysis beyond statistical tests.

Category: Testing

What is the risk of using Mersenne Twister in security?

Its state can be reconstructed from outputs, allowing prediction. Never use it for keys, tokens, or nonces.

Category: Risk

How does a Deterministic Random Bit Generator relate to a PRNG?

DRBG is a standardized, cryptographically oriented PRNG defined by NIST, with strict seeding and security requirements.

Category: Concept