Random numbers without duplicates: what changes when repeats are off?
You ask for five random numbers and get 8 twice. That may be a perfectly valid draw, but it is not useful if the numbers identify five different tasks.
Decide whether you need independent draws or a sample of distinct values. The minimum and maximum alone do not answer that question.
Check how many different numbers exist
An inclusive whole-number range contains maximum − minimum + 1 values. From 1 to 10, there are ten, not nine. From −2 to 2, there are five: −2, −1, 0, 1 and 2.
You cannot select six unique numbers from a five-value range. Expand the range, reduce the requested amount, or allow repeats if that matches the task. Rerunning an impossible request will not help.
| Range | Distinct values | Example request |
|---|---|---|
| 1–10 | 10 | 5 unique: possible |
| −2–2 | 5 | 6 unique: impossible |
| 10–10 | 1 | 1 unique: always 10 |
Repeats and unique draws answer different questions
With repeats allowed, each fair draw from 1–10 can return any of those ten numbers, including one already drawn. For exactly five such draws, the chance that all are different is (10 × 9 × 8 × 7 × 6)/10⁵ = 30.24%. A repeat somewhere in those five therefore has a 69.76% chance.
With uniqueness required, a value already chosen is unavailable for the rest of the sample. The later choices depend on the earlier ones. Treating those as independent draws would give the wrong calculation.
Source: OpenStax · Independent and Mutually Exclusive Events
Unique does not mean evenly spaced
The values 2, 3, 4, 5 and 6 are unique, even though they cluster. Banning neighbours or requiring one number from each part of the range creates a different sampling rule. It should be described as such rather than quietly added to make the result look more random.
Sorting the chosen numbers is another separate operation. It preserves the set but removes the random order. If the first number gets a special role, use the original draw order rather than assigning that role to the smallest value afterwards.
For a random work sample, map each valid number to one item before drawing. Gaps in your numbering can otherwise send you back to the generator whenever a number has no corresponding item.
Set up the draw in Picknado
Picknado allows 1–500 numbers per request and bounds from −1,000,000,000 to 1,000,000,000. If you need a random order for named items rather than numeric IDs, use the list shuffler. Unique numeric values do not remove duplicate people or tasks in the list they refer to.
- Enter the inclusive minimum and maximum.
- Choose an amount no larger than the range's distinct-value count.
- Enable unique values when each number must identify a different item.
- Copy the result before editing the inputs or leaving the page.
Sources & further reading
The links identify sources for factual statements. Schedules and worked examples are our illustrations, not user studies.
About the articles