LANDAMATICS IN TEACHING COMPUTER PROGRAMMING

 

Laurence L. Leff, Ph.D.

Department of Computer Science, Western Illinois University

Macomb IL 61455

 

LANDAMATICS

Landamatics in Teaching Computer Programming.

 

ABSTRACT

Landamatics is a technique where the teacher precisely defines and teaches the steps to do a problem. The students are trained to execute steps that are as precise as those that would define a computer algorithm It has been used with success in such fields as mathematics instruction and training insurance company personnel to process claims. This paper show its use in teaching programming. It draws on examples from the author's teaching in CS1, CS2, and CS3. This method is analogous to the templates in the famous Programmer's Apprentice project. Landamatics has increased the number of assignments completed in my classes. This was shown in a data structures class at the p=0.01 level.

 

INTRODUCTION

Those of you in teaching programming have seen the following scenario. A student knows the syntax of a programming language. The student knows what each statement does. Yet, the student cannot put the statements together into a program. The teacher is tempted to say, "the student just can't think" and throw one's hands up in despair.

Lev Landa (1975) said, "It is common knowledge that pupils very often possess knowledge that is necessary in a certain subject, but they cannot solve problems. Psychologists and teachers often explain this by saying that their pupils do not know how to think properly, they are unable to apply their knowledge, the processes of analysis and synthesis had not been formed in their minds, . . ." . Dr. Landa reports on an interview with a teacher of mathematics. Here, a teacher referred to one of her students who had just received a D in a geometry test. She said, "He doesn't know how to think. He didn't figure out that the chord should be considered as the side of an inscribed angle." Lev Landa asked, "why couldn't he figure it out?" The teacher responded, "He couldn't figure it out because he couldn't figure it out, that's why." Lev Landa points out, "the problem ended where it really should have begun." (1976) This paper tells you how to begin when you have students in your class who appear not to be able to think--when you ask them to write a program.

Lev Landa has developed an instructional technology termed Landamatics that addresses this problem. My paper shows how to address these students and their problems. As I show, these techniques enable the students to produce more programs and more complicated ones than they would have otherwise.

Dramatic results have been achieved by Landamatics. In one set of experiments, Dr. Landa developed a technique for breaking down the thinking processes for geometrical processes. In teaching proofs in a high school geometry class, the operations necessary to construct a proof were isolated. This is in comparison to the standard method where students are simply taught the concepts and theories of geometry and then shown examples of proofs. The teachers selected students who knew the necessary facts in geometry. This was shown by a test, and reinforced by review of the material. However, the teachers felt that these individual students could not solve problems and "were not skilled in the general procedures of thinking." Prior to the instruction based on Landamatics, the students were only able to solve an average of 25% of the problems--the best students of the group could only get 40% of the problems right. After the Landamatics instruction, in the second test, the students solved 87% of the problems!

L. Landa (1975) did a similar experiment in a class teaching Russian grammar. Here Landamatics reduced the number of mistakes by seven fold. Using these techniques, Dr. Landa reduced a four-year course to three years instruction with much better student performance.

Business Week had a recent article on Landamatics (Port, 92). Many businesses have been using Landamatics in industrial training. One business achieved a $35,000,000 savings. Allstate's claim processing operation improved productivity 75% and quality 90%. When, novices are trained in a business procedure using Landamatics techniques, their performance after the training is compared to those who have not benefitted from such training. Also, the trainees are compared to those who are experts. The trainees reach the performance of experts. Ford's Starnet subsidiary saved a million dollars. DuPont saved one million dollars in a quality check operation. After a demonstration project involving those processing claims, Allstate Insurance was so impressed that they trained a group of 23 "in-house Landamatics consultants," which was termed a Landamatics University. (Landamatics, 1993)

In my work, I prepare templates for the students for each type of program they are to do. These templates contain a general version of the program. It would have words or lines in italics that act as a placeholder showing the students where to fill things in. There would be hints or areas that provide the students choices for the code to be filled in. Once the students filled in the necessary parts, they would have a program that would solve the specific homework problem posed to them.

