Room for ChanceThe science of chance

Science collection

Random number generators

Inspect sources, seeds and algorithms. Learn how unbiased bounded integers become valid selections.

Start with Random Number Generators: From Entropy to a Fair Choice, then follow the questions below. Each guide includes a worked explanation, a figure and routes to an experiment or calculator.

Random number generators

Random Number Generators: From Entropy to a Fair Choice

Understand how random number generators combine a source, an algorithm and a mapping—and why each stage matters for fair lottery selections.

3 min read · Formula & figure

Random number generators

Cryptographically Secure Random Numbers: What the Claim Means

Learn why CSPRNGs concern unpredictability, why Math.random is different, and why a secure source still needs unbiased range conversion.

3 min read · Formula & figure

Random number generators

How RoomForChance Generates Random Numbers: An Inspectable Method

An implementation-level explanation of RoomForChance’s browser random source, rejection sampling, partial shuffle and separate simulation methodology.

3 min read · Formula & figure

Random number generators

How to Generate Random Numbers Without Repetition

Learn two fair methods for distinct random numbers, why sorting is safe, and why filtering patterns changes the distribution.

3 min read · Formula & figure

Random number generators

Modulo Bias Explained: Why a Random Byte Makes an Unfair Die

See the exact 256-to-6 mapping behind modulo bias, calculate the imbalance, and understand how rejection sampling removes it.

3 min read · Formula & figure

Random number generators

Rejection Sampling: How Discarding Values Can Preserve Fairness

A practical derivation of rejection sampling for integer ranges and distinct lottery numbers, with efficiency and failure cases explained.

3 min read · Formula & figure

Random number generators

True Random vs Pseudorandom: Which Difference Matters?

Compare physical entropy and deterministic random streams without confusing reproducibility, statistical quality and cryptographic security.

3 min read · Formula & figure

Random number generators

What Is a Random Seed? Reproducing an Experiment Correctly

A random seed is only part of a reproducible simulation. Learn why the algorithm, versions and sequence of calls must also be recorded.

3 min read · Formula & figure