Given are $m$ bins with equal probability of choosing one of them. Unknown number of balls $n$ is placed into the bins, and, at the end of placement, we observe number of empty bins $m_e$ and non-empty bins $m_{n}$.
Given $m$, $m_e$, $m_n$, what is the most likely number of balls $n$, which have been placed into bins?
(UPD) possible additional information: number of bins with exactly one ball can be also known.
Best Answer
Presumably $m=m_e+m_n$.
The likelihood of seeing $m_n$ out of $m$ occupied is $\dfrac{S_2(n,m_n)\, m!}{m^n \;(m-m_n)!}$ where $S_2(x,y)$ is a Stirling number of the second kind. I do not know an easy way of finding the $n$ which maximises this in general but it is easy enough to calculate for given reasonably small $m$.
One possible alternative estimator is $\dfrac{\log(m)-\log(m-m_n)}{\log(m)-\log(m-1)}$, which follows from saying $E[m_n \mid m, n] = m\left(1 -\left(\frac{m-1}{m}\right)^n\right)$. This is neither a maximum likelihood estimator nor an unbiased estimator for $n$, and it is usually not an integer, but it comes fairly close to the maximum likelihood estimator; it is slightly biased upwards when $1 \lt n \lt m$. The table below compares the values when $m=10$ for different $m_n$