Explanation
A repeatable random pick
A seeded picker makes the same choice whenever its seed and range are the same. This is useful for reproducible examples, casual games and repeatable demonstrations. Change the seed to make another deterministic choice.
Range and seed
Enter the smallest and largest whole numbers you allow (both included) and a seed from 1 to 2,147,483,646. The same range and seed always give the same pick, so a result can be checked or shared. For a new pick, change the seed or enter the next seed shown in the steps. The calculator never reads the clock or system randomness.
s′ = (16807 × s) mod 2147483647; r = a + (s′ mod (b − a + 1))
| r | picked number |
|---|---|
| s | seed |
| s′ | next seed |
| a | smallest allowed number |
| b | largest allowed number |
Seed 1 on a 1–6 range
| From | 1 |
|---|---|
| To | 6 |
| Seed | 1 |
| Result | 2 |
Seed 1 → 16,807; 1 + (16,807 mod (6 − 1 + 1)) = 2. Use 16,807 as the next seed for another pick.
A 10–10 range with 1 number
| From | 10 |
|---|---|
| To | 10 |
| Seed | 5 |
| Result | 10 |
Seed 5 → 84,035; 10 + (84,035 mod (10 − 10 + 1)) = 10. Use 84,035 as the next seed for another pick.
Seed 2 on a 0–9 range
| From | 0 |
|---|---|
| To | 9 |
| Seed | 2 |
| Result | 4 |
Seed 2 → 33,614; 0 + (33,614 mod (9 − 0 + 1)) = 4. Use 33,614 as the next seed for another pick.
Diagram of this result
The range from the smallest to the largest allowed number, with the pick marked.
A number line runs from the smallest to the largest allowed whole number and a marker shows the pick. The exact numbers are stated in the answer and the steps.
Common mistakes
Reusing a seed deliberately repeats a result. The maximum endpoint is included. This simple generator is predictable and has small modulo bias; do not use it for security, lotteries, statistical sampling or decisions requiring verified fairness.
Assumptions and limits
Uses Park–Miller recurrence next = seed × 16807 mod 2147483647, then minimum + (next mod range size). It is a pedagogical pseudorandom mapping, not true randomness or cryptographic entropy. Results stay in the requested inclusive interval. Numeric observations use up to 30 significant input digits and 50 internal digits; no presentation rounding enters the calculation.
Sources
Park and Miller, Random Number Generators: Good Ones Are Hard to Find, Communications of the ACM 31 (1988). Recurrence and all example modular products are explicitly documented here.
Why does clicking again give the same number?
The calculator is reproducible by design. Enter the displayed next seed, or choose another seed, to advance the deterministic sequence.