The invaluable trait of mindfulness
On Monday night I rode home from work (for the first time, but more about that in another post). When I arrived, ragged and weary, I sat myself down in the kitchen, and the kid brought her homework over to me to ask a question. It was last week’s homework, and one of the exercises gave a list of numbers, and, for each, asked for pairs of prime numbers whose sum are their equal. For example, 44 = 31 + 13. Ava had no problem finding the solutions, but her teacher wrote in red marker “These sums are all correct, but you’re supposed to use prime numbers. Eg, 1, 3, 7, 13, etc.”
I looked the equations over, and, as far as I could see, she had correctly used primes in each. Except one. The number 91 jumped out at me as not being prime-y. In my light-headed state I had trouble factorizing the number, so I did the laziest of all things: I pulled out my phone and googled “factors of 91”. The answer came up immediately. 91 has the factors 1, 7, 13, and 91. It is strange that the teacher had written a long note without highlighting the single incorrect answer. Marking dozens of 9-year-old children’s homework, perhaps she was feeling as weary as I was.
Later on, I thought about the strange thing that happened when I’d pulled out my phone. A modern smartphone is an impressive computer. My Nexus One is more powerful than my state-of-the-art desktop PC was 10 years ago, and is perfectly capable of factorizing a small number. But I didn’t ask it to. Instead, I told it to make a request that traversed a mobile network (comprised of tens of computers or routers), the open internet (20-50 computers), and into Google’s search infrastructure (thousands). There, in vast indexes, a reference was found to a site that could answer my question. The page at WikiAnswers clearly states “The factors of 91 are 1, 7, 13, and 91.” (This answer was first answered by ID1675776180, and last edited by Sxmaxloop1.)
My request directly invoked the resources of thousands of computers, and indirectly used the energies of at least two other human beings (plus their supporting infrastructure). All to answer a question that could have been solved by my 8-bit ZX Spectrum (circa 1983) in the blink of an eye, or, simpler still, by thinking about it slightly longer than I had bothered to. I had to laugh at the absurdity of it all.
We do stuff like this with technology all the time. By its very nature, technology makes it easy to solve trivial problems, even we don’t arrive at the solution by the most efficient (or reliable) means. A solution that works is, more often than not, good enough. Until it isn’t.
A poor algorithm will go unnoticed as long as it is fast enough to run within the available resources. Too often in this industry hardware is used to solve software problems. A lot of Google’s famous interview questions try to determine if the candidate can think in terms of efficiency and scale. This is because when your software is running on tens (or hundreds) of thousands of computers, a solution that works is just not enough.
In my professional life, I’ve worked on systems that cost absurd amounts to run simply because they were poorly designed. We didn’t take the time to do things right at the start, and we had to make up the difference with brute force. This meant crazy hardware configurations running software ill-suited to our needs. Living with this fragile and unpredictable setup was a stressful and frustrating experience. Yet, at every point in the development process, what we had was “good enough.” The guys running the show thought this was a good thing; that it meant we were efficient, just scraping by with the bare necessities. To me, the approach seemed lazy, inefficient, and short-sighted.
Doing things the right way has a cumulative effect. The next time I have to factor a small number, I’ll do it in my head. Not only will my arithmetic skills be better for it, but the simple process of thinking through the problem builds the invaluable trait of mindfulness.
Thinking in terms of efficiency is good for your mind, and – through your considered actions – better for the world around you. The next time you find yourself reaching for the easiest of solutions, stop to think whether there’s a better way. It might be worth the effort.
40566 views and 2 responses
Sep 19 2010, 3:24 AMEivind responded:I think you should consider mentioning to the teacher that 1 is not a prime.
Sep 19 2010, 4:51 PMAndrew Gerrand responded:Hah! I'm not sure now whether I introduced that error or if it was in the original note.