The subtle art of applying computer science to life

My dad is a Project Management Professional (PMP) with decades of experience and often points out that my mother is not following project management best practices when she goes about doing chores around the home, which typically leads to an argument but no application of said principles. Similarly, I have tried to apply computer science concepts in my life with mixed success.

I was an undergraduate when I started seeing connections between computer science concepts and “real life,” probably due to my courses drawing heavily on real-life analogies to illustrate those concepts: library card catalogues as hash maps and arrays, packing backpacks and making change using dynamic programming, “if it rains I carry an umbrella” as Boolean equations. I decided to adopt computer science as a way of life, something like “method actors” who take acting to the next level and become their characters off the set, except that my set is life and I never step off of it. I was to totally embrace my identity as a computer scientist.

One of the first opportunities I saw was when my friends got together to play Clue, the murder mystery board game. After a few rounds of asking players if it was Professor Plum with the wrench in the ballroom and marking it down on a sheet of paper, I realized that I could instead input the information into a computer program and have it tell me what questions to ask in order to eliminate the largest amount of possibilities and solve the mystery the fastest. I wrote the program and during subsequent games my friends tolerated me as I played with them, laptop in hand, inputting information and even debugging my program, editing the code and recompiling between turns. Sure enough, I solved the mysteries, but I discovered that I had turned myself into a data entry clerk and effectively eliminated all the fun of the game, both for me and everyone else. As a result, I stopped writing computer programs to play games for me.

I saw another opportunity as a part-time salesman at shoe department of Foley’s department store. Every time a customer asked for a specific shoe in a particular color and size, I had to go find it in the back room. It was organized by brand and size, but it was still pretty big and took me about 5 minutes to find a shoe. I realized that particular shoes were more popular than others and I was grabbing them more frequently, so it would make sense to implement a temporal cache system, where a limited number of shoes, say 20 (the cache size), would always be present near the door. We could check that pile first and if we don’t find it there (cache miss), we would go search the rest of the room. I tried to use this system, but I wasn’t experienced enough to realize that this is a process change that would require explaining to everyone what this new pile of shoes was doing out of place and how to properly eject shoes from the cache and replace them, so after a failed attempt to explain this concept using technical terms to my very bewildered manager, I abandoned it (and the job) and set off to apply my computer science methods elsewhere.

Fast forward several decades to the present, I’m often disagreeing with my wife in one area in particular: storage. In her point of view, if you need something, you look for it. Need a pacifier? Search the diaper bag. Need a pan? Search the kitchen. Need the kid carrier? Search the guest bedroom closet — or the master bedroom closet, or the office closet, or the coat closet, or the garage.

As a computer scientist, if I was trained to do anything, it was to find the optimal solution. When it comes to searching, we do anything to avoid searching the entire storage container, also known as the “brute force” method. We sort data, transform it, turn it into a tree, hash it — anything. Any upfront cost is worth considering if it leads to a faster look-up time later (with some exceptions, such as write-heavy applications or small collections). The fastest is “constant time” look-up, meaning that you find something in a specific amount of time, even as your collection grows. Far from being a brute, I expect the diaper bag, kitchen, and home to be organized such that I can find anything in constant time. The diaper bag is packed? I still want find the tiny pacifier instantly in the right side pocket. I’m making tea? I still want to find the Earl Grey instantly on the second shelf of the cupboard to the right of the microwave. Anything else is inefficient.

The only problem is that putting things in their place takes more time than my wife is willing to spend, especially when it requires remembering the intricate categories (clusters) that I had created of all the kitchen items. Tea cups go in the “tea” cabinet, not “cups and mugs” cabinet! Yes, they are equidistant from both clusters, so I chose randomly and you just have to remember. I’m not allowed to stick labels on the cabinets because it would ruin the aesthetic, so I’m researching pretty ways to label kitchens. As for the diaper bag, I’m going to start small with having the a place just for the pacifier and go from there.

One last thing I tried to optimize recently was the board game Jackaroo. Each round starts by passing cards from the deck to all players. I realized that I can save time by passing out cards while I’m waiting for my turn, but that just ended up confusing everyone. They couldn’t just ignore cards in front of them until the next turn. I evolved my method to pass them out off to the side and then give them to the players when it was time. It worked, but I was repeating the Clue mistake; I was taking the fun out of the game.

There is a time to optimize and there is a time to play. We can all (computer scientists included) learn to differentiate.

PS: I showed this article to my wife who rightfully pointed out that I typically take off my socks and leave them in random places around the home, which is hardly the behavior of an organized computer scientist. I’ll work on that!

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment