Random Number Generator

Generate one or more random numbers within a specified range. You can choose whether to allow duplicates in the generated set.

Generator Settings

About Random Number Generation

A random number generator is a tool or algorithm that produces a sequence of numbers that lack any discernible pattern, appearing to be random. This tool uses a pseudo-random number generator (PRNG), which is an algorithm that creates a sequence of numbers that approximates the properties of true random numbers. For most practical purposes like games, statistics, or simulations, PRNGs are sufficient.

Allowing Duplicates (Sampling With vs. Without Replacement)

The "Allow duplicates?" option relates to a statistical concept called sampling:

  • With Replacement (Duplicates Allowed): When this option is checked, each number is generated from the full range independently. It's like drawing a number from a hat and then putting it back in before drawing the next one. This means the same number can appear multiple times.
  • Without Replacement (No Duplicates): When this is unchecked, once a number is generated, it cannot be chosen again. This is like drawing a number from a hat and leaving it out. In this mode, the number of integers you can generate is limited by the size of the range (e.g., you can't generate 10 unique numbers from a range of 1 to 5).