Probability of at least two out of N people selecting the same number within a certain range

combinatoricsprobability

Suppose that I choose a number between 1 and K.
Now, other N-1 people are required to do the same, i.e., randomly selecting a number between 1 and K. If at least one of these N-1 people picks the same number I chose, the game is over.

My question is: what is the probability that at least one people has selected my same number?


Alternatively, the game ends if more than one person (overall there are N people) select the same number (out of K available numbers). How can I express this probability?

Best Answer

\begin{align} & \Bbb P(\text{at least one other person selected your number}) \\ = & 1-\Bbb P(\text{nobody else selected your number}) \\ = & 1-\prod_{i=1}^{n-1}\Bbb P(\text{person $i$ did not select your number}) \\ = & 1 -\prod_{i=1}^{n-1}\frac{k-1}{k} \\ = & 1 - \bigg(\frac{k-1}{k}\bigg)^{n-1} \end{align}


For your second question, the probability is obviously going to be $1$ if $k<n$. So here I shall assume $k \geq n$.

\begin{align} & \Bbb P(\text{at least two people chose same number}) \\ = & 1- \Bbb P(\text{everybody chose different numbers}) \\ = & 1 - \frac{k}{k} \cdot \frac{k-1}{k} \cdot \frac{k-2}{k} \cdot \cdots \cdot \frac{k-n+1}{k} \\ \end{align}