8/31/04

       Dr. Patt:
       The text for ee306 says that a procedure is an algorithm if
       it is finite (guaranteed to terminate). Lets say that I
       have a procedure that terminates when a certain set of data acts as
       an input. But, if this data forms only a portion of the larger set
       from which the procedure can draw inputs, is the procedure
       considered an algorithm? For example, if a procedure terminates
       with input from set (3,4,7) but draws input randomly
       from set (3,4,7,8,6) is the procedure an algorith? Do all
       available inputs have to result in completion of the
       procedure for the procedure to be considered an algorithm?

       Your student,
       << name withheld to protect the guilty >> 

Good question. Quick answer: yes. The procedure has to terminate for all inputs. Terminate does not mean an answer you would like. For example, the procedure could be to add up a column of digits and the input could be 3, 4, 9, &, 6, #. The procedure could print "& is not a digit; no SUM can be computed," and then terminate.

Yale Patt