A random number generator is a pipeline, not a magic button. It obtains or maintains an unpredictable state, produces a stream of values, and maps those values into the outcomes an application needs. A weakness at any stage can undermine the result, even if another stage is excellent.
For a lottery number picker, the relevant question is not simply “Does it use random numbers?” It is “Does the complete procedure give every permitted combination the intended probability?”
The source and the algorithm do different jobs Physical processes can provide entropy: uncertainty that an observer cannot readily predict. Software can then use a deterministic algorithm to expand an internal state into a long stream. A pseudorandom generator repeats its stream when started from the same state; that reproducibility is valuable in scientific experiments.
Cryptographic generators are designed for a stronger requirement: observing previous output should not make future output practically predictable under the stated security assumptions. A long period or a smooth histogram does not establish that property. Statistical appearance and resistance to an attacker are different requirements.
A good source can still be mapped badly Suppose a source gives each integer from 0 to 255 the same probability. To create a die, an application takes the remainder after division by six and adds one. There are 256 source values, but 256 is not divisible by six. Four faces receive 43 source values each; two receive 42. The original source was uniform. The mapping introduced the bias.
Rejection sampling fixes this example by accepting only 0–251. Those 252 values divide equally among the six remainders. Rejected values are discarded and a fresh value is obtained. Our Lab demonstrates the exact finite mapping and compares one million outputs from each method.
A lottery requires more than one integer Six independent integers from 1–49 can contain duplicates, so they are not automatically a valid 6/49 selection. One valid method repeatedly samples uniformly and rejects numbers already chosen. Another partially shuffles the pool using unbiased bounded integers. Both can produce uniform subsets when implemented correctly.
Sorting a valid selection for display does not damage fairness. Filtering out visually unattractive selections does change the distribution, because it excludes valid outcomes. The difference is whether the program changes only presentation or changes which results can survive.
Reproducibility versus private state Our published experiments deliberately use a named, seeded pseudorandom generator so readers can reproduce the results. That is appropriate for a transparent simulation. A public seed is not appropriate when unpredictability against an adversary is the goal. The same word “random” appears in both contexts, but the operational requirements differ.
A useful audit checklist Inspect the entropy or seed source, the generator family, the bounded-integer conversion, duplicate handling, separate number pools, and any post-selection filters. Check what happens when the required browser capability is unavailable. A silent fallback can invalidate a broad claim about cryptographic generation.
Finally, keep the outcome in perspective. A well-designed number generator can make a choice impartially. It cannot make the external lottery draw favour that choice. The generator solves selection, not prediction.
Leave the selection to chance
If you want a valid random game line, open the relevant generator. A generated line is not an official entry or a prediction, and it does not improve the probability of a specified valid combination.
Sources and further reading
The worked examples and derivations are RoomForChance explanations. Operator sources establish game parameters; research sources support the specific points identified above. University links are references, not endorsements.
- W3C · Web Cryptography Level 2API specification; the linked Level 2 document is a working draft. The source contract and the application mapping are separate layers.
- Joe Blitzstein and Jessica Hwang · Harvard Stat 110 / Introduction to ProbabilityUniversity-level further reading on counting, conditioning and probability models.
Continue the argument
True Random vs Pseudorandom: Which Difference Matters?
Compare physical entropy and deterministic random streams without confusing reproducibility, statistical quality and cryptographic security.
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.
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.