## Friday, October 15, 2004

### Twelve Routes to Useless Computation

How very Zen-sounding. How very useless. Even if the goal is only to explore a new tool or a new mathematical idea, there must be some goal to guide a computation.

2. Solve the wrong problem

Also known as the build a swimming pool to avoid getting wet approach. This is a popular means for mathematicians to make themselves the butt of jokes ending with lines like consider a spherical cow.

3. Assume there exists a unique solution

There is an old joke about a mathematician who wakes to see that his blanket is on fire, sees a bucket of water in the corner, exclaims A solution exists! and goes back to sleep. I know of no comparable joke about an engineer with thirty feet of rope with which to build a bridge across a forty-foot chasm, but there ought to be one.

4. Put the method before the problem

You've done some work to reduce your problem to the solution of a large linear system, and you've decided to use dense Gaussian elimination with partial pivoting as your solution method. Your code runs slowly, so you buy a larger computer. After a month of painstaking work, you finally get an answer, which you proudly present to your boss. Your boss points out that while the equation 2x = b can indeed be solved using dense Gaussian elimination, dividing every element by two would have been much more economical, and fires you on the spot for gross incompetence.

5. Use the wrong level of abstraction

One-dimensional calculations are often easier than calculations in two and three dimensions. That doesn't keep people from devising elaborate theorems about the behavior of an equation on an n-dimensional manifolds when all anybody really cares about is the behavior on the interval [0,1]. This error is a favorite of novice C++ and Java programmers who supplant a modicum of common sense with a ton of object-oriented jargon.

6. Avoid useful tools

I'm not sure why people think it is more rigorous to write a half-assed code to solve a linear system (for example) rather than to use an existing library which is faster, more robust, better documented, and freely available. I'm also not sure why people solve medium-sized systems of linear equations by hand rather than use the computer. But there are people who do such things. May the Lord have mercy on their souls if they ever get between me and food in the process.

7. Insist on the wrong tools

If you want to solve a 2-by-2 linear system, do it in MATLAB, or Octave, or on your calculator, or by hand. Do not write a C++ program with a class hierarchy that takes three pages to describe. This is, of course, situational -- a C++ program with a three-page class heirarchy may be the right approach if you're solving a variety of types of linear systems, all with special structure that you can use, and you want to organize your ideas into a coherent library.

8. Don't consult the literature

It's good that you're a genius. We're all impressed that you managed to re-invent fire, the wheel, and the Edsel. Please be our competitor instead of our collaborator.