The "Why-Don't-You-Just...?" Barrier in Discrete Algorithms

One of the big differences between teaching discrete algorithms and teaching a more conventional mathematics course is that students will almost always see some way to construct an algorithm, while much less often will they be able to prove a theorem without assistance. The first thought that we have about how to solve an algorithmic problem is, however, often very far from an efficient or elegant solution. The idea that the problem is trivial, because "why-don'tyou-just. . . [insert here the thought which comes first to mind]?" constitutes a formidable barrier to the presentation of the subject, because one is often not ready to listen to a more difficult solution before being convinced that the simpler solution is undesirable. (I must hasten to add that I have taught extremely bright students whose first thoughts were very desirable indeed!) For this reason it seems that the best strategy for the teacher is to pose the problem, and then to listen to the various suggestions that will come from the students, discussing with them the execution time, storage requirements, elegance, compactness of program, etc., of their proposals in some detail, before proceeding with the presentation of a difficult algorithm. I would like to offer a few examples of this kind of situation-where some solution is immediately evident, but the best solution is some distance away. These examples arose in connection with teaching from a book [1] and illustrate the point fairly typically. As a small introductory tidbit, consider the calculation of Fibonacci numbers f1Jf2Jf3, . . When I teach an introductory computer course and assign this for homework, I find that most students will program the recurrence exactly as it appears in its written form, namely