Such a template follows in spirit the template used in Rich's "Programmer's Apprentice." He observed that expert programmers have many patterns that they would use in programming. A programmer does not develop each new program from scratch. Instead, he would observe that the problem matched a pattern they already had seen or developed. They could quickly enter the code. Rich developed computer technology that helps a programmer in applying these patterns, filling them in, and creating programs. (Waters,85)

Lev Landa (1985) observed a correspondence between his work in teaching geometry theorem proving techniques and that of Newell, et. al. These authors of course were famous for the General Problem Solving system in artificial intelligence and for which they earned the Turing award. Landa developed a method of extracting problem solving techniques for use in teaching and for individuals to execute manually. Newell developed a technique to allow automation and solution by programs. Dr. Landa developed his techniques of interviewing experts and setting up curricula on the subject based upon the rules the experts used to solved problems. This was done twenty years before the publication and publicizing of the techniques of knowledge engineering and expert systems. The difference is that Dr. Landa transformed these into manual expert systems and rules in printed form to be executed by human beings. Then, these novices were able to perform at an expert level. Feigenbaum and others of the expert system movement transformed knowledge elicited by experts into computer systems that were shown to perform at an expert level. [Landamatics, 93]

The Plan Calculus and Programmer's Apprentice Project at MIT in the 1980's developed techniques to allow the automatic generation by the computer of code to solve various types of problems. (Rich, 88) A knowledge engineer would create templates that correspond to frequently recurring code patterns. These templates are called "cliches" by those authors. There are "{...}" annotations which show where certain things are to be replaced. For example, one such template would be "CREATE simple REPORT" Lines in that cliche (written for ADA) read,

"while not {the empty test of the enumerator}(DATA) loop"

"{the print_item}"{CURRENT_OUTPUT, Modified},

{the element_accessor of the enumerator}{DATA}"

"DATA := {the step of the enumerator} {DATA}"

A program called KBEemacs helps the user use these cliches and fill in the annotations.

The template provides five options for filling in the enumeration function. These allow the system to fill in such annotations as {element_accessor of the enumerator} and {the step of the enumerator}. The user of the KBEemacs system would choose one based upon whether the data was in a file, in a linked list, in an array, etc.

This paper reports on programming students to generate programs by manually filling in templates that I provide. This is analogous to the relationship between Landa's work and that of the pioneers in artificial intelligence.

To put the analogy in precise form:

Lev Landa's Methods of Teaching Geometry : Simon and Newell's General Problem Solver ::

My Methods of teaching programming : Rich's KBEmacs

Erlich and Solway (1984) developed an experimental procedure to determine whether advanced programmers used plans. They developed pairs of programs that did the same thing. Each pair of programs followed a plan of attack like a "data-guard if" or "maximum search loop plan." The second program of each pair violated the expected assumptions of such a plan. They had both novice programmers and advanced programmers take tests of comprehension on these plans. Of course, the advanced programmers did better than the novice programmers. Both sets of programmers showed better on the "plan-like" program than the "unplan-like" programs. However, the advanced programmers had more of a difference in performance between the "plan-like" programs and the "unplan-like" programs than the novices did.

This showed that advanced programmers were more likely to use plans in thinking about programming than the novice programmers.

 

SOME CASE STUDIES

I have used this template method, applying the methods of Landamatics to the construction of programs, in several courses. These include our Computer Science Principles I, Computer Science Principles II, Assembly Language Programming, UNIX, LISP and a Graphical User Interfaces course(GUI).

I will introduce the method by showing parts or one templates used in each of Computer Science Principles I, Assembly Language Programming and LISP programming.

To best illustrate these techniques, I chose my examples from those templates for generation of a doubly-nested loop. They solve a class of problems which involve what I term a BIG PROPERTY and a SMALL PROPERTY. One such problem would be finding which row of a two-dimensional array had the largest sum. Our assembly language template is used to solve problems involving two-dimensional arrays. These have been posed to the students as a PASCAL program. It processes the array row-by-row. This program involves two nested loops. However, our template will convert the code to use pointers efficiently. I refer to these pointers in the template as the BIG ARROW and the SMALL ARROW. The template from the LISP class finds which list in a list of lists would have the largest sum.

