Abstract visualization of random numbers and mathematical formulas
  Documentation Tips & Best Practices

What Random Number
Generators Do We Use?

Engaged Nation Team
  March 24, 2026   12 min read Tips

Fairness is the foundation of any promotional game or drawing. Whether a player spins a wheel, flips a card, or waits to hear their name called at a drawing event, they're trusting that the outcome is genuinely random — not influenced, not predictable, and not repeatable. That trust is earned through the quality of the random number generation behind the system.

This article explains exactly how randomness works inside Promo on Demand — both in our games and in our drawing tool — as well as the broader science of what makes an RNG trustworthy, what makes one fail, and how you can see the principles in action for yourself with an interactive simulation at the bottom of this page.

What Is a Random Number Generator?

A Random Number Generator (RNG) is any process or mechanism that produces a value — or a sequence of values — that cannot be predicted in advance. The key word is unpredictability. A sequence that looks random but can be reproduced if you know the starting conditions doesn't meet the bar for true randomness, at least not for security-sensitive applications.

In practice, RNGs fall into three broad families, each with different characteristics, strengths, and appropriate use cases:

🌡️
TRNG
True Random Number Generator

Harvests randomness from physical phenomena — atmospheric noise, thermal fluctuations, radioactive decay, or quantum events. Genuinely unpredictable because it draws from the real world. Used in hardware security modules and high-stakes cryptographic key generation.

⚙️
PRNG
Pseudorandom Number Generator

Uses a deterministic algorithm seeded with an initial value to produce a sequence that appears random and passes statistical tests. Fast, efficient, and statistically excellent for simulations and games. The quality varies enormously between implementations.

🔐
CSPRNG
Cryptographically Secure PRNG

A PRNG that meets additional standards, making it resistant to being reverse-engineered even if an attacker knows previous outputs. Required for passwords, tokens, and encryption keys. Examples include crypto.getRandomValues() in modern browsers.

Conceptual illustration of an early random number generating machine
Long before software, physical machines were built specifically to generate random sequences — a problem engineers have grappled with for over a century.

How a PRNG Works — and What Makes It Trustworthy

Every PRNG starts with a seed — an initial numeric value that is fed into a mathematical formula. The formula transforms the seed into an output number, then feeds that output back in as the new seed. Repeat this billions of times and you have a stream of numbers that have no obvious pattern, even though every single one was mathematically derived from the first.

Two properties determine whether a PRNG is trustworthy:

A PRNG that passes these tests produces output that is, for all practical purposes, indistinguishable from true randomness in any application where the seed itself is not known to the observer.

When RNGs Go Wrong

Not all generators are created equal. The history of computing is littered with RNG implementations that appeared to work fine but harbored hidden patterns — patterns that only became visible under statistical analysis or through specific attack vectors. Here are three well-known failures, and why they matter:

RANDU (IBM, 1960s)

One of the most infamous failures in computing history. RANDU was a widely distributed random number library that produced numbers arranged in just 15 distinct planes in three-dimensional space — meaning any set of three consecutive RANDU outputs was predictable. Monte Carlo simulations run using RANDU produced subtly wrong results for decades before the flaw was discovered. Published scientific papers using it had to be re-examined.

Linear Congruential Generators (naive implementations)

LCGs use the formula seed = (a × seed + c) % m and can work well when the constants are chosen carefully. Poorly chosen constants produce outputs with strong serial correlations — sequential numbers that cluster in predictable ways. Early video game RNGs frequently used LCGs with bad constants, making in-game randomness exploitable by players who learned the patterns.

Weak seed sources

Even a mathematically perfect PRNG becomes predictable if its seed is weak. Early web applications sometimes seeded RNGs using the current timestamp in milliseconds — a value that an attacker who knew approximately when the seed was set could reconstruct with only a few thousand guesses. The randomness of the output is only as strong as the entropy of the seed.

We do not use any of these approaches in Promo on Demand. Our games and drawing tool rely on the RNG implementations built into modern browser engines — which have been through decades of scrutiny, public testing, and continuous improvement by some of the largest engineering organizations in the world.

RNG in Our Games

Every P.O.D. game runs entirely in a modern web browser — Chrome, Edge, Safari, or Firefox. These browsers implement JavaScript's Math.random() function using a state-of-the-art algorithm called xorshift128+ (used in V8, the engine powering Chrome and Edge) or equivalent high-quality generators in other engines.

Xorshift128+ maintains 128 bits of internal state, has an enormous period before any sequence repeats, and passes the full TestU01 Big Crush battery — the most demanding statistical test suite in existence. It is seeded automatically by the browser using high-entropy system sources at startup, meaning the seed itself is unpredictable.

Conceptual illustration of a complex mechanical random number generator with rolling digits
Modern software RNGs achieve in microseconds what physical machines spent decades trying to accomplish mechanically — and with far greater statistical quality.

Within each game, randomness is applied at two distinct levels:

  Outcome Selection Probability-weighted draw

