How Mathematical Thinking Enhances Computer Science Problem Solving Doug Baldwin, moderator SUNY Geneseo
[email protected] David Gries, panelist University of Georgia, Athens
[email protected]
Peter Henderson, panelist Butler University
[email protected]
Bill Marion, panelist Valparaiso University
[email protected]
Diane Schwartz, panelist Cal. State Univ., Northridge
[email protected]
Summary There are deep connections between algorithmic and mathematical thinking. Both construct “systems” — computing systems in the algorithmic case, intellectual ones in mathematics — from simple primitives. As Knuth notes in the preface to The Art of Computer Programming, “The construction of a computer program from a set of basic instructions is very similar to the construction of a mathematical proof from a set of axioms” [1]. Other connections include similar ways of organizing primitives into larger structures (e.g., recursion in algorithms, recursion and induction in math; conditionals in algorithms, definition in cases and proof by cases in math), similar ways of using abstraction to manage complexity, and an underlying reliance on logic. In short, mathematics is not merely a tool for limited areas of computer science, it is a mindset that fundamentally improves one’s ability to devise and implement algorithms. Computer science students therefore need to exercise their mathematical as well as their computational abilities, and computer science educators need to help students use both ways of thinking to solve computing problems. This panel illustrates specific ways in which mathematical reasoning enhances algorithmic problem solving, and provides educators with concrete examples and resources to use in their own teaching. Each panelist will present an exercise, classroom example, or similar item, from their own experience, and will demonstrate ways in which mathematical reasoning helps one solve and/or understand it. The audience will be invited to contribute
their own examples and to comment further on the role of mathematical thinking in computer science problem solving. The panelists’ and audience members’ examples will be collected on a Web page for continuing reference. A prototype of this page is at http://www.cs.geneseo.edu/ ~baldwin/math-thinking/examples.html. Doug Baldwin In the early 1990’s I helped design an introductory computer science sequence that teaches discrete math topics alongside programming ones. This sequence is still in use, and I have taught parts of it numerous times, seeing and creating many examples of how mathematical thinking helps students understand problems, conceptualize algorithms, debug them and devise test plans, et cetera. I will present some of these examples. David Gries I will give examples to show that parts of algorithms can be calculated, rather than guessed or thought up in some patch-work, error-ridden manner. This idea of calculation is not new to programming but is a time-honored, useful, mathematical tool. Peter B. Henderson “Computer science is applied logic.” I don’t recall to whom to attribute this quote, but it rings true. Logical and mathematical thinking are fundamental to computer science.
These links can be forged early in the curriculum through examples and problem sets which illustrate the importance of thinking mathematically and logically. This may bring to mind the term 'formal methods' -- But no! We are interested in conveying the natural synergism between mathematics, logic and computer based problem solving, where the former are powerful tools for the latter. Several examples and problems will be presented to illustrate the pedagogy of this approach in Computer Science I. The audience will play an active role in seeking logical and mathematically sound algorithmic solutions to these problems. Bill Marion Computer science students usually learn about Divide and Conquer early in their four-year program. Discussion of Divide and Conquer goes hand-in-hand with initial discussions of recursive algorithms. In analyzing the computational complexity of these algorithms, students sometimes are faced with the task of trying to solve seemingly-complicated recurrence equations. Powerful mathematical tools, such as the Master Theorem, can help, but many students won't see these tools until an upper-level analysis-of-algorithms course. However, one technique, building a recursion tree — which appears in Algorithm texts such as Baase and Van Gelder and Cormen, Leiserson, and Rivest — can be introduced early, along with Divide and Conquer. I will provide a number of examples of how the recursion tree technique can be used and will discuss some of the underlying mathematics. Diane Schwartz At the lower end of the computer science curriculum, our programming and data structures courses make limited use of mathematics; at the upper end our courses in algorithms and theory of computing make extensive use of mathematical techniques. In between our students take at least three or four mathematics courses. However, upperdivision students still have difficulty creating algorithms to solve non-trivial problems and giving informal proofs of algorithm correctness. A student may find that their program does not do what is expected and then find they need to give serious thought as to why it is not doing what is expected. They should be
proving to themselves that their program is correct. We need to teach students how to do this. Such proofs should be able to reveal all of the cases that need to be considered; all of the properties that the program objects must have; and should improve a student's ability to find the logical errors in their programs. I plan to report on an experiment applying these ideas to a sophomore level course in advanced data structures with C++. References [1]. Donald Knuth. Fundamental Algorithms (The Art of Computer Programming, Vol. 1), 2nd ed. AddisonWesley, 1973. pg. ix.