Facts & Figures

When To Stop Looking

How I Used An Algorithm To Find My Apartment

Published

Facts and Figures is a column about numbers, data, efficiency, logic, optimization, hacking, and stuff of that nature. Writers note: You people narrowly avoided another cultural criticism or party reports column.




In fall 2017, I was in rough shape. I had ended a relationship, which got me stuck in an apartment I could not afford by myself. And worst of all, I was in Bushwick. I had to move. I had some basic requirements: downtown Manhattan, less than my current place, agreeable commute time, in-unit shower, and not above a restaurant. This left me with a lot of options — how was I to choose?


I had some iffy living situations in the past and wanted to get it right this time. Luckily, I had just read Algorithms to Live By: The Computer Science of Human Decisions by Brian Christian and Tom Griffiths. It’s a book about how to use CS algorithms (like those for caching, searching, and sorting), for everyday situations like how to organize your documents or find a parking space. I realized that I could use the solution to “optimal stopping” for my apartment hunt and take some of the emotionality out of experience.

“I realized that I could use the solution to “optimal stopping” for my apartment hunt and take some of the emotionality out of experience.”

The problem of optimal stopping is usually set up with a thought experiment called ”The Secretary Problem.” It goes like this: You’re looking to hire a secretary. There are 100 applicants, and each has an objective ranking relative to the rest. Of the ones you’ve seen, you can tell how they rank relative to each other, but you don’t know the rankings for the candidates you haven’t interviewed yet. For each candidate, you have to either hire or reject them after their interview. How do you maximize your chances of getting the best candidate?


There indeed is a correct answer: You reject the first 37, then hire the first one that is the best one so far. This will give you the highest average ranked candidate over any other approach. There’s a proof for this but it’s unintelligible gibberish if you’re not a math person.


I found myself fascinated by optimal stopping and how I could use it to make decisions. It has all sorts of applications. For example, if you’re 20 and looking to get married by 40, you should marry the first person that’s the best person you meet after 27. This will maximize your chances of getting the best spouse.

“For example, if you’re 20 and looking to get married by 40, you should marry the first person that’s the best person you meet after 27. This will maximize your chances of getting the best spouse.”

I had about a month for my apartment hunt, so I set the parameters: I would see as many apartments as possible every day. I would not rent any apartments I saw during the first 37% of the month. After that, I would rent the first apartment that was better than any of the ones I saw.


This was easy in a practical sense, but hard in an emotional sense. I knew I had to spend 11 days looking at apartments that I would not rent under any circumstances. There were some charmers: a new construction place in Chinatown, a palatial East Village space that felt like home, and a dream SoHo two bedroom I could absolutely not afford. However, most of the places were uninhabitable hovels for extraordinary rents. The domestic indignities we subject ourselves to in New York you’re either intimately familiar with, or wouldn’t believe if explained to you. Those ones were easy to skip.

“This was easy in a practical sense, but hard in an emotional sense. I knew I had to spend 11 days looking at apartments that I would not rent under any circumstances.”

When day 11 arrived, I was excited. It was game time. 37% of the month had passed. The first best apartment is my new home. Onward and upward. Over the next few days I saw a few more losers, and most notably, the worst apartment I had ever seen in New York (a dingy, ground floor SoHo “one bedroom” for $1950).


One other SoHo listing caught my eye. It was on a quiet block in “South Village” I wasn’t familiar with. When I saw the second floor, rear-facing walkup, it wasn’t the apartment of my dreams, but I realized it was indeed the best apartment I had seen so far: exposed brick, a real bedroom, multiple closets, original tin ceiling, very little street noise, dark in the bedroom, natural light in the living room, a gas stove, a shower in the bathroom instead of the kitchen, neighbors notably not screaming at all, walking distance to every train, and cheaper than my Bushwick spot. It had everything I needed and enough of what I wanted.


During the open house, I pulled the realtor aside so the other people couldn’t hear and told him I’d take it. Six years later I’m in a place with lopsided floors that forbids bikes in the hall, but I’m not thinking about apartment hunting. But if I ever have to do that again, I’ll know how.

More Articles: