Learning Iteration and Recursion from Examples

Recursion is basic to computer science, whether it is conceived of abstractly as a mathematical concept or concretely as a programming technique. Three experiments were carried out on learning iteration and recursion. The first involved learning to compute mathematical functions, such as the factorial, from worked out examples. The results suggest the subjects are quite able to induce a computational procedure for both iterative and recursive functions. Furthermore, prior work with iterative examples does not seem to facilitate subsequent learning of recursive procedures, nor does prior work with recursive examples facilitate subsequent learning of iterative procedures. The second experiment studied the extent to which people trained only with recursive examples are able to transfer their knowledge to compute other similar recursive mathematical functions stated in an abstract form. It turned out that subjects who transferred to abstractly stated problems performed somewhat worse than they had performed previously when given examples. However, they did far better than a control group trained only with an abstract description of recursion. The third experiment involved comprehension of iterative and recursive Pascal programs. Comprehension of the iterative program was not affected by prior experience with the recursive version of the same program. Comprehension of the recursive version was only weakly affected by prior experience with the iterative version.

[1]  Elliot Soloway,et al.  Preprogramming Knowledge: A Major Source of Misconceptions in Novice Programmers , 1985, Hum. Comput. Interact..

[2]  Mark Weiser,et al.  Programming Problem Representation in Novice and Expert Programmers , 1983, Int. J. Man Mach. Stud..

[3]  John R. Anderson,et al.  Learning Flow of Control: Recursive and Iterative Procedures , 1986, Hum. Comput. Interact..

[4]  Susan Weidenbeck,et al.  Processes in computer program comprehension , 1986 .

[5]  Patrick Henry Winston,et al.  The psychology of computer vision , 1976, Pattern Recognit..

[6]  Patrick Henry Winston,et al.  Learning structural descriptions from examples , 1970 .

[7]  H A Simon,et al.  The theory of learning by doing. , 1979, Psychological review.

[8]  Elliot Soloway,et al.  A Goal/Plan Analysis of Buggy Pascal Programs , 1985, Hum. Comput. Interact..

[9]  Beverly Woolf,et al.  Problems, plans, and programs , 1980, SIGCSE '80.

[10]  K. Holyoak,et al.  Analogical problem solving , 1980, Cognitive Psychology.

[11]  B. Adelson Problem solving and the development of abstract categories in programming languages , 1981, Memory & cognition.

[12]  Suzanne K. Damarin,et al.  The second self: Computers and the human spirit , 1985 .

[13]  K. Holyoak,et al.  Schema induction and analogical transfer , 1983, Cognitive Psychology.

[14]  Roger W. Schvaneveldt,et al.  Programmer-nonprogrammer differences in specifying procedures to people and computers , 1987, J. Syst. Softw..

[15]  Seymour Papert,et al.  Mindstorms: Children, Computers, and Powerful Ideas , 1981 .

[16]  Kate Ehrlich,et al.  An empirical investigation of the tacit plan knowledge in programming , 1984 .

[17]  Hank Kahney,et al.  What do novice programmers know about recursion , 1983, CHI '83.

[18]  P. Pirolli,et al.  The role of learning from examples in the acquisition of recursive programming skills. , 1985 .

[19]  Rachelle S. Heller Different logo teaching styles: do the really matter , 1986 .

[20]  John R. Anderson,et al.  Learning to Program in LISP , 1984, Cogn. Sci..

[21]  Frederick Hayes-Roth,et al.  Learning by Example , 1978 .

[22]  Roy D. Pea,et al.  Children's Mental Models of Recursive Logo Programs , 1985 .

[23]  John R. Anderson,et al.  A General Learning Theory and its Application to Schema Abstraction1 , 1979 .