Algorithms to Live By covers the computer science of many of the problems encountered in the daily life of any human. It contains many types of optimization problems, from finding a car parking spot, city planning and finding a partner to more advanced game theory problems. The authors briefly explains some useful algorithms and when you should use them.
The book starts out with the famous solution to the optimal stopping theory problem, which tells you when to settle down in your love life, buy a house, hire a person and similar problems. This part have a lot of similarities to the book The Mathematics of Love by Hannah Fry. The only differences being that Algorithms to Live By tries to tackle the problem for a more general case. The assumptions here is that you meet potential partners in a sequential fashion and you can’t go back to the same person after your interaction with them is finished. The best algorithm to solve these problem is to reject everything during the first 1/e fraction (or ~37%) and then pick the next one that is better than all previous persons/houses. This gives you a chance of 37% to get the best partner, house or employee, which actually is the best you can hope for given the mentioned assumptions and goals. The authors also covers how this solution changes as soon as you start modifying the goal or the known information.
A different part of the book covers memory/caching and does a good job of attaching it to real world problems. For example, the authors describes the benefits of having a cache of clothes that is easily accessible and what to remove from the closet when it is full. Another small thing I liked in this part is its explanation for brain farts. Simply put, they are just cache misses. Other memory problems covered here are the problems that can occur when you receive more work than you can handle. For example, if you receive more emails than you can answer one of the best things you can do is to just answer the newest emails available. This helps to avoid thrashing as the rest of the emails are ignored/deleted.
Other small interesting things covered in the book is:
- Computational kindness – How you should strive to reduce the computational load on other people by reducing their options.
- How to optimize to minimize regrets.
- How to deal with game theory and tragedy of the commons problems. The only thing you can do in these cases is to try to change the rules.
I believe this book is a great soft starter for more technical books on algorithms as it provides many real life applications for the algorithms.