Striving for Mathematical Thinking - ACM Digital Library

1 downloads 0 Views 1MB Size Report
baldwin @brastias.cs.geneseo.edu. Lew Hitchner. California Polytechnic State University, USA hitchner @ falcon.csc.calpoly.edu. Venu Dasigi. Southern Poly ...
Striving for Mathematical Thinking Peter B. Henderson (Chair') Butler University, USA phenders @ butler.edu

John Hamer University of Auckland, NZ

j-hamer@ cs.auckland.ac.nz

D o u g Baldwin SUNY Geneseo, USA baldwin @brastias.cs.geneseo.edu

Lew Hitchner California Polytechnic State University, USA

V e n u Dasigi Southern Poly State University, USA

Will Lloyd University of West Georgia, USA

vdasigi @ spsu.edu

Wlloyd @ westga, edu

hitchner @ falcon.csc.calpoly.edu

Bill Marion Jr. Valpariso University, USA

Marcel Dupras Universite Laval, Canada

Bill.Marion @ valpo.edu

marceLdupras @ ifl.ulaval.ca

Charles Riedesel University of Nebraska-Lincoln, USA

Sister Jane Fritz St. Josephs College, USA jfritz @ sjcny.edu

riedesel @ cse.unLedu

David Ginat Tel Aviv University, Israel

Henry Walker Grinnell College, USA

ginat @ post.tau.ac.il

Walker @ cs.grinnell.edu D o n Goelman Villanova University, USA

goelman @monet, vill. edu science and software engineering education. There are arguments and surveys that recommend less mathematically rigorous curricula [32, 38, 20, 24], and papers/presentation that suggest there are trends toward less rigor, for example [31, 53, 54].

Abstract Computer science and software engineering are young, maturing disciplines. As with other mathematically based disciplines, such as the natural sciences, economics, and engineering, it takes time for the mathematical roots to grow and flourish. For computer science and software engineering, others have planted these seeds over many years, and it is our duty to nurture them. This working group is dedicated to promoting mathematics as an important tool for problem-solving and conceptual understanding in computing.

This leads to a contradiction since other surveys indicate that mathematics and mathematical thinking are central to computer science education [27, 32]. Also, there is evidence from within the computer science education community that mathematics is important. For example, Curriculum 2001 [50, 51, 57] is the first to explicitly include discrete mathematics in the core, and its discrete mathematics focus subcommittee is recommending 2 semesters of discrete mathematics. Over the past 20 years, discrete mathematics has migrated from a graduate or third/forth year course to a first or second year course. Because of the importance of providing students with any early introduction to mathematical skills and thinking, several universities require discrete mathematics during

Motivation for this Working Group There is significant interest stirring regarding the important relationships between mathematical reasoning and problem-solving in computer science [1]. Recent papers, articles, and studies have raised serious concerns regarding the role mathematics should play in computer 114

the first semester (DePaul, Pepperdine, Daniel Webster, Butler to name a few), and at the State University of New York at Stony Brook "Foundations of Computer Science 1," a problem-solving based discrete mathematics course, is required before Computer Science I. Also, see the Mathematics Association of America CUPM recommendations from its computer science workshop held October 1999 [30] and the article "Do Software Engineers Need Mathematics?" [ 11].

universally agreed upon set of mathematics topics for CS/SE graduates. Our working group views this as an opportunity for improvement since we believe that mathematics based reasoning/concepts play a crucial role in computer science based problem solving, and heightened awareness of this synergistic relationship by our graduates will lead to the development of better software systems, Engineering is one problem-solving based discipline that attempts to achieve such a synergistic relationship. In undergraduate engineering programs mathematics is explicitly pervasive whereas in CS/SE education mathematics tends to be implicit. Engineering students learn mathematical foundations early and then apply them to understanding engineering principles. For example, the first electronic circuits course that electrical engineers usually take the second year uses calculus to understand the fundamental properties (e.g., behaviour of resistor/capacitor circuits) of circuits. The analogy with understanding the behaviour of algorithms/computer programs should not go unnoticed. Mathematics in engineering education has taken a long time to mature; but, there is still room for improvement [21, 28, 44, 45, 55]. However, computer science and software engineering education lag significantly behind.

Introduction "Striving for Mathematical Thinking" brings to mind different views in the computer science/software engineering education community. Someone with a very strict interpretation may think of the formal application of mathematics, whereas another might conclude the general use of mathematical modes of thought. The mathematics a computer science/software engineering (CS/SE) student takes may include discrete mathematics, calculus, linear algebra, probability, numerical methods, automata, etc. For a CSISE student much of this mathematics may seem irrelevant since it is often taught independently from the CS/SE courses, is not connected back to the CS topics, and is not integrated into the CS/SE courses in our curricula. Several studies, papers and articles bash mathematics for these reasons, leaving students, faculty, employers and the public with the impression that mathematics is irrelevant for software professionals [37, 38, 20, 24].

Another important difference is that engineering tends to be an "apprenticeship" discipline and CS/SE is not. That is, engineers learn process on the job and CS/SE have a heavier emphasis on process in their curricula, the latter often detracting from learning the conceptual foundations.

The objectives this working group identified were: to discuss the role of mathematics and mathematical thinking in CS/SE education, to develop an agreed upon working definition of the term "mathematical thinking," to better understand how mathematical thinking can be used as a tool to improve software quality, to identify evidence for or against the importance of mathematics, and to organise a group of CS/SE educators dedicated to promoting the role of mathematics in CS/SE education. The latter includes: developing and evaluating resources and materials, devising and performing studies to ascertain the effectiveness of mathematical based approaches, and raising the consciousness among educators of the benefits of mathematical thinking. This report is primarily a presentation of the collective conscientious of the members of the working group. The concrete work is still ahead of us.

The Software Crisis Web search engines yield about 5,000 hits for "software crisis," but only about 30 hits for "hardware crisis." This may or may not be relevant, however, the software crisis is well known. Why? Software professionals usually employ more seat of the pants approaches than traditional professional engineers. This leads to "messy" software due to attempts to short circuit the transition from the problem to the solution. We call this the "amateur cycle", which is mainly due to the general immaturity, including we believe mathematical immaturity, of the discipline. As Brooks points out in his seminal article "No Silver Bullet" [5] no single approach wiU solve the software crisis. Each approach can at best incrementally help. For example, improving design should improve software quality, as should paying attention to the development process. There is evidence that each approach, including the use of more rigor and precision, will improve the quality of software.

In the past, computer science and software engineering educators such as Knuth, Hoare, Ralston, Dikstra, and Gries, have pointed out the important role of mathematics [49, 22, 33], and the CS/SE community is beginning to listen. Curriculum 2001 is the first to include discrete mathematics in the core [57]. However, mathematics has not been fully embraced by educators and there is no

Supporting Evidence Everyone seems to hold passionate beliefs about the importance of mathematical thinking in computer science 115

investment (ROI) from use of the semi-formal clean room methodology of over 32:1; only forrnal inspections, with an ROI of almost 72:1, yielded better results, while systematic software reuse yielded returns of 3.5:1 to 5:1. Although each study alone is limited, there is great consistency in their conclusions that formal methods contribute to improved software quality.

and software engineering; but there is no consensus on these beliefs. Most people's beliefs are supported by anecdotal evidence, and different anecdotes support diametrically different beliefs. There is clearly a need for more systematic evidence for/against ones belief that mathematics is an important tool for the computing professional. While some such evidence is beginning to emerge, more is badly needed. This working group surveyed the existing evidence on both sides of the issue, and has identified additional studies that are required.

Multiple studies conducted during the early 1980's found that mathematical ability is well correlated with students' success in introductory computer science courses [34, 6]. Modern studies still find this correlation in today's students [56]. While none of these studies attempts to show that mathematical aptitude causes students to succeed in computer science, repeatedly finding a high correlation in multiple generations of students strongly suggests that mathematical ability and computing ability are related. More generally, statistics gathered by the U. S. Department of Education (U.S. Dept of Education, "Mathematics Equals Opportunity", Oct. 1997 [42]) indicate that how early and rigorously students study mathematics in middle and high schools correlates with their subsequent educational achievement. This effect is particularly pronounced among low-income students.

Evidence Against the Importance of Mathematical Thinking Lethbridge [37] surveyed a number of practicing software developers concerning the knowledge they found important in their jobs. He found that mathematical knowledge generally ranked low in these assessments, and that his respondents generally felt that their university educations devoted more time to mathematics than warranted. Evidence for the Importance of Mathematical Thinking Sobel [52] followed two cohorts of students through a fouryear computer science curriculum: one learning conventional software development methods, and one learning formal methods from the beginning of their studies. She reports that by the time the students undertook third and forth year projects, those trained in formal methods produced software with fewer defects, better structure, and better abstraction of problems than did the students trained in conventional development practices.

Henderson surveyed alumni of his department concerning their views of its mathematically oriented foundations course [27]. He found that many years after taking the course, respondents generally felt that it had prepared them well for subsequent computer science and mathematics courses, and had improved their problemsolving and logical thinking skills. Women respondents were more positive than men.

Several studies of formal methods in industry have reached similar conclusions. Larson et al. compared two versions of the same system, one developed using formal specification techniques and one developed using informal specifications, and found that the formally specified system had fewer defects, ran faster, and was better structured than the informally specified one [35]. Pfleeger and Hatton conducted a retrospective study of a system in which parts had been developed using various formal methods, and parts developed without formal methods; although they were unable to completely distinguish the effects of formal methods from other factors, Pfleeger and Hatton cautiously conclude that use of formal specifications combined with thorough testing was probably responsible for the high reliability of the final system [47]. Clarke et at. [7] and Ciapessoni et al. [9] summarize a number of projects that applied formal methods; many of these projects found that the formal methods detected defects in the product that had eluded conventional testing, or believe that their formal approach yielded a higher-quality product than would have resulted from informal methods, McGibbon reviewed the literature on empirical results of several software process improvement methodologies to perform a comparative cost-benefit analysis [43]. He demonstrated a return on

Mathematically Oriented Curricula To encourage more students to enter the computing field arguments have been made for a less mathematically oriented computer science curricula [20, 24]. While less rigor may be viable for some of the information technology workforce, we believe it is short sighted for software professionals. Such arguments are often based upon traditional engineering mathematics such as calculus, differential equations, and linear algebra, rather than the mathematics required for computer-based problem-solving. Before discussing this mathematics and the concept of mathematical thinking, let's consider some attributes of our graduates that might be enhanced in curricula emphasizing more mathematical modes of thought. The working group identified the following. We invite readers to add their own to this list, and to share them with us. • Broader thinking • Ability to think outside of the box • Better clarity and precision of thought • Comfort with symbols, mathematical notations and abstraction • More precise problem analysis/modelling 116

• • • • •

Apply formal techniques to modelling, specification, design, etc Informal and formal arguments of correctness Feasibility analysis of software systems/algorithm analysis Reasoning from unknown to the known Communication skills using formal notations

6.

Understanding software (e.g., "mental reverse engineering") Examples of each of these may be helpful for the reader. Symbols - 'time' is a variable in an imperative program, 'NumberOfWidgets' is a parameter in a function definition, 'money' represents a value in a Prolog program, 'GNP' has a meaning when modeling the economy of a country, etc. These are symbols we create to help us solve problems. Traditional mathematics often uses even more abstract symbols (e.g., let 'x' represent the amount of Susie's purchase) - perhaps one reason for math-phobia? A student understanding the meaning of the variable 'time' in a C++ program is almost identical to them understanding the meaning of 'time' in a mathematical equation. Indeed, cognitively the "declarative" equation should be easier to understand than the "imperative" program.

What is Mathematical Thinking? Here is a very general definition of mathematical thinking: "Applying mathematical techniques, concepts and processes, either explicitly or implicitly, in the solution of problems." That is, mathematical modes of thought which help us to solve problems in any domain. In its most general interpretation, every problem-solving activity requires "mathematical thinking." For instance, basic logic, be it used explicitly or implicitly is required for all problemsolving activities. Skeptics would argue this is "cheating" since our definition is so all-encompassing. However, that is precisely the point - mathematical thinking is pervasive. Once this thesis is accepted, we can enhance students problem-solving abilities, in any discipline, by ensuring our students learn, and can use, the fundamental mathematics. For nurses, this might be basic algebra, statistics, and facility with units of measure. For engineers, calculus, differential equations, vectors, etc. For computer scientists and software engineers . . . . . . Of course, this is easier said than done. For students, there is math phobia, a disconnect between the mathematics and its applications, and mathematics getting in the way of learning (inward view of math, mathematics for its own sake, too abstract, fuzziness, etc.). For curriculum developers, it is identifying the fundamental mathematics and fitting it (often "shoe horning" it) into the curriculum. And for instructors, it is conveying the mathematical concepts, integrating them into the course material, and motivating their use. These issues have been addressed in a recent NSF proposal "Long Island consortium for interconnected learning" [40] and are currently the focus of the MAA CUPM efforts [41 ]. There is also evidence that mathematics, and mathematical modes of thought, are important for general success in college [34].

Logical, precise reasoning - As noted earlier, any problem-solving activity can be viewed as an application of logic. Hence, "Computer science is applied logic." [22]. Mathematical logic is a tool for reasoning precisely [23]. Question: Does one need to reason precisely when developing, or understanding, an algorithm? No, if one does not care if the resulting algorithm is correct, or their understanding is wrong. Humans are fallible, precise thinking provides an important counterbalance. Here are some ways precise, logical thinking helps in CS/SE education: • Consider the following algorithm fragment which might be found in a program for computing task times (all variables are integer). { timel > 0 and time2 > 0 }

Precondition

total_time (-- timel + time2 if total_time = 1 then [ error processing statements ] See the problem? Such algorithms(code) do(does) exist because developers/maintainers do not utilize precise, logical reasoning. Indeed, given this precondition and the single assignment ' t o t a l t i m e (-timel + time2' approximately 50%(20%) of novice (experienced) programmers quickly jump to the conclusion that the post condition is { total_time > 0 } [28], which is true but not precise. This demonstrates that most students and many professionals don't 'understand' even simple assignments and addition as well as you'd expect without some basic logic. Try it yourself with your students and colleagues. Students usually understand the concept of an algorithm informally. Mathematics provides a different perspective, and can help students to grasp a more formal view. Consider an algorithm as a logical implication: precondition --) post condition. Since an implication is false only for the case when the

Mathematical Thinking in CS/SE What is mathematical thinking in the context of computer science and software engineering? Below is a short list of some that come to mind. Readers are encouraged to add their own. 1. Symbols and mathematical notation are common features of both mathematics and software. 2. Logical, precise reasoning 3. Identifying, specifying and applying "patterns" 4, Problem analysis and modelling 5. Abstraction and generalization

117

techniques subconsciously, leading to better software. Like many things that require time and effort to learn, the long term benefits outweigh the initial efforts.

precondition is True and the post condition is False, the implication is true for the 3 cases shown: { precondition } True False algorithm { post condition } True True

False

Identifying, specifying a n d a p p l y i n g " p a t t e r n s " One brief definition o f mathematics is "the study o f patterns." [12]. W h e n trying to understand or solve a problem we look for familiar patterns of thought. For computer-based problems, these patterns may manifest themselves as familiar objects such as stacks, queues, or sets, or inductive patterns associated with an iterative process. Each pattern has a mathematical foundation that can be used to precisely specify the pattern, or applied to use the pattern in a solution. For example, a 'set' is a precise mathematical concept whose implementation as an object is often used in the development of software systems. Patterns, a buzzword in the software community, play a significant role in the development of software systems [16]. Much of this work is not mathematically rigorous, thus providing a fruitful area for research. For instance, precise specification of the mathematical properties o f patterns is very important for the development o f high quality software. P r o b l e m analysis a n d m o d e l i n g - Mathematical thinking can often reveal intuitive insights into practical problems that are not immediately evident from the problem domain. A simple, but classic, example is the analysis o f deadlock in computer systems, in which the use o f directed graphs to model the resource allocation in the system yields a simple, elegant way to picture deadlock as the existence of a directed cycle. Along the same lines, Petri net models o f network protocols provide mental models that are much more concise and easy to understand than the corresponding program code. A b s t r a c t i o n a n d g e n e r a l i z a t i o n - Traditional engineering disciplines usually deal with tangible artifacts such as gears, resistors, beams, fluids, etc. However, software exists only in the mind o f the developer/maintainer, hence is inherently abstract. Mathematics deals with abstractions. Hence, facility with mathematics should closely correlate with software development, and visa versa. Using mathematics not only as a tool for problem-solving but also as a vehicle for teaching students to feel comfortable with abstraction and abstract concepts is very important. For example, in mathematics a function is an abstract concept. Once understood by a student, they should have little trouble using/developing functions in some programming language - especially a functional language. W e are not totally convinced the converse is true. Generalization concerns moving from the specific to the abstract. Addition of two natural numbers is a generalization of 2+2, 0+4, 6+5, etc. Software usually solves general problems. The process o f looking for patterns in problems, and precisely specifying them, is generalization. Examples include recognizing that the implementation o f a simulation requires a priority queue,

False

Indeed, programmers always assume the first (True, True); however, even in simple code imprecise thinking leads to imprecise or invalid pre or post conditions. The implication is still valid, but garbage in (data for which the precondition is false) may or may not yield an incorrect result. The adage garbagein, garbage-out is usually true, but not precise Assertions in an algorithm/program are logical predicates. Given a list o f items A[i], i=1,2,3 ..... n (n > 0) consider an algorithm for searching this list for a specified item (item). Sequential search. i(--1 found