Each Landamatics template handout consists of the following five components.

  1. A description of the class of problems that the template can solve
  2. A template to use to solve those problems.
  3. A discussion, often line by line, describing how to use that template
  4. A specific program generated using the template. This is often a program that was an example taught earlier in the course. At that time, the example was introduced and discussed in the conventional manner.
  5. An explanation showing how the sample program (d) was developed using the template (b). This often includes a line-by-line matching.

The discussion below giving you excerpts of three of the templates I have used shows the kind of information that would appear as part of the explanation.

 

OUR TEMPLATE IN CS1

This template helps students solve problems involving two-dimensional arrays. For example it would include finding the column with the most even numbers, determining which row has the smallest maxima or counting the number of rows with more than three sevens.

The template tells the student the precise form of the problem question (part a). This is the class of problems that the template will solve: 

The next part of the handout is the template itself. The student has to choose two variable names. Placeholders in the template are big-property-value and small-property-values. These are in italics so the student realizes that a substitution is needed--this corresponds to the annotations in ellipsis reported in (Rich, 88). (The packet includes a similar template which shows how to find a property of a column instead of a row. The template also includes an explanation of how to read in the data by row or by column. These are not shown in this article for space reasons.)

There are instructions for each line telling the student what to do for each line of the template. For example, the students would have lines telling them that for line 1, we would initialize big-property-value to zero when it represents a sum or a count. It would also indicate that this would be initiazed to a very large number when it represents a minimum and a very small number when it represents a maximum.

We include here the description for the most interesting line, the one with which students have the most trouble. That is Line 7 in Box 2, updating the big-property-value from the small-property-value. Box 4 shows a program produced with this template--one to compute the row with the largest sum.

Finally, in the handout, is a description of how the template [Box 2] relates to the sample program [Box 5]. We show the text explaining the Line 7 in [Box5].

OUR TEMPLATE IN ASSEMBLER LANGUAGE

In my assembler language course, we go over two-dimensional arrays and how they are mapped to a linear address space in the computer memory. The class discussion emphasizes problems that can be solved with nested loops processing each row or each column. In class, we show doing these problems more efficiently with two pointers. The big arrow represents a pointer to the row being processed. The small arrow represents a pointer to the element of that row that is being processed. (The Assembler language courses use the IBM 360 architecture [IBM87a] and [IBM87b].)

There is a similar template to handle situations where code is processed by column. Here the big arrow points to the top of the current column. The little arrow points to the element within that column.

The template is designed to solve problems presented using the pseudocode below. Since all the students have had a CS1 course, it is most convenient to explain the Assembler Language in terms of the equivalent PASCAL code [Box 6].

The handout and the class discussion show that one can recognize a row-by-row problem by seeing whether the variables are nested in the "for" loops in the same order as the subscripts of B. We also note that the "for" loops go up to p and q. Yet the arrays are dimensioned up to m and n. In class, we discuss the fact that the program is processing the upper-left hand corner of the array.

The second part of the template shows the students a template to generate the equivalent assembler code for the IBM 360 assembler language. This template is shown in Box 6. (The students had earlier been giving templates for creating FOR loops in Assembler languages. Thus, they could easily handle the lines in the template such as "FOR LOOP 1 stuff" and "END LOOP 2 stuff." )

 

Box 7 shows the Assembler Language program for the PASCAL:

     dimension B[1..10,1..10]
     FOR I:=1 to 3
       FOR J:=1 to 3
         B[I,J] := I+J;

This is the example component of the Landamatics handout (part d).

 

The last section [Box 8]explains the relationship between the program in Box 7 and the handout in Box 6. This forms the final component of the Landamatics handout.

 

THE LISP PROGRAM TEMPLATE

