The house my wife and I live in was recently sold, and so we have started looking for another apartment. Our current lease expires in a year and a half, and so we decided that, given how challenging the rental market is in NYC, that we should start looking right away. We also decided, somewhat arbitrarily, that we would attempt to find an apartment in the next six months, if only because we knew we would get sick of looking pretty quickly.

During the first 5 weeks of our apartment hunt, we found five apartments that we thought were worth looking at. Over six months, I extrapolated that we would get to see about 26 apartments that would satisfy our requirements. What we discovered, with each apartment, is that we basically got to see the apartment and then pretty much decide immediately if we wanted to apply to rent the apartment or not.

It turns out that there is a nifty mathematical algorithm that one can use to optimize one’s chances at picking the best apartment possible. We expect to have 26 apartments to look at, each of which we inspect and then either accept or reject immediately, and we want to optimize our chances of picking the best apartment possible, from the 26 that meet our minimum criteria. This exactly matches a solved problem in mathematics; **the Secretary Problem**.

In the Secretary Problem, where one has to decide on the best applicant between n randomly ordered applications, an optimal solution is to reject the first n/**e** applicants, and then accept the next applicant that is better than any applicant you have seen before. The proof of **this particular solution is here**. I couldn’t reproduce this proof if asked, and there are details in it which are fuzzy for me, but I am pretty sure I understand why it works. Informally, the first n/e applicants act as a sampling space, and this gives you information on how good applicants will be, and that n/e happens to be where you achieve an optimal amount of information on applicant strength, allowing you to make the best determination you can of which next applicant to choose, without raising the probability too high that you’ve already rejected the best applicant.

For our specific apartment hunting problem, with 26 total apartments to view, 26/e (**e** ≈ 2.71828) ≈ 9.6 ≈ 10 apartments. So, my wife and I looked at 10 different apartments, and while we did this, I informally ranked the apartments based on the criteria my wife and I agreed were important to think about (space, apartment lay-out, cost, location, quality of neighbourhood school, commute time). The 11th apartment either she or I looked was superior in many ways on all of these criteria than any of the others we had looked at, so I whole-heartedly threw in my support for it, knowing that this specific apartment is most likely to be the best apartment we will see.

We’ve submitted an (overly lengthy) application for the apartment. Wish us luck.