The probability density function of the number of distinct values $Z$ for population size $M$ and sample size $N$ is given by $$P(Z = j) = \binom{M}{j} \sum_{k=0}^j (-1)^k \binom{j}{k} \left(\frac{j - k}{M}\right)^N, \quad j \in \{1, 2, \ldots, \min(M,N)\}$$
Carlo Beenakker
- 188.3k
- 18
- 448
- 651