Our final example of a Landamatics template comes from the LISP course. Here we show the students how we process lists of lists, such as (( 4 5 1) (2 10) (11)) with nested loops. Again, the students are shown the class of problems solved by the template. For this template, that class is:

Provide the big property of the small property of each list.

See Box 9.

The sample program [Box 10] solves the problem of finding the list with the largest sum. E. G., in the list above, the answer would be 12, the sum of 2 and 10.

Box 11 contains a few extracts from part e. of the Landasmatics handouts:

 

USE IN COURSES

You have seen one template from each of three courses. To put the Landamatics in perspective, I list the templates used in several of my courses.

In my CS1 class, Introduction to Computer Science Principles, I used seven Landamatics templates. They are, in order:

  1. A template to handle file I/O.
  2. It allows reading input from an arbitrary number of external text files.

    Calculations are done with the values that were read into variables. At this point in the course, the students only know assignment statements and file I/O.

    Then an arbitrary number of output text files are created and values are written to each of them.

  3. A template to support "if" statements.
  4. Students first create a decision table from the written description of the problem. Then a Landamatics template helps the student generate the PASCAL "if" statements for the decision table.

  5. A template to create singly nested loops.
  6. This template supports loops containing an "if" statement. The type of problem solved is find the sum of all the positive numbers in a set of input data on a file.

  7. A template to create doubly-nested loops to process lists of lists.
  8. An input data file processed by this template might look as follows:

    2 4 5 -1
    4 8 6 2 -1
    7 2 -1
    -2

    The -1's indicate the end of an individual list. The -2 indicates the end of the entire input data set.

    A sample problem for this template is finding which list has the largest Sum

  9. The template to process rows and columns of a two-dimensional matrix (shown in Section 2.1).
  10. A template for reading in and sorting data with primary and secondary keys.

The kind of problem that it might solve would be to read information about a compact disk (CD) collection. For each CD, there would be an artists name, album name, number of songs and price.

A sample problem would be to sort the data by artist's name and then by album name.

  1. A template for creating procedures with parameters.

Here the students create a data flow diagram showing the flow of data from one procedure call to another. Then the Landamatics template helps them generate the procedure and the calls to that procedure.

In a CS2 course, students had two templates for linked lists. These allowed a one-dimensional array of big items, e. g., classes offered by a school. Each item in the array, had a singly-linked list of items, for example the students registered for that class. The template would read in a class and a student. After searching the array for the record for the class, the student would be added to the linked lists.

Linked lists were taught both as arrays where the "pointers" were simply subscripts into an array and using the conventional Pascal pointer. Templates were provided for both cases.

Another template supported records and binary search. And a final template supported problems with binary records.

I used five templates in our one-credit LISP course.

  1. the first set taught the student to translate "if" statements, "while" loops and "for" statements from PASCAL to LISP.
  2. the next template taught students to process and transform simple unnested lists.
  3. the third template was the list of lists template you saw (in section 2.3).
  4. the fourth template allowed the processing or transformation of arbitrarily-tested loops.
  5. the fifth template helped the student use the map and reduce statement.

Results and Conclusion

As mentioned earlier, I have used Landamatics successfully in several of my courses. Landamatics achieves efficiency gains in teaching, particularly in the problem solving component of the courses. This efficiency increase can be used in several ways: to reduce the time it takes to teach the same material, increase the percentage of students learning the material, the expertise level, or to decrease the student's error rate. (Landamatics, 93; Landa, 1975)

I chose to use Landamatics to increase the quantity and difficulty of the problems that the students accomplished. Yet, I maintained the same pass rate as the other faculty teaching other sections of the same class.

For example, in my CS1 class, all the sections had the students do an exercise involving sorting one dimensional arrays. In my classes, the students all students completed one or more sorting exercises where there were primary and secondary keys. This involved multiple one-dimensional arrays, each representing a column. This is one of the templates listed in Section 3.0. The other faculty teaching parallel sections of this course all had students simply sort a single one-dimensional array.

In LISP, 95% of all the students completed a difficult problem involving lists of lists. This was based on the template that I showed in section 2.3.

