Header image
#0105
Algorithms

Stack of lettersBack when I graduated college in 1963, banks used to send out unsolicited credit cards to new graduates. I guess they figured that college graduates were a good bet financially, but of course this eventually got them into trouble. Within a few years that practice stopped, although I still get unsolicited "preapproved" credit card applications daily.

Quite a few years after my graduation, I was going through a backlog of incoming mail that I had ignored for a couple of weeks. I picked up the stack from the IN tray, and foolishly started opening the letters from top to bottom. This meant that I was seeing the most recent letters first.

A little way down, I came across an envelope containing a credit card from the "People's Bank of Georgia". I had never heard of the People's Bank of Georgia, and I certainly had not asked them for a credit card. I was rather surprised that there was still a bank sending out unsolicited credit cards, and I cut the card up.

A little bit further down in the stack of incoming mail, I found a letter from a bank with which I did have a credit card. The letter informed me that they were transferring my account to the People's Bank of Georgia, and that I would shortly receive a card from that bank to replace the card that I currently held. That would be, of course, the card that I had just cut into pieces.

Well, I figured I would write a letter to the People's Bank explaining that I had accidentally destroyed their card, and asking for a replacement. But this didn't seem urgent, as I did have another credit card which I could use. Time passed, and I never did get around to asking for a new card. A year later, a letter came in from the People's Bank of Georgia. It contained a new credit card, since apparently the one that I had cut up had been valid for only one year.

But what I found interesting, and what prompted me to tell this story, was what followed in the letter. The bank informed me that during the entire previous year, I had never paid a bill late. Therefore, the bank was increasing my credit limit.

I actually burst out laughing. Of course, I had never paid a bill late, because I had never paid a bill at all. Since I had cut up the card immediately upon receiving it, I had never made a single purchase, and thus had never even received a bill. Yet the letter was very clear in stating that my credit limit was being raised because I had never been late in paying at any time during the previous year.

As a computer programmer myself, I could almost picture the code that had been written to cause this automated letter to be sent out:

     Set LateCount to 0.
     Scan the customer's record month by month {
         If paid late that month, Set LateCount to LateCount+1}.
     If LateCount=0, increase customer's credit limit.

An algorithm is "A specific set of instructions for carrying out a procedure or solving a problem, usually with the requirement that the procedure terminate at some point." This definition is from Wolfram Mathworld.

The set of instructions that implement an algorithm in a computer is called a computer program. Perhaps the bank's programmer had not thought sufficiently about his algorithm. I don't think that the bank really wanted to increase the credit limit of customers who had not used their credit cards at all. But of course, if you've never paid a bill, you've never paid one late.

Then again, maybe the programmer had done exactly what he was told. If the program specification he was given said, "Increase the credit limit of customers who never paid late last year", well then, his program did exactly that. Accurately specifying what you want can be just as difficult as creating an algorithm to implement the specification, as shown in this Wizard of Id cartoon:

What do you really want?

Algorithms, and hence computer programs, very frequently produce unanticipated side effects. Of course, side effects are not confined to computer programs. Consider a Tumbleweeds cartoon of 1979, in which the Indian Native American "Limpid Lizard" dresses in a chicken costume, the better to be able to get close to Buffalo in order to hunt them.

The last frame of the cartoon (shown below) depicts Limpid Lizard, dressed in his chicken outfit, saying, "This'll go down in histry as the big Limpid Lizard chicken wipe-out!" But he's about to be attacked from behind by a pack of ravenous wolves, who, of course, think he's a chicken:

Tumbleweeds cartoon, last frame

As Vice President, Research and Development at Kronos, I had this cartoon posted outside my door for years, with the caption, "A typical software bug: the unexpected side effect". I still have that copy of the cartoon, now over 32 years old, and yellowed with age. Click the next link to see the entire cartoon.

It's interesting to me that the Wolfram Mathworld definition of "algorithm" includes the requirement "that the procedure terminate at some point." To me, a procedure that never terminates is still an algorithm. It's just a bad one. There's a joke about a computer programmer found dead of exhaustion in his shower, his hand clutching a bottle of shampoo. On that bottle are the instructions:

          Lather
          Rinse
          Repeat

The joke is not just about an algorithm with what's called an "infinite loop", but also about the rather literal-minded nature of some computer programmers. And perhaps some people like computer programming precisely because computers are renowned for taking their instructions literally.

Of course, if the algorithm embodied in the computer program doesn't include any "common sense", the result can be quite annoying. Government bureaucrats could do that even before the days of computers - particularly the military, which has rigid procedures for everything.

I once read a story about a soldier discharged at the end of World War II, whose final accounting somehow left him owing the Army two cents. Every month, he received a bill for that amount, sent in an envelope with a stamp of substantially greater value. And every month he ignored the bill, thinking it silly to send a check for $0.02 (besides, in those days, he was probably charged for each check).

But a few years later, he was informed by the Army that he had been awarded the Congressional Medal of Honor, for heroism in action during the war. At the time, that medal came with a $100 cash award. So he shortly received a check from the Army for $99.98, along with a letter stating that his account had been closed.
 

Footer image
#0105   *TECHNOLOGY

Next in blog     Blog home     Help     Next in memoirs
Blog index     Numeric index     Memoirs index     Alphabetic index
© 2011 Lawrence J. Krakauer   Click here to send me e-mail.
Originally posted November 17, 2011

Bottom image