Skip to content

Pseudorandom Number Generator

A deterministic seeded algorithm that evolves finite internal state or a keyed counter to emit a reproducible sequence engineered to meet specified statistical or computational unpredictability criteria.

Version
v1 · 2026-08-30 · History
Domain-specific #
2568
Origin domain
computer science
Subdomain
random number generation
Aliases
PRNG

Core Idea

A pseudorandom number generator (PRNG) is a deterministic algorithm that expands a compact initialization value and internal state into a longer output sequence designed to resemble samples from a specified random source. The same algorithm, seed, parameters, and execution convention reproduce the same stream. “Random” therefore describes selected output properties or adversarial indistinguishability, not nondeterministic causation.[1][2]

Ordinary simulation generators emphasize period, equidistribution, low correlation, speed, and reproducible streams. Cryptographic generators add a threat model: outputs should be computationally unpredictable, and exposure of some output should not feasibly reveal past or future output beyond declared compromise limits. NIST calls standardized cryptographic constructions deterministic random bit generators (DRBGs) and separates their deterministic mechanism from entropy-source and seeding requirements.[3]

Structural Signature

Recognition roles:

  • deterministic transition or counter function;
  • finite internal state, key/counter pair, or equivalent compact configuration;
  • seed or instantiation input selecting an initial state;
  • output transformation mapping state to bits, integers, or real variates;
  • state advance preventing one output from merely repeating;
  • quality contract, statistical for simulation and computational for cryptography;
  • period/stream-management policy for recurrence, splitting, or reseeding; and
  • reproducibility invariant when initial conditions and implementation semantics match.

Not every role is exposed in an API. Counter-based generators can compute blocks by key and counter rather than mutate an opaque sequential state, but still instantiate the deterministic expansion identity.

What It Is Not

A PRNG is not a physical or nondeterministic random number generator. Physical entropy may seed or reseed one, but the expansion between such events remains deterministic. It is not a quasirandom low-discrepancy sequence: that construction deliberately fills a geometric domain evenly and is not intended to imitate independent random draws. It is not a hash function alone, though hashes can build DRBGs.[3]

Passing a statistical test suite does not establish cryptographic security, prove independence, or make a generator appropriate for every simulation. Conversely, deterministic reproducibility is not evidence of low quality; it is essential for debugging and controlled experiments. A cryptographically secure PRNG is a stricter subclass under an explicit adversarial contract, not a synonym for every PRNG.

Scope of Application

PRNGs drive Monte Carlo simulation, randomized algorithms, statistical resampling, games, procedural generation, numerical testing, load testing, cryptographic protocols, and key or nonce generation. Selection depends on use. A long-period fast generator may be appropriate for simulation yet unacceptable for secrets. A secure DRBG may be unnecessarily costly or awkward for parallel numerical streams.

The scope includes linear recurrences, lagged and combined generators, Mersenne Twister, xorshift-style state machines, counter-based families, and hash- or cipher-based DRBGs. It excludes postprocessing that merely maps already generated uniform values to another distribution; inverse CDF, rejection sampling, and transformation methods consume a uniform-bit source rather than replace its generator identity.

Clarity

Given state s_i, a stateful PRNG applies a transition s_(i+1)=T(s_i) and output map u_i=G(s_i) or G(s_(i+1)). Because the state space is finite, an unreseeded deterministic trajectory eventually repeats; a good period must also be usable rather than merely large. Correlation structure and output transformation matter before recurrence.[1]

The seed is not the whole design. Two algorithms given the same integer need not produce the same stream, and software version, word size, endianness, floating-point mapping, and parallel scheduling may alter reproducibility. A scientific record should name the algorithm and stream method, not only record “seed 42.”

Manages Complexity

A short state compactly generates as many variates as an application needs, avoiding storage of a truly random table. Determinism enables replay of failures, controlled comparison of algorithms, variance-reduction design, and partitioned parallel streams. Standard interfaces separate downstream sampling code from generator internals.

This compression creates structural risks. All streams come from a finite family; poor parameters produce lattice structure or correlations; accidental seed reuse couples experiments; naive parallelization overlaps substreams; a state compromise may expose a cryptographic stream. Generator quality is a contract linking mechanism, initialization, output use, and threat model.

Abstract Reasoning

Finite deterministic state implies eventual periodicity by the pigeonhole principle. It does not imply that every nonzero state lies on one maximal cycle. Linearity may permit algebraic analysis while creating predictable structure. A large period alone cannot establish good multidimensional distribution.[2]

For cryptographic DRBGs, security reasoning conditions on adequate entropy at instantiation, approved construction, protected state, correct reseeding, and requested security strength. NIST's generate function and state-update rules address this operational system; taking a noncryptographic simulation generator and hiding its seed does not create the same guarantee.[3]

For simulation, repeated results under several generator families can reveal generator-sensitive conclusions, but agreement cannot prove correctness. Stream-splitting and jump-ahead techniques should be justified against the selected transition rather than assumed from generic PRNG status.

Knowledge Transfer

The literal role package transfers among simulations, randomized data structures, games, tests, and cryptographic systems: seed/state, deterministic expansion, output, and quality contract remain. What changes is the contract. Simulation asks about distribution and correlation at computationally relevant scales; cryptography asks what a bounded adversary can predict.

