I'm looking at a series of random integers generated by a CSPRNG and noticed that there are more repeats (that is a number is in the sequence 2 or more times e.g. 9,3,8,5,6,3 - 3 is a repeat) than I expected.
I generated 10,000 numbers, each between 1 and 100,000, this resulted in 9,516 unique numbers. Does this seem correct, and if so, how would I calculated the expected about of unique numbers for n random numbers of a range 1 to x?
When sample $n$ times from the set $\{1,\dots, x\}$, then the expected number of unique values is $x[1-(1-1/x)^n]$. With $n=10000$ and $x=100000$, this gives approximately $9516.303$.