May 2024

Optimal Stopping, Caching, and Other Human Decisions

Computer science has surprisingly good answers to ordinary human problems. When to stop searching, when to settle, what to keep in your head versus look up. Notes from Algorithms to Live By, applied loosely to real life.

optimal stoppingexplore exploitdecision theoryheuristicscomputer science

The Premise

Algorithms to Live By, by Brian Christian and Tom Griffiths, starts from an observation so obvious it's easy to miss: computer scientists have spent seventy years solving problems that are actually just life. When to stop searching and commit. How much of the unknown to explore versus how much to exploit what you already know works. What to keep in memory and what to look up. How to schedule tasks when everything is urgent and nothing can be done all at once. The book takes the formal solutions to these problems and asks, gently, what would happen if you lived by them.

I read it in 2024, in a year when I was making a lot of decisions that felt heavy. The book didn't make them lighter. It made them legible. It turned a vague sense of "this feels hard" into named problems with known tradeoffs, and there's something calming about knowing your dilemma has a name that people have been working on for decades.

The 37% Rule and the Cost of Looking

The most famous idea in the book is the secretary problem, also known as optimal stopping. You're interviewing candidates one by one. You can't go back to someone you passed on. When should you stop and hire? The mathematically optimal answer: look at 37% of the pool, then hire the first person better than everyone you've seen so far. It's not a perfect rule, it's a rule that maximises your probability of getting the best candidate given a hard constraint, which is the kind of honesty I like in advice.

What stuck with me isn't the 37% itself. It's the shape of the answer: a defined period of pure exploration, followed by a period where you commit to the first thing that clears your bar. Most people do the opposite. They commit too early from fear of missing out, or they look forever, unable to accept that at some point you have to stop searching and act. The rule reframes looking as something with a cost. Every additional option you consider is another chance to find something better, yes. But it's also time spent not committing, not building, not learning what the thing you chose is actually like.

I applied this to apartments once, during a move. I looked at 37% of the places on my shortlist, noted the best one, then took the first one after that which beat it. It worked, and it also felt completely arbitrary while I was doing it, which is a strange and useful feeling: making a decision based on a rule rather than a feeling. The feeling says "keep looking, what if the next one is better." The rule says "the next one is probably not better, and looking has a cost."

Explore Versus Exploit, Everywhere

The other idea I think about weekly is the explore-exploit tradeoff. At any moment you can try something new (explore) or do what you know works (exploit). The tension shows up in restaurants, careers, friendships, hobbies, and how you spend a free evening. The book points out that the correct balance depends on how much time you have left. Young people with long horizons should explore more. As the horizon shrinks, exploitation becomes increasingly rational. This reframed a lot of advice I'd heard. "Take risks while you're young" isn't motivational sloganeering, it's the mathematically correct strategy for a long time horizon.

The subtle version is even better: explore when you're in a new environment, exploit as you learn it. The book calls this the "explore-exploit dilemma as life's most fundamental tradeoff," and once you see it you can't unsee it. Every subscription, every repeat order, every "let's just go to the usual place" is an exploit decision. Every new thing tried is an explore decision. Neither is wrong. The error is never updating the balance as your horizon changes.

Caching, Sorting, and Other Daily Algorithms

The chapter on caching asks a question I'd never thought to ask: what should you keep in your head, and what should you look up when you need it? Computers face this constantly, which is why your browser caches frequently used pages and fetches the rest fresh. The human version: knowing how to find an answer is often more valuable than knowing the answer, because head space is limited and the right thing to remember changes. But some things are worth caching: the things you use constantly, the things that are expensive to look up, and the things that compound.

Sorting got me too, unexpectedly. The book notes that sorting is expensive, which is why it can be rational to leave things slightly unsorted. The person with a messy desk who can still find everything has optimised differently: they've accepted the cost of a linear search to avoid the cost of constant sorting. I felt very seen. There's a whole genre of productivity advice that assumes order is free. It isn't, and some of the most effective people I know are running surprisingly unsorted lives.

Questions I'm Still Carrying

  • The 37% rule assumes you can't go back. But real life has second chances, callbacks, and "actually, I changed my mind." How much does the optimal strategy change when you can revisit old options?
  • How do you know your time horizon? The book treats it as a known quantity, but careers, relationships, and even lives have horizons you can't see clearly. Is the horizon itself something you should explore?
  • What's the human equivalent of cache invalidation? When the thing you've memorised becomes wrong, how do you notice, given that you've stopped looking it up?
  • Some of the best decisions I've made were neither exploration nor exploitation, they were mistakes that accidentally opened doors. Is there a formal model for serendipity, or is that just exploration with bad marketing?
  • If sorting is expensive and unsorted lives can be rational, what's the optimal level of order for a given life? Does it change with age, with work, with who you live with?