Will ask this as a practical example for one situation.
- Let's say I have a range of numbers 1-100
- I need 10 unique random numbers in that range
- How many times do I need to generate a random number to be 99+% certain that I have generated 10 unique numbers.
The range and unique number count is arbitrary. The range could have been 1-1000 and the unique numbers required 27. I am looking for a way to calculate how many extra numbers more than the required minimum unique numbers I need to generate to be 99% certain. Obviously the greater the range and the smaller the unique count required, the less extra numbers required. An extreme case would be 10 random numbers out of an exillion. Am 99+% certain that I only need to generate 10. But if I was to generate 10 random numbers in the range 1-11, then I would probably need to generate over a hundred+ random numbers to be 99+% certain I have 10 unique values in a random order.
I already know how to get the probability of 10 unique numbers after generating N numbers with replacement. Solution is here: How do I calculate the probability of getting 10 unique members of a set given random selection with replacement?
edit (tried to clarify what I am searching for). Ideally I am looking for a formula with the following inputs: N (the number of unique numbers required), R (the range of numbers to choose from), P (the percentage of certainty) and the output, X, being the number of numbers to be generated to achieve the required degree of certainty.