# Estimating total number of people from an observed sample

The well known "German tank problem" shows how to answer the question: "If I have tanks which have an increasing serial number, and I see a sample of tanks and record their serial numbers, what is the likely total number of tanks". This question is analogous but is where there is no ordering to the observations, eg with people.

Here's a hypothetical example (and the one I am most interested in). Suppose you go to a company website and they provide a number of CVs for staff of a particular job title (eg analyst or whatever). The question is, given this knowledge, how many staff are there likely to be with that title?

To formalise this, let the number of observed people be $m$ and the total number of people be $N$. The question is then: What is $p(N|m)$.

I appreciate that there may be company policies at work here, eg they may want to show all of the people on a particular level, or some representative sample.

Clearly, $N \geq m$.

Bayes' theorem gives that $p(N|m) = P(m|N) p(N)$. Let's ignore the prior $p(N)$ for now (or equivalent assume that it is flat), giving $p(N|m) \sim p(m|n)$.

Using combinatorics, the number of ways you can get the observed $m$ people from a larger set is $N \choose m$. So immediately this implies that $p(m|N) \propto 1/ {N \choose m}$. There is a normalisation constant which is obtainable by requiring that $\sum_m^\infty C/{N \choose m} = 1$.

The problem is that $1/ {N \choose m}$ is a very steeply declining function for even moderate values of $m$. For example, using $m=5$ then $p(5|5) \sim 0.8$, $p(6|5) \sim 0.13$, $p(7|5) \sim 0.038$, $p(8|5) \sim 0.014$ etc. My intuition is that if you observe five people you shouldn't conclude there is a 97% chance that there are between 5 and 7 people.

What is going here? I suppose I could change my prior, but this conflicts with the fact that I want to be indifferent to the number of people (i.e. I shouldn't have to assume that 7 people are more likely than 5 people to get what I want).

It may not be possible to answer this question at all. From a maximum entropy perspective, all I know is that $N \geq m$. The maximum entropy distribution which describes this is just a uniform distribution on $[m, \infty)$. So perhaps I am hoping there is some trick here that will give me info that doesn't exist...

• I'm not an expert, but maybe can be useful to see the capture-recapture approach Jul 24, 2014 at 16:27
• Unfortunately capture re-capture will not work here - you only get to see a sample once. Jul 25, 2014 at 5:52

The model $p(m|N) \propto 1/{N \choose m}$ does not make sense. Once the company has decided to show $m$ people, then there are indeed ${N \choose m}$ sets of people that they could show. But this doesn't tell you anything about why the number was $m$.

• +1 Also if $1/{N \choose m}$ is likelihood, then it's maximum is $1/{N \choose N} = 1/1$ so "most likely you have seen CV's of all the employees!"
– Tim
Sep 22, 2016 at 9:30

I think you made an error in formulating the likelihood. You wanted to know "What is the probability of getting a set of $m$ people, given that the total number of people is $N$?" but you answered the question "What is the probability of getting a particular set of $m$ people, given that exactly $m$ people were selected from $N$ people?".

If there are $N$ people in total and all subsets are assumed to be equally likely, then the probability of getting a set of $m$ people is the number of subsets of size $m$ divided by the total number of subsets, which is

$$p(m|N) = \binom{N}{m}2^{-N}$$

which is maximized when $N \approx 2m$.

So, for example, in case $m=5$, your MAP estimator for the total number of people would be $N=10$.

a) You are saying "let's ignore the prior, p(N)". This may NOT be a good assumption, I'm not sure. I do however have a lot more confidence (based on many years of experience as a consultant) in stating the next part of this answer.

b) In the practical case of a company displaying CVs, there are many reasons why different companies may behave quite differently and at different times with regard to the proportion of their people's CVs that are on display. For example, if a company is submitting a large tender for consulting work that they are likely to win, they may show only a few of their candidate's CVs, especially if most of the staff are already busy or have a lot of future work "in the pipeline". Alternatively, if the company is actively seeking more consulting work right now, they may display the CVs of everyone on their staff, even including people who are not actually currently available, just to attract interest and display the widest range of skilled people possible.

If you are asking this as a "real-world situation" question rather than as an abstract mathematical problem, then you cannot ignore these sort of issues, but it may be very difficult for you, as an outsider, to find out the extent to which such effects may distort your results.

• I totally agree with the sentiments here. I agree that my result may be biased, and that the actual answer will depend on the reason the company is displaying the CVs. I am trying to approach this from both a theoretical and real world perspective. I am not sure that I have the likelihood function right. For the reasons you have outlined, $N$ could be much bigger than $m$. The only way to make this happen is either a) there is a prior $p(N)$ which is some rapidly increasing function of $N$, or b) my likelihood function above is not correct. Jul 24, 2014 at 20:56