My 11/08/09 Missoulian column
Last week was nice weather after those early blasts of winter, so I figured it was a good time to get the snow tires on the truck before snow really arrived.
But what do tires have to do with computers and technology? I once taught the abstract concept of computer algorithms, with the example of the process of changing a flat tire, and illustrated to my class some basic points about how algorithms work.
In “computer speak,” an algorithm is a clear description of the process to get something done with software. And because algorithms can be very abstract – and changing a flat tire is practical – I had my class work on an algorithm that could theoretically change a tire.
We quickly whiteboarded a diagram of how to change a flat, but I reminded the class that first, we had to determine if there was a flat tire. We have common sense, but for an algorithm and the computer that runs the software, there’s no such thing.
We have to tell a computer absolutely everything because it doesn’t have any other way of knowing what we want it to do.
So we worked out an algorithm that would listen for the sound of a flat – and if there was a flat – methodically change the tire, using the jack, loosening and then tightening lug nuts, and replacing the hubcap, if there was one.
Then I asked the class: How does the algorithm know when the flat tire has been changed?
They didn’t know. I said just because the algorithm changed a flat doesn’t mean it knows that it’s done.
Any complete algorithm has to have a starting point, a stopping point and be complete in all details in between.
If the algorithm didn’t have a way to determine the flat tire had been correctly changed, the algorithm might go around and around the truck, changing tires forever.
The moral of the algorithm? It’s not that computers are stupid. It’s to be sure your algorithm and your software is complete, does the job correctly and stops at the right time.
And part of our own snow-tire algorithm is remembering to take the those tires off in the spring.