Suraj Deshmukh

Blog

containers, packaging, programming, hacks, kubernetes, openshift, fedora, centos

Suraj Deshmukh

6-Minute Read

Introduction

The book “Algorithms to Live by — The Computer Science of Human Decisions” is written by “Brian Christian and Tom Griffiths”. It fits into the genre non-fiction, psychology and computer science. The book is written lucidly. If you have a background in computer science, then this book is easy to follow. The book creates analogies of computer science algorithms with real-life situations. I felt that some metaphors sound good in reading than their application, so if you plan on applying the things explained in the book directly to your life, they might not work. Because real-life has a lot of constraints that can be simplified in a computer algorithm to solve a problem, so the algorithms don’t apply vis-à-vis.

Book Cover

About Book

The authors are qualified to write this book because Brian holds degrees in Philosophy and Computer Science. At the same time, Tom is professor of Psychology and Cognitive Sciences at the University of California Berkeley. So they have a perfect mix of what was needed for the book.

Apart from drawing the parallels between algorithms and real-life, the authors have done an exceptional job in removing the stigma around the word “Algorithms” by making it more accessible to the layman who has never learnt a “C” of Computer Science. But my opinions here cannot be impersonal because I knew algorithms already and I was only revising. For a layman, I cannot exactly say if they can go and read algorithms after reading this book and be able to grasp all of it.

The authors have succeeded in persuading the reader that solving a real-life condition, the way algorithms do it, is the most efficient way to do. The book does accomplish its goal of conveying the insights from computer algorithms and trying to apply it in real-life. But the aspects of their usage in real-life is questionable as I mentioned earlier. The book is written in an easy to understand language.

The authors have chosen one part of computer science in each chapter. The chapter commences with an explanation of a real-life problem. Then it dwells into the solution computer science provides us in this case. Finally, what readers can do in the various real-life restricted situation and finally ends with enlightenments from the chapter on what to do in certain aspects. For, e.g. this is the quote from the last paragraph of the chapter “5. Scheduling: First Things First”:

you should try to stay on a single task as long as possible without decreasing your responsiveness below the minimum acceptable limit. Decide how responsive you need to be—and then, if you want to get things done, be no more responsive than that.

Unlike the above, not all suggestions will be instantly relevant.

The book is not academic as some might feel from the title. Still, the mathematical aspects of algorithms are incredibly minimal or close to none. The book has humour in between while reading I found myself chuckling on one line or another. For, e.g. read this:

Tom’s otherwise extremely tolerant wife objects to a pile of clothes next to the bed, despite his insistence that it’s in fact a highly efficient caching scheme. Fortunately, our conversations with computer scientists revealed a solution to this problem too. Rik Belew of UC San Diego, who studies search engines from a cognitive perspective, recommended the use of a valet stand.

Impressions on me

I was already familiar with many CS algorithms. This book cemented my understanding by giving me something that I can easily visualise. My perception earlier was very computer-specific. I used to think only in terms of numbers and strings. Now it is more concrete, and I find myself identifying patterns where I can quickly apply a particular algorithm.

My favourite chapters from the book are “Scheduling: First Things First” and " Game Theory: The Mind of Others “. The former chapter helped me personally to devise a formula to prioritise the tasks that I do in my day to day life. Earlier I used to do it manually, but now I have added a formula in my Notion set up. With the later chapter, I had a lot of aha moments. It is because I had only heard about Game Theory but never knew what it was. This chapter gave real-life examples to explain what it is.

Imagine two shopkeepers in a small town. Each of them can choose either to stay open seven days a week or to be open only six days a week, taking Sunday off to relax with their friends and family. If both of them take a day off, they’ll retain their existing market share and experience less stress. However, if one shopkeeper decides to open his shop seven days a week, he’ll draw extra customers—taking them away from his competitor and threatening his livelihood. The Nash equilibrium, again, is for everyone to work all the time.

This book has removed one misconception that I had, that computers are very accurate with the results except in data science. I knew that in data science (machine learning) there is not a single answer, so there we can accept answers in probability. But it turns out there are so many situations in which computers rely on acceptable results and are not accurate. The reasoning behind these solutions not being exact is that it is costly to find a precise answer. We, as end-users, don’t realise it because the results are such and the probability of the solution being wrong is negligible.

“The idea of the error tradeoff space—I think the issue is that people don’t associate that with computing. They think computers are supposed to give you the answer. So when you hear in your algorithms class, ‘It’s supposed to give you one answer; it might not be the right answer’—I like to think that when [students] hear that, it focuses them. I think people don’t realize in their own lives how much they do that and accept that.”

One instance is in encryption:

In practice, modern cryptographic systems, the ones that encrypt Internet connections and digital transactions, are tuned for a false positive rate of less than one in a million billion billion. In other words, that’s a decimal that begins with twenty-four zeros—less than one false prime for the number of grains of sand on Earth. This standard comes after a mere forty applications of the Miller-Rabin test. It’s true that you are never fully certain—but you can get awfully close, awfully quick.

Closing Thoughts

I would highly recommend this book to everyone. Anyone with a computer science background would highly enjoy the book because you can correlate with real-life circumstances. If you are studying computer science, then this is a highly recommended book because you will have another layer of understanding after reading this book. I have taken a ton of notes while reading this book, so I would not recommend the audio version of the book. There are charts and graphs in the book, not sure how they can be comprehended when listening to an audiobook. Look at the highlights from the book and maybe decide for yourself if this book is for you.

  • More information about the book on goodreads.
  • My highlights from the book.
  • Following videos helped me before I started reading this book.

and

  • DISCLAIMER: All the quotes in this blog are copyright of the authors.
comments powered by Disqus

Recent Posts

Categories

About

I am a Software Engineer at Kinvolk, working on various tooling around container technology like Docker, Kubernetes.