When a player triggers a game, the system builds an array of possible outcomes weighted by the odds you configured in the customization panel. If Prize A has 30% odds and Prize B has 70% odds, the array is proportionally populated with 30 instances of Prize A and 70 of Prize B (scaled to 100 total). A single call to Math.random() selects a random index from that array. Because each index is equally likely to be chosen — and the array is proportionally populated — the configured odds are honored precisely over a sufficient number of plays. There is no fixed cycle, no pattern, and no memory of previous outcomes.

  Position & Layout Shuffling Fisher-Yates algorithm

Games that reveal items in a grid or sequence — such as card-based games and spot-reveal formats — use the Fisher-Yates shuffle to randomize the position of elements before each play. Fisher-Yates is the mathematically proven algorithm for producing a uniformly random permutation of any list: every possible arrangement is equally likely. Each element is swapped with a randomly chosen element from the remaining unshuffled positions, guaranteeing no arrangement is favored over another. It is the standard algorithm used wherever unbiased shuffling is required.

RNG in Our Drawing Tool

The drawing tool operates on a pool of eligible participants — your uploaded player list. When a draw is initiated, the system performs a random selection from the active, undrawn entries in the pool. Previously drawn participants are excluded from subsequent draws within the same session, ensuring no player can be selected twice.

The Lottery Tool's visual ping-ball animation is exactly that — a visual representation. The winner has already been determined by the RNG before the first ball starts moving. The animation builds anticipation and creates an engaging floor experience, but it has no bearing on the outcome. The selection mechanism operates independently and impartially before the display begins.

The audit trail records the exact timestamp of every draw, the winner selected, and the staff member who initiated it — providing a complete, verifiable chain of custody for every promotional event you run.

How Randomness Is Validated: Statistical Testing

Claiming that an RNG is random is not enough — it has to be demonstrated. The way this is done in practice is through standardized statistical test suites that probe for every known type of non-randomness. The three most respected are:

The RANDU generator mentioned earlier fails the Diehard tests spectacularly — which is how its fundamental flaw was formally identified long after it had already been distributed and used widely.

See It For Yourself: Live Monte Carlo Simulation

A Monte Carlo simulation runs a random process hundreds or thousands of times and observes how the outcomes distribute. It's one of the primary tools statisticians use to verify that a random process is actually behaving randomly. The name comes from the Monte Carlo Casino in Monaco — an early inspiration for probabilistic modeling.

The simulation below uses JavaScript's Math.random() — the same RNG powering every P.O.D. game — to flip a virtual coin 500 times and track how the cumulative percentage of heads evolves over those flips. In a fair coin flip, the expected outcome is exactly 50% heads. Watch what happens:

500-Flip Monte Carlo Coin Simulation
Each run uses Math.random() — the same engine behind P.O.D. games. The line should converge toward 50% as flips accumulate.
Heads
Tails
Final % Heads
Each run produces a different result — but the final percentage will always land close to 50%. Click "Run Again" to generate a new sequence.

Notice a few things as you run this repeatedly:

Sample Size and the Law of Large Numbers

The convergence you just observed has a formal name: the Law of Large Numbers. Stated plainly: as the number of independent trials of a random process increases, the observed average outcome will converge toward the theoretical expected value.

This is not a quirk or a coincidence — it is a mathematical theorem, first proven rigorously by Jacob Bernoulli in 1713. It has profound practical implications for anyone running promotional games:

📊

The Law of Large Numbers in practice: If your highest-value prize has 1% odds, you should expect approximately 1 winner per 100 plays — but any individual 100-play event could produce 0 or 3 winners. Over 1,000 plays, you'll see very close to 10 winners. Plan prize budgets for the long run, and carry a contingency for short-run events.

Budget Projection: Your Pre-Flight Check

Because the Law of Large Numbers takes time to work, we've built a practical tool directly into the game customization page: the Budget Projection. Before you save and launch any promotion, you can open this tool to see a forward-looking estimate of how your configured odds will translate into winners and total payout across a given number of plays.

Budget Projection tool showing prize spots, odds percentages, expected winners, and total payout across 100 game plays
The Budget Projection tool — enter your expected number of game plays and see a full breakdown of projected winners and cash/entry payouts for each prize tier.

Enter the number of plays you expect to run and click Update. The tool calculates:

Try different play counts — 50, 200, 500 — to understand how your budget scales. This is the recommended step before every new promotion: confirm the projected payout is within your budget before a single player takes a turn.

In Summary: How We Approach Fairness

Fairness in a promotional game isn't just an ethical obligation — it's the only way the experience works at all. Players who suspect an outcome is influenced or rigged disengage immediately. The credibility of every promotion you run depends on the integrity of the randomness behind it.

Here is how Promo on Demand approaches that responsibility:

If you ever have questions about the randomness or fairness of a specific result, the audit trail is your first resource. Every outcome was generated by the same mechanism described in this article — transparent, testable, and built on three decades of browser engine development. Contact our team if you'd like to discuss any aspect of how randomness is handled in your promotions.

Was this article helpful? Browse more guides in our documentation library.

View All Documentation