Algorithms to Live By

Leverage computer science to solve your problems

Neil Kakkar
The Rolodex

--

Key takeaway

You can use solutions from computer science to solve problems in real life. These can be wide-ranging: from how to choose your soulmate, to when to choose a new restaurant vs your favourite.

How to choose your soulmate

The Optimal Stopping Problem

Be it looking for a soulmate, or a secretary, or a house to rent — the process is the same. The catch though, is that you can’t go back and choose another once you’ve made a decision (or it’s very expensive to do so).

This problem of deciding how long to scan — and who to choose is the Optimal Stopping Problem.

The optimal solution takes the form of Look-Then-Leap Rule: You set a predetermined amount of time for “looking” — that is, exploring your options, gathering data — in which you categorically don’t choose anyone, no matter how impressive. After that point, you enter the “leap” phase, prepared to instantly commit to anyone who outshines the best person you saw in the look phase.

This optimal number comes out to 37%.

The 37% Rule: look at the first 37% of the applicants, choosing none, then be ready to leap for anyone better than all…

--

--

Neil Kakkar
The Rolodex

I write about Code and Life philosophies. Sometimes both. | https://neilkakkar.com | Engineer @PostHog | Write (Code). Create. Recurse.