In assembler language, I achieved a passing rate of 90%. Yet, all of those students completed assignments in each component of the course. For example, using one template, the students all completed an assignment where they moved a bit field from one word to another. Other templates had the students doing programs with triply nested "if" statements and loops.

In a third course on data structures, I started using Landamatics in the third semester that I taught the course. This increased the number of assignments completed from 7.6 to 12.8 (significant at the 0.01 level) (Sheskin 97).

The interested but skeptical reader might raise the following questions at this point:

Wouldn't it be better if the students had the joy of discovering these techniques and templates on their own?

Are the students simply writing the programs following the templates without even understanding them?

What if a student encountered a problem that didn't fit one of the templates?

As (Waters, 85) points out, "it is not practical to be creative all the time" and "it is never practical to reason about anything from first principles." In [Anon93], Dr. Landa, states, "Despite the educational superiority of teaching how to discover algorithms on one's own and actually discovering them, it is practically impossible to have students discover by themselves all the algorithms they have to learn and know. Their life might not be long enough to do this." Yet, our courses in programming often do not teach the common cliche's. They simply leave our students to discover them on their own. Sometimes this occurs in our or later classes. Worse, the job is left until the student reaches employment.

Dr. Landa (1975) points out a process in which a student trained with Landamatics proceeds from the algorithmic stage to the post-algorithmic stage. In the first part, the student follows the algorithm, step by step. He checks each step and then applies that step to the particular problem. As the student continues to do problems using this technique, the mind will form unconscious associations between the items and the actions to be performed at each step. The step-by-step process is replaced by an involuntary and simultaneous post-algorithmic process. At this point, the student will recognize similarities between the objects in the algorithm. This statement reminded the author of a neural network which recognizes objects similar to those on which it was trained. Then the student will see associations and become creative in the use of the material.

Landa himself (1975) recognized that it is important that the students must be taught "how to discover algorithms on their own." In each of my homework sets I have three types variety of problems. The first set includes those that can be solved systematically with the Landamatics template with no creativity. The second set are those problems that are related to the template but require some twist or creative approach. The third set are "blue sky" problems that come from "left field" that have nothing to do with the template.

This has important implications in the grading method. See [SELF-94].

In short, Landamatics is a viable technique in the computer science classroom. It is not a substitute for conventional knowledge and principles instructions to help the students understand the material. However, it does help students learn how to complete problems and write more complicated problems than they would without these techniques.

References

  1. International Business Machines (1987). IBM Systems/370 Principles of Operation, Publication Number GA22-7000-10. Poughkeepsie, NY: Author.
  2. International Business Machines (1987) Assembler H Version 2 Language Reference, Publication No.GC26-4037-17. Poughkeepsie, NY: Author.
  3. Landa, L. (1975). Some Problems in Algorithmization and Heuristics in Instruction. Instructional Science. 4, 99-112.
  4. Landa, L. (1976). Instructional Regulation and Control: Cybernetics, Algorithmization and Heuristics in Education, Educational Technology Publications, Englewood Cliffs, NJ.
  5. Landamatics Ten Years Later: An Interview with Lev N. Landa (1993). Educational Technology. 33(6). 7-18.
  6. Port, O. (1992, September 21). Lev Landa's Worker Miracles. Business Week, No. 3284. 72-73.
  7. Rich, C. (1988, November) The Programmers Apprentice: A Research Overview. Computer. 21(1). 10.
  8. [Self, 94]Self-citation, "Contract Grading in the Computer Science Courses", submitted to Journal of Computer Science Education.
  9. Sheskin, D. J. (1997) Handbook of Parametric and Nonparametric Statistical Procedures. CRC Press, New York, NY.
  10. Soloway, S. and Erlich, K. (1984, September). IEEE Transactions on Software Engineering, SE-10 (5). 595-609.
  11. Waters, R. (1985, November) The Programmer's Apprentice. IEEE Transactions on Software Engineering, SE-11 (11). 1296-1320.