The broader structure—small cause producing repeatable complex-looking behavior—appears elsewhere, but without algorithmic state and randomness criteria it is analogy. Randomness, Determinism, State Transition, and Compression capture the portable residues.

Examples

Linear congruential generator. State advances by x_(n+1)=(a*x_n+c) mod m. It makes determinism and period analysis transparent. Parameter choices decide whether the period is long, while higher-dimensional lattice artifacts show why period is not sufficient quality.[1]

Mersenne Twister. MT19937 uses a large linear state and a tempering transformation, with a famously long period and strong equidistribution goals for simulation. Its linear predictability makes it inappropriate for cryptographic secrets.[4]

Hash DRBG. A NIST construction maintains protected state, derives output through a hash-based process, updates state, and supports reseeding under defined limits. Its security claim depends on the full instantiation and entropy contract, not on statistical appearance alone.[3]

Nonexample—Sobol sequence. A Sobol construction targets low discrepancy for integration. Its deliberate uniform coverage is useful, but it does not instantiate a conventional pseudorandom stream.

Structural Tensions

  • Reproducibility versus unpredictability. Identical state guarantees replay while secrecy may require outputs to resist state inference. Diagnostic: state whether the quality contract is scientific replay or adversarial unpredictability.
  • Long period versus good local structure. A huge cycle may contain harmful correlations. Diagnostic: audit dimension-specific distribution and application behavior, not period alone.
  • Fast scalar stream versus parallel independence. Naive multiple seeds can create correlated or overlapping streams. Diagnostic: use documented splitting, parameterization, counter partitioning, or jump-ahead methods.
  • Test-suite success versus proof. Statistical tests detect some defects but cannot certify universal randomness or cryptographic security. Diagnostic: match tests and theoretical evidence to the consumption pattern.
  • Autonomy versus Algorithm plus Randomness. Those catalog nodes supply components. Diagnostic: remove seeded deterministic expansion and stream-quality obligations; if recognition fails, the PRNG residual remains.

Structural–Framed Character

The deterministic state machine is structural; quality is purpose-framed. A sequence can be excellent for one consumption dimension and weak for another. Cryptographic acceptability depends on adversary, entropy, compromise, and reseeding assumptions. The node therefore carries one skeleton with several explicitly noninterchangeable evaluation frames.

Structural Core vs. Domain Accent

The portable core is compact deterministic expansion under an appearance or indistinguishability contract. The domain accent includes seeds, state words, periods, equidistribution, spectral tests, substreams, entropy sources, security strength, and state compromise.

This is a domain-specific algorithmic abstraction, not a prime. prime:algorithm is the minimal literal superclass; Randomness explains the target behavior but not the deterministic mechanism.

PRNG is a specialization of prime:algorithm. It occupies the tension formalized by prime:stochasticity_vs_determinism and relates to Randomness, State Transition, Iteration, and Hashing. Monte Carlo Simulation is a major consumer, not the parent.

Relationships to Other Abstractions

Local relationship map for Pseudorandom Number GeneratorParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.PseudorandomNumber GeneratorDOMAINPrime abstraction: Algorithm — is a kind ofAlgorithmPRIME

Current abstraction Pseudorandom Number Generator Domain-specific

Parents (1) — more general patterns this builds on

  • Pseudorandom Number Generator is a kind of Algorithm Prime

    PRNG is a specialization of prime:algorithm.

Hierarchy paths (2) — routes to 2 parentless roots

Neighborhood in Abstraction Space

Pseudorandom Number Generator sits in a sparse region of the domain-specific corpus (83rd percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Unclustered & Miscellaneous (1565 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-09-08

Not to Be Confused With

  • True/hardware RNG: samples nondeterministic physical processes.
  • Entropy source: supplies uncertain input for seeding; does not perform deterministic expansion.
  • CSPRNG/DRBG: security-qualified subclass with explicit threat and state rules.
  • Quasirandom sequence: low-discrepancy deterministic design for numerical integration.
  • Random oracle: idealized cryptographic model, not an implementable generator.
  • Hash function: mapping primitive that may be used inside a generator.
  • Distribution sampler: transforms uniform bits into a target law.
  • Seed: initializer, not the algorithm or generated stream.

References

[1] Donald E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, third edition, Addison-Wesley, 1997, Chapter 3, ISBN 978-0-201-89684-8. registry ↩a ↩b ↩c

[2] Pierre L'Ecuyer, “Random Number Generation,” in Handbook of Computational Statistics, second edition, Springer, 2012, https://doi.org/10.1007/978-3-642-21551-3_2. registry ↩a ↩b

[3] Elaine Barker and John Kelsey, NIST SP 800-90A Revision 1, Recommendation for Random Number Generation Using Deterministic Random Bit Generators, 2015, https://doi.org/10.6028/NIST.SP.800-90Ar1. registry ↩a ↩b ↩c ↩d

[4] Makoto Matsumoto and Takuji Nishimura, “Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator,” ACM Transactions on Modeling and Computer Simulation 8 (1998): 3–30, https://doi.org/10.1145/272991.272995. registry