[Math] If I ask $1000$ people to choose a random number between $0$ and $999$, what is the probability that no one will choose a specific number

probabilityrandomstatistics

Imagine I asked $1000$ people to choose a number between $0$ and $999$ (both inclusive, the numbers are not biased, they will be completely random) and write that number down. Now, after that, pick a number, $x$, where $0\le x \le 1000$. What is the probability that none of people that I asked will have chosen that number?

I ran a simulation in Python to do this $10000$ times (code), and in $37.22\%$ of the cases, no one choose the $x$.

I would like to know a simple way to calculate this for any amount of people.

Best Answer

For $n$ people, the probability is $$\left(1-\frac1n\right)^n\approx \frac1e$$ To explain that, notice that the natural logarithm of $1+x$ is close to $x$ when $x$ is small. (Try it for $\ln(1.1),\ln(1.01),\ln(1.001)$).
So the log of the left-hand side is $n\log(1-\frac1n)\approx(n(-\frac1n))=-1$.
Since the log is near $-1$, the probability is near $1/e$.

Related Question