Randomness and Generators

Pseudorandom vs True Random Numbers

Compare algorithmic generators with physical randomness sources, what each is good at, and why the difference rarely matters for games but sometimes does for security.

On this page
  1. Two ways to get unpredictable numbers
  2. What pseudorandom generators do well
  3. What physical sources do well
  4. In practice: use both
  5. When the difference matters
  6. Gambling machines and trust
  7. Which should you trust?

Slots are games of chance with a built-in house edge. No strategy, system or timing changes the odds, most players lose money over time, and nobody should gamble money they cannot afford to lose. Whether a game’s numbers come from an algorithm or from physical noise makes no difference to that fact, and this article explains what difference it does make.

Two ways to get unpredictable numbers

Pseudorandom numbers come from an algorithm. The generator holds an internal state, updates it with a fixed rule, and outputs values derived from it. Given the same starting state, it always gives the same sequence.

True random numbers come from measuring a physical process whose outcome is not determined by anything the computer controls. Examples include electrical noise in a circuit, timing variation between clocks, and quantum events such as photon detection or radioactive decay. Repeating the experiment does not reproduce the output.

The phrase “true randomness” is a little loose. Physical sources are never perfect: they have biases and can be influenced by temperature, hardware faults or an attacker with physical access. They require careful processing, as described under entropy sources.

What pseudorandom generators do well

  • Speed. An algorithm can produce enormous quantities of numbers very quickly, far beyond what most physical sources can deliver.
  • Repeatability. Using the same seed value replays the same sequence. This is valuable for debugging, scientific reproducibility and sharing a game world by a code.
  • No special hardware. They run on any device.
  • Predictable statistics. Designers can analyze the algorithm and prove properties, including period, uniformity and correlation behavior.

Their main weakness is that the output is only as unpredictable as the seed. Someone who learns the algorithm and the state can compute every future value. Simple generators can also show structure when output is examined closely, which is what randomness tests try to detect.

What physical sources do well

  • Fresh unpredictability. There is no hidden formula to discover.
  • Independence from software state. Cloning or rewinding a program cannot reproduce the physical noise.

Their weaknesses are practical. They are often slow, they need hardware, their raw output is biased or correlated and must be conditioned, and they can fail silently if a component degrades. Because proving their quality is difficult, designers typically treat them as inputs rather than as finished products.

In practice: use both

Most modern systems combine the two. A physical or system-level source supplies a modest amount of entropy, which seeds a cryptographically secure pseudorandom generator. That generator then provides as many numbers as needed, and new physical input is mixed in over time. The result is fast, hard to predict, and not dependent on any single physical component. When people say a computer generates “random numbers,” this hybrid is usually what is happening, as described in the broader overview of computer randomness.

When the difference matters

For some tasks the choice is important:

  • Cryptographic keys and security tokens. These need unpredictability against an adversary, so the seed must have real entropy and a secure generator is required.
  • Scientific simulation. Repeatability and long periods are often more valuable than physical randomness. See generator period for why the length of the cycle matters.
  • Lotteries and draws with public scrutiny. Physical devices such as ball machines are sometimes chosen partly because the public can watch them, which supports trust.

For ordinary entertainment, such as shuffling in a card game or placing items in a level, a good pseudorandom generator is entirely adequate. A player cannot tell the difference, and no statistical test would reliably distinguish a good pseudorandom stream from physical noise.

Gambling machines and trust

Electronic slot-style games generally rely on pseudorandom generators. That is not a flaw: what matters for fairness is that the generator is unbiased, properly seeded, and that its output is mapped to outcomes as documented. Independent testing laboratories and a licensing authority, where one exists, commonly review these points, but requirements vary and some jurisdictions have little oversight. A physical source would not change the house edge, and a pseudorandom one does not weaken the game’s fairness in any way a player could detect or use.

It is also worth being clear about what neither type enables. Whether the source is algorithmic or physical, each result is statistically independent of previous ones. Ideas that a machine can be read, predicted or caught out are covered by rigged games discussions and randomness misconceptions; for a player with no access to the system’s internals, a well-designed generator is simply unpredictable.

Which should you trust?

Trust depends on design, review and use, not on the label. A carefully designed hybrid system is stronger than a poorly shielded physical device, and a badly seeded algorithm is weaker than either. The words “true random” in marketing do not tell you whether a game is fair, and they say nothing about payout.

If you choose to gamble, set limits on time and money before you play, treat it as paid entertainment, never chase losses, and take breaks. A national problem-gambling helpline or local health service can provide confidential support. Gambling is age-restricted or illegal in many places, and rules differ by country.

The complete guide to randomness and generators

How Computers Generate Random Numbers
Read the guide

Keep exploring

Guides from other topics

All topics →