Electronic Proceedings of the Twelfth Annual International Conference on Technology in Collegiate Mathematics

San Francisco, California, November 4-7, 1999

Paper C027

Logic via Computer Programming

Agnes A. Wieschenberg


Department of Mathematics
John Jay College of Criminal Justice
445 West 59th Street
New York, NY 10019
USA
Phone: (212) 237-8924
Fax: (201) 567-1811


list of all papers by this author


Click to access this paper: paper.pdf

ABSTRACT

How do we teach logical thinking and sophisticated mathematics to unsophisticated college students ? There are many answers to the proposed question, one of them -- through writing computer programs. The writing of computer algorithms is mathematical problem solving and logic in disguise and it may attract students who would otherwise stop taking mathematics courses after their required sequence is finished.

Computer algorithms, however simple, employ logical steps which will result in the desired conclusion. In particular the use of the 'if' structure and the recursive nature of the 'for' and 'while' loops will help the students to develop logical thinking. The rewards in using the computer are immediate. Running the program that the student has just written will allow him/her to 'see' if it has worked or not. More often than not, the program will contain logical errors and debugging the program will allow the student to think about the logical flow of the program and see where the problem occurred. (The computer will not pick up logical errors!) Students have an unlimited number of opportunities to correct the algorithm and execute the program over and over again until the error is discovered at which point a new concept is learned. Chances are that the same mistake will not be made at a following example where the same or a similar technique could be employed.

Some programs run and produce the desired results but, as mathematician sometimes say, it is not an 'elegant' solution. Students can then be encouraged to use algorithms that will be best fitted in a particular set of circumstances.

Several programs (in C++) will be presented to demonstrate the most common logical errors students are likely to make and the various approaches to lead students to correct it. The best students may be asked to find the algorithm that leads to the least number of operations performed by the computer.


Keyword(s): pedagogy, programming