How this calculator works
The seed starts a deterministic Park-Miller sequence. Integers include both endpoints and use rejection mapping so every mapped integer has the same number of accepted generator states. Without-replacement mode skips values already in the sample. Decimal mode maps the finite generator grid into the chosen interval with the upper endpoint excluded. This is a reproducible teaching tool, not a source for cryptographic keys, lottery draws or other security-sensitive randomness. Change the seed for a different sample; reset restores the defaults.
Formula
State_next = (16807 × state) mod 2147483647. U = (state_next - 1)/2147483646. Decimal value = lower + (upper - lower)U. Integer mapping uses accepted states modulo the inclusive range size.
Worked example
With seed 1, integer bounds 0 and 9 and three values, the output is 6, 8, 2. Seed 2 with the same bounds begins 3, 7. These results follow the specified generator and mapping.
Advertisement
Frequently asked questions
Why do results repeat after reset?
Reset restores the seed. Reproducibility is intentional; change the seed to obtain another sequence.
Can I request unique decimal values?
The unique-value control applies to integers only. Decimal samples use the finite generator grid and can repeat over sufficiently long sequences.
Are decimal endpoints included?
The lower endpoint is included in the grid and the upper endpoint is excluded. Integer mode includes both endpoints.