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

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?

\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. 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}
• Thanks. Regarding the second question, why is probability zero if $k < n$? For instance, if there are k = 10 numbers to choose from and n = 40 people joining the game, it may still happen that more than one person (e.g., two people) select the same number. – mgiordi Nov 30 '18 at 15:34
• Sorry, I was typing this in a hurry. I meant that the probability is going to be $1$, because there aren't enough numbers for everybody. – glowstonetrees Nov 30 '18 at 20:08