Estimating population size from the frequency of sampled duplicates and uniques There is a web service where I can request information about a random item. 
For every request each item has an equal chance of being returned.
I can keep requesting items and record the number of duplicates and unique. How can I use this data to estimate the total number of items?
 A: I have already give a suggestion based on Stirling numbers of the second kind and Bayesian methods.  
For those who find Stirling numbers too large or Bayesian methods too difficult, a rougher method might be to use 
$$E[U|n,s] = n\left( 1- \left(1-\frac{1}{n}\right)^s\right)$$
$$var[U|n,s] = n\left(1-\frac{1}{n}\right)^s  + n^2 \left(1-\frac{1}{n}\right)\left(1-\frac{2}{n}\right)^s - n^2\left(1-\frac{1}{n}\right)^{2s} $$
and back-calculate using numerical methods. 
For example, taking GaBorgulya's example with  $s=300$  and an observed $U = 265$, this might give us an estimate of $\hat{n} \approx 1180$ for the population.
If that had been the population then it would have given us a variance for $U$ of about 25, and an arbitrary two standard deviations either side of 265 would be about 255 and 275 (as I said, this is a rough method).  255 would have given us a estimate for $n$ about 895, while 275 would have given about 1692.  The example's 1000 is comfortably within this interval.     
A: This is essentially a variant of the coupon collector's problem.
If there are $n$ items in total and you have taken a sample size $s$ with replacement then the probability of having identified $u$ unique items is 
$$   Pr(U=u|n,s) =  \frac{S_2(s,u)  n! }{ (n-u)! n^s }$$ 
where $ S_2(s,u)$ gives Stirling numbers of the second kind
Now all you need is a prior distribution for $Pr(N=n)$, apply Bayes theorem, and get a posterior distribution for $N$. 
