This weekend I read an interesting post about Occam’s Razor but decided not to blog about it, until I came across someone misusing Occam’s Razor and couldn’t suppress the need to clear my throat. In a post about digital camera pricing, I read the following sentence:
Occam’s Razor tells us that the simplest answer is the most likely one.
This is not correct. Here’s how Wikipedia defines Occam’s razor:
Occam’s razor, often expressed in Latin as the lex parsimoniae, translating to law of parsimony, law of economy or law of succinctness, is a principle that generally recommends selecting the competing hypothesis that makes the fewest new assumptions, when the hypotheses are equal in other respects.
The important part of the sentence is not about simplicity, but about selecting a hypothesis. When you’re trying to figure out which explanation for something you’ve observed is correct, the best approach is to test the hypothesis that you can eliminate most quickly. This has nothing to do with the fact that the simplest answer is probably correct, but rather that it makes sense to start with the possibilities that are easiest to eliminate.
This is particularly relevant to scientific experimentation, but it applies to problem solving in general. When you find a bug in your application, Occam’s razor would suggest that it makes sense to start by examining the code you just wrote yourself rather than checking Google to see whether there’s a bug in MySQL that has suddenly manifested itself and caused the incorrect behavior.
Blaming your own code requires only one new assumption — that you made a mistake when you were writing code that has yet been tested. Blaming MySQL requires you to assume that there is a bug in MySQL that has not been fixed or perhaps even detected and that your code (which is theoretically correct) somehow causes this bug to manifest itself. Perhaps to you, looking at your own code first may seem blindingly obvious, but to many developers it is not.
The point here is that Occam’s razor is a tool for problem solving (or experiment design), not a short cut that lets us skip problem solving entirely. In many cases, the simplest explanation is not correct, but it’s hard to be sure until you’ve eliminated it as a possible explanation.
There is value in adapting to the world
When I was younger, I was obsessed with the following maxim from George Bernard Shaw’s Maxims for Revolutionists:
That quote sprung to mind when I read this post by Sam Stephenson where he explains why he doesn’t invest too much effort in his dot files. Here’s the key bit:
I fall more into Stephenson’s camp than I do into Shaw’s at this point, at least when it comes to my own tools. As software developers, we are trying to build things that adapt the world to ourselves, but with experience, I find it more and more important not to bind myself too tightly to any particular tool or process.