Maximum Likelihood Estimator on birthday paradox I am looking into some properties of some hash functions. It is rather a short hash $16bit$  which yields up to $65536$ different values.
Given that I have $M$ samples which populate $N$ out of $65536$ bins, with $M>N$, is there a way to do a maximum likelihood estimation on the $M$ parameter ($M$ is unknown)? I would like to avoid simulations as I think that they tend to be computationally expensive and quite variable for $M >N$ and have stability issues.
To translate it in the birthday paradox can I predict how many people were in my sample given that I now that there are $N$ different birthdays in a year found in the sample?
Is there a closed form solution I can approximate this result?
 A: This is a problem amenable to maximum likelihood estimation, provided one can write down the likelihood or design a latent variable representation to run an EM algorithm.
Let us denote $\bar N$ for the number of days/boxes (like $\bar N=365$ in the original problem) and $M$ for the number of individuals. Borrowing from this paper by Fisher, Funk, and Sams, the probability to have $r$ distinct birth-days in a population of $M=m$ individuals writes as
$$\mathbb P(R=r)=\frac{\bar N!}{(\bar N-r)!}\frac{m!}{\bar N^m}
\sum_{(r_1,\ldots,r_m);\\\sum_1^m r_i=r\ \&\\\sum_1^m ir_i=m}1\Big/\prod_{j=1}^m r_j! (j!)^{r_j}\tag{1}$$
where the $r_j$'s correspond to the number of days with exactly $j$ simultaneous or shared birthdays. But Feller (1970, p.102) gives the simpler representation
$$\mathbb P(R=r)={\bar{N} \choose r}\sum_{\nu=0}^r (-1)^{\nu}{r\choose\nu}\left(1-\frac{T-r+\nu}T \right)^m$$
which fits well an empirical distribution when $\bar N$ is small enough.
Feller (1970, pp.103-104) justifies an asymptotic Poisson approximation with parameter$$\lambda(M)=\bar{N}\exp\{-M/\bar N\}$$from which an estimate of $M$ can be derived. With the birthday problem as illustration (pp.105-106)!
And if I understand properly the "strong birthday" problem in Das Gupta (2005)](https://www.math.ucdavis.edu/~tracy/courses/math135A/UsefullCourseMaterial/birthday.pdf) the number of "unique" people (not sharing a birthday with anyone else) is distributed as:
$$\mathbb P(R'=r)=\sum_{i=r}^m (-1)^{i-r} \frac{i!}{r!(i-r)!}\frac{\bar N!m!(\bar N-i)^{m-i}}{i!(\bar N-i)!(m-i)!\bar N^m}\tag{2}$$
