discrete uniform distribution for selecting at least two same numbers

79 Views Asked by At

$M$ integers are drawn, each randomly and independently from a discrete uniform distribution with range between $1$ and $K$ (both included). So each of these $M$ random numbers will be an integer between $1$ and $K$ (both included). What is the probability that there will be at least two numbers that are the same? Consider two cases: $(1) : M <= K$, and $(2) : M > K$. I know that each of the numbers between $1$ and $k$ are equally probable i.e.,$1/k$. I proceeded like this for part $(1)...p(x)$ denotes $x$ numbers are same. $p=p(x=2)+p(x=3)+...p(x=m)$. $p=C(k,1)*\frac{C(k-1,m-2)}{k^m}+C(k,1)*\frac{C(k-1,m-3)}{k^m}+....\frac{C(k,1)}{k^m}$. Please correct me if I am wrong and please guide me for part 2.

1

There are 1 best solutions below

2
On

For part 1, it is easier to compute the probability q that the numbers are all different $q=\frac{K-1}{K}\frac{K-2}{K}...\frac{K-M+1}{K}$, so p=1-q. For case 2, there must be at least one pair, so p=1.