**A nameless algorithm for hiring**

There is a simple and fun algorithm that I don't know the name of (if it ever had one). If somebody does, please let me know.

In its most general form it allows for the selection of a element from a possibly infinite totally ordered set, after having analysed a finite set of elements. Note that in the most general form, there is a situation where the process doesn't terminate, but this case would not occur in the real life situations I will refer to.

So imagine that you have to hire a sales assistant for, say, a shopping centre. There is no time constraint for the recruitment (if there was, you would just put a deadline on CV applications and only work with the CVs you have received before the deadline) and you can also assume know that lots of people will be applying (you can assume an infinite number of people).

To simplify things, let us say that you can hire people on their CVs alone. Otherwise assume that people have to hand over their CVs in person, and that they get an instant face to face interview. In which case, you can use the CV together with the result of the interview to value the application.

One method is to go as follows: You first build a pool of 7 CVs using the first 7 CVs. Then, for each new CV, referred to as "incoming CV", you do:

- If incoming CV is better than any of the CVs in your pool, you insert incoming CV to the pool (which then has 8 elements) and then you remove the weakest CV (so the pool goes back to 7 elements).
- Otherwise, you discard incoming CV.

I don't know the name of that algorithm.

Obviously the general assumption that the set is totally ordered translates to always be able to compare any two given CVs. In real life this is harder than it sounds (but not impossible). More interestingly, the size of the pool (number 7 in the above example) and the termination condition (number 5 in the above example) can be customised (they are parameters of the algorithm). There might be good methods to chose the optimal values (I think statisticians know those kind of things), but I don't know it. Also you might want to put a sort of minimal condition to be met in order to apply, because you obviously should not even put in your pool of CVs any CV that you would actually mind hiring if that one person ended up at the top of your pool once the process stops.

## Comments

There is a variation of my solution with the added condition that if somebody has been in the pool for too long then that person is automatically removed. This creates another stopping condition where you stop the process because the current top candidate is about to expire if not giving an offer, despite the fact that the average value of the pool might have been steadily increasing... (I find this last set of rules the more interesting from a theoretical point of view...)

If you scan the literature, there is a number of papers starting around the 70s that covers the finite-memory secretary problem in various form, finite and infinite, and other extensions. One that could be related to the first scenario is http://www.tandfonline.com/doi/10.1080/01621459.1975.10479872