The Five-Step Process of Donald Knuth

by Sam Savage

Worthless Clichés

Life is full of helpful sounding procedures for improving your memory, losing weight, landing that perfect job, etc. I have found most of these to be worthless clichés with one notable exception: the five-step process of the renowned computer scientist Donald Knuth. In fact, it is the only thing I am religious about.

When I was studying computational complexity in graduate school in the early 1970s, I was exposed to Knuth’s multi-volume set on computer science, much of which went over my head. But early in one of the volumes he lays out the five steps of writing a computer program, which I have found invaluable in many settings. I state these in the context of analytical modeling, which I do more of these days than programming.

The Steps

  1. Decide what you want to do.
    What is the purpose of the analysis? Who is the audience?
  2. Decide how to do it.
    Is a spreadsheet adequate for the analysis or will I need a more powerful tool? Will I model time discretely or continuously?
  3. Do it.
    Put fingers to keyboard and press appropriately.
  4. Debug it.
    Of course it didn’t work as planned. Who do you think you are, Einstein?
  5. Trash steps 1 through 4 now that you know what you really wanted in the first place.
    The power of recursion!

Get to Step Five Fast

I’ll bet your organization spends a lot of time in steps 1 and 2 and calls it planning. I say, get to step 3 with a primitive prototype as quickly as possible. You will then be at step 4 before you know it, which qualifies you for the true enlightenment of step 5.

I consider myself a black belt in the Step Five Process. When I start a new modeling project, I am completely confident that I don’t know what I want, so I only spend 3 seconds on step 1. I give myself much longer on step 2, 30 seconds. If it takes longer than that, I quit. Step 3 is where the time comes in. I put on headphones, switch to my Eagles Channel on Pandora (as much as I love classical music, it does not work here), and typically work for 15 to 30 minutes before finding the fatal flaw, which I must debug. I don’t spend a lot of time debugging at step 4, maybe 5 minutes, because I know that step 5 is inevitable, and I can’t wait to start again on what I now think I wanted in the first place.

When do I terminate the Step Five Process cycle? When my model is dead! A living model is always evolving in this manner.

Standardized Risk

According to George Bernard Shaw, “The single biggest problem in communication is the illusion that it has taken place.” The poster child for this conundrum is the word risk.

You worry about the risk of XYZ stock going down, but I’ve shorted it, so I worry about XYZ going up. I offer you $200,000 in cash or a coin toss worth 0 or $1 million and you take the cash. Bill Gates risks the coin flip.

Bottom line: risk is in the eye of the beholder.

Yet most risk management techniques serve up “risk” as a single number, or worse, a color on a heat map, which is blind to risk attitude. No wonder Doug Hubbard, author of The Failure of Risk Management: Why It’s Broken and How to Fix It, argues that most current methodologies “are no better than astrology.” Both Doug and I agree that a promising approach is the computer simulation of uncertainty, but most risk simulations are siloed, and cannot be networked together into integrated systems. This will take a degree of standardization which is just emerging, and which will need to take place on multiple levels.

As an analogy, consider the standardization of financial statements.

Uniform Formatting defines how things look (let's go with the green stripe).


Formatting helps organize information visually, but does little else. The risk management version is a heat map. Don’t get me started!


Uniform Calculations define what things mean.


Risk calculations are typically done three ways:

  1. Not at all
    Doug Hubbard and co-author Richard Seiersen deride calculations with heat maps as “Orange times fish plus purple times birds equals Pee Wee Herman.”
  2. With averages
    The good news: averages are easy to calculate with. The bad news: they lead to the Flaw of Averages. I will address this in a future post, but you’d better use an incognito browser when you read it.
  3. With simulations
    Simulations preserve the uncertainty of risky situations, allowing results to be viewed according to the beholder’s individual risk attitude.

Here an important calculation is:

Risk = Likelihood of Failure x Consequence of Failure

If you treat Likelihood and Consequence as single numbers in this expression, stay tuned for my upcoming diatribe. If you use it in a simulation which conveys uncertainty, then game on!

Uniform Representations define how things are communicated. 

Hah! You thought we were done. But if you can’t communicate the results in an actionable way you are stuck in your own silo.


Hindu-Arabic numerals are so entrenched that we don’t even realize we have a choice. At we are working with others on an analogy for conveying uncertainty between simulations.

Our open SIPmath Standard represents uncertainties as arrays of simulated trials called Stochastic Information Packets (SIPs). Doug Hubbard is developing a family of portable random number generators that have already been adopted by the SIPmath Tools available on our website, and may eventually enable massive networked simulations that communicate across the economy. Tom Keelin's new representation for probability distributions, called Metalogs, also appears in our tools. I will devote a future blog to Tom’s mathematically elegant and practical invention.  

The theme of our Annual Conference in San Jose on March 27th and 28th is Standardized Risk and Doug, Tom, and I will be presenting. I hope you can join us.

Do you have ideas of your own that you want to share with the world? Send us an email.

Sam L. Savage
Executive Director

Connecting the Seat of the Intellect to the Seat of the Pants


In his 2011 book, Thinking Fast and Slow, Daniel Kahneman divides the human thought process into a fast, intuitive component, System 1, and a slower analytical side, System 2. This is a useful dichotomy, and I refer to these systems as "the seat of the pants" and the "seat of the intellect," as sensitively portrayed by Jeff Danziger in my 2009 book, The Flaw of Averages.

Kahneman claims that System 1 is bad at understanding statistics because it can only focus on one thing at a time, and System 2, which can handle many things at once, is slow and lazy and may not be consulted in the heat of decision making. 

But when you put System 1 and System 2 on what Steve Jobs called a Bicycle for the Mind (a computer), you can connect the seat of the intellect to the seat of the pants and fundamentally change your thought process.

This is one of the advantages of SIPmath for performing probabilistic analysis. First the SIP itself, as an array of thousands of potential outcomes, is "one" thing that contains "many" things. Second, because SIPmath simulations in Excel yields results in real time by evaluating thousands of possibilities per keystroke, it can tap into our limbic system, with its tens of millions of years of evolution.