When probability of finding similar chips will be more than N%?

In each game, there are N chips on the table. There are 400 different types of chips in total. What is the minimum number of chips (let's call it R) on the table for the probability of finding at least 2 identical chips to be higher than N%?

I think, that if R is equal to 401, than the probability of having two identical chips should be 1 or 100%, and if it's 201 it should be more than 0.5. But it'll be nice to have some formula to calculate R from N as well as confirmation that my thinking isn't wrong.


This question comes from gamedev competition with the test part, and for some reason, test writers thought that knowledge of statistics is important for usual gamedev. I don't know from where they took this question but it was already poorly composed and contained contradiction, so I tried to make it not that bad by excluding that seemingly unimportant part and making the whole question a bit more abstract.


Solution 1:

Here let us assume that each chip on a table can be any chip uniformly and independently of other chips.

For any number $R$, let us calculate the probability that the chips are all different. We have 400 ways to choose the first. Then given the first, there are 399 out of 400 ways to choose the next one and so on. Thus, we get

$$\Pr[\text{All }R\text{ different}] = \frac{400}{400} \cdot \ldots \cdot \frac{400-R+1}{400} = \frac{\frac{400!}{(400-R)!}}{400^R} = \frac{400!}{(400-R)! 400^R} = \frac{R!}{400^R}{400 \choose R}.$$

Another way to see that last formula is that there are 400 choose $R$ ways of picking our chips and the $R!$ orderings of the chips. Hence that is the number of choices with distance chips. On the other hand, we have $400^R$ possible ordered choices. Hence we get our probability.

Then the probability that you want is $1 - \Pr[\text{All }R\text{ different}]$