Do All Roads Lead to Rome? (or Reductions for Dummy ... - CiteSeerX

6 downloads 3601 Views 217KB Size Report
Jun 15, 2010 - cis]; Computer Science Education is available online at: ... ISSN: 0899-3408 print/ISSN 1744-5175 online. cO 200x Taylor & Francis.
June 15, 2010

11:57

Computer Science Education

RoadsToRome-preprint

Computer Science Education Vol. 00, No. 00, Month 200x, 1–11

Do All Roads Lead to Rome? (or Reductions for Dummy Travelers)† Pekka Kilpel¨ainen‡ University of Eastern Finland, School of Computing, Kuopio (Received 00 Month 200x; final version received 00 Month 200x) Reduction is a central ingredient of computational thinking, and an important tool in algorithm design, in computability theory, and in complexity theory. Reduction has been recognized to be a difficult topic for students to learn. Previous studies on teaching reduction have concentrated on its use in special courses on the theory of computing. As a fundamental concept, reduction should be discussed multiple times during a curriculum, starting from first-year studies. In order to support this, we propose intuitive analogies based on the metaphor of traveling that could be used as an aid for illuminating key ideas of reductions on introductory computer science courses. Keywords: reduction; education; metaphor; analogy

Everything should be made as simple as possible, but not simpler.

1

– Albert Einstein (1879–1955)

Introduction

This article suggests some analogies that could be used for introducing the notion of reduction to undergraduate or non-major students on introductory computer science courses. Computational thinking refers to considerations and modes of thought that are typical for computer science, and also transcend the boundaries of the discipline, being applicable in other fields of human endeavor as well. Its importance has also been recognized in the recent revision of the ACM/IEEE Computer Science Curricula recommendations (CS2008 Review Taskforce, 2008). Jeannette Wing has presented various characterizations of computational thinking in her article (2006), including ”Computational thinking is reformulating a seemingly difficult problem into one we know how to solve, perhaps by reduction, embedding, transformation, or simulation.” Formally, a reduction, or a transformation, is a mapping between instances of computational problems, say A and B, which preserves their solutions. Computational problems are defined by their inputs x ¯ called instances and by their requested results or outputs, denoted by A(¯ x) and B(¯ x). Let MA and MB denote algorithms for solving the problems A and B, respectively. That is, for each instance x ¯ of problem A, the requested output A(¯ x) is obtained as the result of applying algorithm MA , denoted by MA (¯ x) = A(¯ x), and similarly for problem B. It is a well-known basic result of computability that some well-defined computational problems, like the halting problem, are unsolvable, that is, there is no algorithm that would produce the correct result for each instance of the problem in a finite number of steps. A reduction of problem A to problem B is a computable mapping f from instances of A to instances of B such that B(f (¯ x)) = A(¯ x)

(1)

† This is a preprint of an article submitted for consideration in Computer Science Education c 2010 [copyright Taylor & Francis]; Computer Science Education is available online at: http://www.informaworld.com/smpp/title∼ content=t713734307 ‡ Author’s

email: [email protected]

ISSN: 0899-3408 print/ISSN 1744-5175 online c 200x Taylor & Francis

DOI: 10.1080/0899340YYxxxxxxxx http://www.informaworld.com

June 15, 2010

11:57

Computer Science Education

2

RoadsToRome-preprint Pekka Kilpel¨ ainen

f x¯

f (¯ x)

MA

MB

= A(¯ x)

B(f (¯ x))

Figure 1. Solving problem A by reducing it to another problem B.

for each instance x ¯ of problem A. That is, if MA and MB are algorithms for solving problems A and B, respectively, the result of applying algorithm MB to the transformed instance f (¯ x) is the same as that of applying algorithm MA to the original instance x ¯. Reductions are used in computer science basically for three purposes. First, they give an approach for designing algorithms, which is typically discussed on advanced algorithms courses. We can call this approach constructive use of reduction. Assume that we need to solve a problem A, that is, devise an algorithm MA that gives the correct result for each instance x ¯ of problem A, but we have available an algorithm MB for another, but somehow related, problem B. If we can recognize and utilize this relatedness by devising a reduction f from A to B, we get an algorithm for solving A by connecting the transformation and the algorithm for B together as follows: algorithm MA (¯ x) := return MB (f (¯ x));

(2)

The principle of applying a reduction for solving a problem this way is depicted in Figure 1. One of the most celebrated results of this approach is the use of the fast Fourier transform (FFT) for reducing the computation of convolutions, or multiplication of polynomials, into linear-time inner-product computation. A good discussion of the fast Fourier transform is provided, e.g., by Dasgupta et al. (2008, Sec. 2.6). Since the results of convolutions and inner products are not the same, FFT is used also as an inverse transformation to map the inner product back to convolution coefficients. For the sake of simplicity, we ignore the issue of inverse transformations in this article. This attitude is shared by much of complexity theory, where the focus is often in decision problems whose outputs are Boolean, and thus do not require inverse transformations. Devising useful reductions is often challenging, but the direction of the reduction from the new problem to a known one is nevertheless quite natural (Armoni & Ginat, 2008, Sec. 2.7): We reduce a new thing (problem A) to the known thing (problem B with solution MB ), and thereby get information of the new thing (an algorithm for A, which yields it solvable). On an abstract level it might seem strange that information flows in a direction opposite to that of the reduction, but this appears to cause no mental difficulty. The second main use of reductions is in computability theory, where they are used for showing problems unsolvable. This happens by a reduction from a problem already known to be unsolvable, like the halting problem. In the halting problem we are given a procedure P (in a programming language L) and its input x ¯, and we want to know whether the execution of P (¯ x) will eventually terminate. Most questions about semantic properties of computer programs can be shown unsolvable by a reduction from the halting problem. As a striking example of this, I’ve shown on my lectures that the innocent-looking problem of whether a given program outputs ”Hello, world!” is unsolvable. For this, let a procedure P and its input x ¯ form an arbitrary

June 15, 2010

11:57

Computer Science Education

RoadsToRome-preprint Do All Roads Lead to Rome?

3

instance of the halting problem. We can construct a transformation f (P, x ¯) which creates a program that consists of the definition of procedure P in a slightly modified form P ′ , together with the call P ′ (¯ x) followed by an instruction that outputs ”Hello, world!”. The modified pro′ cedure P is otherwise identical to procedure P except that any output instructions have been eliminated. Such a transformation can clearly be implemented as a simple source-level compiler for the language L. So, the transformation f (P, x ¯) is computable. It is also a reduction from the halting problem to the ”Hello, world!” problem, since P (¯ x) terminates if and only if P ′ (¯ x) terminates, and this holds if and only if f (P, x ¯) outputs ”Hello, world!”. So, the existence of an algorithm MB for the ”Hello, world!” problem would give us an algorithm MB (f (P, x ¯)) for solving the halting problem. This contradicts the unsolvability of the halting problem and thus implies that no algorithm for the ”Hello, world!” problem can exist either. Thirdly, in complexity theory, problems are shown to be computationally hard by constructing an efficient—most often polynomial-time—reduction from a problem which is known to be hard. The argumentation that a new problem is hard, by a reduction from a known one, is similar to the case of proving unsolvability. Assume that we know that any algorithm for solving a problem A requires in the worst case, say, exponential time, and that we can reduce A by a polynomial time transformation f to a problem B. Then the existence of a polynomial-time algorithm MB for solving problem B is impossible, since the combination MB (f (¯ x)) would be a polynomialtime algorithm for solving any instance x ¯ of A. (These arguments rely on the property that many combinations of polynomial-time computations, like evaluating f (¯ x) and applying MB to its result, remain within polynomial time.) Few practical problems are known to require exponential time for sure, but the class of NP-hard problems is wide and relevant. Therefore polynomial-time reductions are most often used to show the NP-hardness of new problems. Assume that a problem A is known to be NP-hard, that is, any problem in the class N P—of decision problems that can be solved in polynomial time with the help of nondeterminism—can be reduced in polynomial time to it. Since polynomial-time reductions are easily seen to be closed with respect to composition, devising a polynomial-time reduction from A to a new problem B shows that also problem B is NP-hard. We can call the use of reductions for showing problems difficult (unsolvable or hard) the analytic use of reductions. Dasgupta et al. (2008, Sec. 8.2) state that analytically used reductions ”serve a somewhat perverse goal: we know A is hard, and we use the reduction to prove that B is hard as well”. This direction of analytic reductions feels unnatural and is therefore difficult to grasp. According to Armoni & Ginat (2008, Sec. 2.7), their ”experience indicates that students find it unintuitive, difficult, and confusing”. Armoni and Ginat relate this difficulty to the challenge of learning reverse thinking in computer science in general. On an abstract level it could seem reasonable that information of the problems (”A is difficult”) flows in the direction of the reduction (”then B is difficult, too”), but this directionality appears difficult to accept intuitively. Skiena (1998, Sec. 6.4) writes that ”this direction of reduction seems bass-ackwards. Check to make sure you understand the direction of reduction now, and think back to this whenever you get confused”. In my class experience, trying to pass these warnings to students is of little help; anyhow, a large proportion of students get confused with the direction of the reduction. Special cases of reduction manifest themselves also in familiar software and algorithm design principles. Indeed, the general idea of top-down design is nothing more than reducing a task—or a solution of a problem—into sub-tasks—or to solutions of its subproblems, until the subproblems are simple enough to be solved directly. Also, the celebrated divide-and-conquer principle for designing recursive solutions is actually about reducing a solution of a problem instance to solutions of smaller instances of the same problem. Reduction has been recognized as one of the fundamental ideas of computer science (Schwill, 1994; Armoni, 2009). As such, Armoni (2009) suggests that it should be employed as one of the building blocks of a curriculum that is organized along the spiral principle, as advocated by Jeromy Bruner (1960, page 13, quoted by Schwill (1994)):

June 15, 2010

11:57

Computer Science Education

4

RoadsToRome-preprint Pekka Kilpel¨ ainen

The early teaching of science, mathematics, social studies, and literature should be designed to teach these subjects with scrupulous intellectual honesty, but with an emphasis upon the intuitive grasp of ideas and upon the use of these basic ideas. A curriculum as it develops should revisit these basic ideas repeatedly, building upon them until the student has grasped the full formal apparatus that goes with them.

Introducing topics, like reduction, early in the curriculum would benefit of simple analogies. Analogies which are used on introductory courses should assume little of their base or source (see Aubusson et al. (2006)), that is, of the familiar concept to which the new one is being related with. Therefore simplified analogies based on student’s life experiences (Hativa, 2001, Chap. 10) would be favorable. Schwill (1994) reviews and discusses general criteria of fundamental ideas. These criteria include embodiment in everyday life, language and thinking (criterion of sense), relevance to different areas of the domain (horizontal criterion), demonstrability on every intellectual level (vertical criterion), and recognized role in the historical development of the domain (criterion of time). In his conclusion, Schwill calls for elaboration of suitable examples to highlight specific central ideas of computer science. If reduction is indeed a fundamental concept which satisfies the criterion of sense, it should be easy to find examples of its appearance in everyday life. Such examples would support explaining the notion of reduction to novice students and thereby strengthen the status of reduction as a fundamental idea with respect of the vertical criterion, too. The search for such examples is the main quest in this article.

2

Making Travel Plans

Stories, metaphors, and analogies have received some attention in pedagogical literature. (See,e.g., Abrahamson, 1998; McDrury & Alterio, 2002; Aubusson et al., 2006). Stories and analogies are intuitively useful for learning: Their often personal flavor and occasional humor may help the students to receive the message of the lecture, and hopefully support its recollection. Let me therefore begin with a personal story of how the idea of analogies for reduction came to my mind. I had been thinking of ways to explain the concept of reduction in simple terms which would rely on familiar every-day experience. I had a feeling that people often apply reduction for solving their problems, but I couldn’t think of examples that would have been suitable for a lecture. All that came to my mind was an old joke about a mathematician’s attitude toward reduction, quoted below as the version by Levitin (2007): Professor X, a noted mathematician, noticed that when his wife wanted to boil water for their tea, she took their kettle from a kitchen cabinet, filled it with water, and put it on the stove. Once, when his wife was away (if you have to know, she was signing her best-seller in a local bookstore), the professor had to boil water by himself. He saw that the kettle was sitting on the kitchen counter. What did Professor X do? He put the kettle in the cupboard first and then proceeded to follow his wife’s routine.

Even though the joke is a somewhat accurate example of a (pointless) reduction, I did not want to share it to my students. It would hardly work as a motivating example of reasonable transfer of a skill to a new situation. Since the lack of perceiving reduction as a rewarding problem-solving heuristic has been recognized as one of students’ mental blocks towards reduction (Armoni et al., 2006), I wanted to find examples that present the usefulness of reductions in more positive light. One day I had left my office early, because I was taking our daughter from her daycare to her therapist. I had taken her there earlier, too, but from a different direction of a nearby mall. So, the direct route from the daycare to the therapist was not familiar to me. I was driving absent-minded, thinking about my current algorithms course. This caused me to miss the corner of a street that would have lead directly to the therapist’s office. Instead of trying a sudden turn, I decided to keep driving towards the mall, and continue from there to her office. I soon realized

June 15, 2010

11:57

Computer Science Education

RoadsToRome-preprint Do All Roads Lead to Rome?

5

Florence Adriatic Sea

Perugia

Corsica

Rome Tyrrhenian Sea

ITALY

Sardinia

Figure 2. If we can reach Rome from Perugia and if we find a way from Florence to Perugia, then we can reach Rome from Florence, too.

that I had solved the problem of getting to the therapist using reduction: I had reduced the new problem of getting to her office from the daycare, to the old one of getting there from the familiar direction of the mall. After this observation I started to think whether this could be used for clarifying problematic features of reduction in class. What would be a suitable metaphorical context to place analogies in? 3

Mi scusi, How do I get to Rome?

If we use the task of getting from a place A′ to some final target as the analogy for solving a problem A, traveling provides an obvious metaphorical context. Since I remembered that Italy contains well-known tourist attractions, and the old saying ”All roads lead to Rome”, I continued developing the analogies by using the task of getting from a given city to Rome as the analogy for solving a computational problem. (We discuss and eliminate some limitations of this simplistic analogy in Section 4.) Examples involving short names are handy for classroom use. For example, Ann, Bob, and Chris are great as generic names for participants of encrypted communications, and Rome is a similarly short name.1 Constructive use of reductions is easy to explain and to understand under this setting. For example, if we know that there’s a connection from Perugia to Rome, then showing that we can go from Florence to Perugia is enough to know that we can reach Rome from Florence, too. (See Figure 2.) Analytic use of reductions is more challenging to explain. All cities and towns are connected by some traffic connections—by land, sea, or air. For the sake of the example let us restrict to connections by land only; this allows to use islands which are isolated from the mainland as an analogy of unsolvable problems. For example, the city of Sassari lies on the island of Sardinia, and therefore has no connection by land to Rome. If we can find a connection from Sassari to Cagliari—which indeed exists—we can conclude that there’s no connection (by land) from Cagliari to Rome, either. (See Figure 3.) To see this observe that a connection from Cagliari to Rome would contradict, as a part of the Sassari–Cagliari–Rome route, the known unreachability of Rome from Sassari. We could also illuminate central complexity classes and the role of reductions for arguing about them under this metaphor. In order to concretize the complexity of algorithmic problem solving, 1 As

an extreme example, the village of Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch in Wales would clearly not be convenient as a classroom example.

June 15, 2010

11:57

Computer Science Education

6

RoadsToRome-preprint Pekka Kilpel¨ ainen

Corsica

Rome Tyrrhenian Sea

Sassari

Sardinia

Cagliari

Figure 3. If we can reach Cagliari but not Rome from Sassari, then we can’t reach Rome from Cagliari either.

we could use hiking as a metaphor. Under this metaphor, easy problems are modeled by locations from which we can reach Rome by foot. On the other hand, intractable or exponential-time problems are modeled by locations that— despite of basically being connected with Rome—are too far from Rome for a reasonable hike. Then we could classify cities and towns on mainland Italy into classes like P, EXP, and NPcomplete by their distance from Rome. The locations in class P would be those that are suitable for Pedestrians, in the sense that a relatively short trail leads from there to Rome. The class EXP would consist of those towns and cities that are recommended for Experienced travelers only, since it would take, for sure, days or weeks to hike from those places to Rome. The class of NP-complete problems could be said to take its initials from Not for Pedestrians (according to current knowledge), since those locations are equally challenging as several others from which the most talented explorers haven’t found any short ways to Rome yet. In this metaphor, a reasonably short hike would be the analogy of a polynomial-time reduction.1 So, if we know that some location B is close to Rome and thus belongs to the class P and we can hike from location A to B, we can conclude that A is relatively close to Rome and thus in the class P, too. Or inversely, if a location A is in the class EXP or N P and there is a short hike from that location to another location B, we can conclude that location B belongs to the class EXP or N P, respectively, too. But wait, how can we justify the direction of an analytic reduction, from the known difficult problem to the new one? If we know that there is no connection from a location A to Rome, or that A is far from Rome, wouldn’t a connection or a hike from B to A also show that they are connected or close to each other, and allow us to transfer the information of unsolvability or hardness of A to B? We need to extend our analogy a little in order to capture also the 1 It

needs to be noted that this analogy breaks down slightly: The combination of a finite number of polynomial-time reductions is still a polynomial-time reduction, but connecting sufficiently many hikes in a sequence gives a journey that is not reasonable for a pedestrian, say, in a single day.

June 15, 2010

11:57

Computer Science Education

RoadsToRome-preprint Do All Roads Lead to Rome?

7

directionality of reductions. 4

Enough of Cities: Want to See Wider Regions!

A limitation of our traveling metaphor, as developed so far, is that modeling the solvability of computational problems by the reachability of Rome from a single location is too simplistic. Computational problems are defined by sets of inputs rather than single instances, which makes a difference.1 The distinction between computational problems and their single instances creates some confusion. This confusion may have some origins in the simplifications that use cookbook recipes as an introductory analogy for an algorithm. The recipe analogy appears in Knuth’s classic textbook (1973, Sec. 1.1), and it has been recycled by Harel & Feldman (2004, Chap. 1). Harel and Feldman correctly state that recipes with fixed quantities of ingredients do not quite work as an analogy for algorithms, which potentially operate on infinitely many inputs. As they mention, a closer analogy would be a recipe whose amounts of ingredients and times to repeat some basic actions depend, say, on a parameter that indicates the number of servings that is to be prepared. Several recreational games and puzzles are known to be instances of hard computational problems. These general computational problems may be hard, but this does not apply to their specific instances. For example, a puzzle known as Instant Insanity2 consists of four cubes, the sides of which are colored by four different colors. The task is to stack the cubes as a tower so that each color occurs exactly once on each of the four sides of the tower. A generalization of Instant Insanity with arbitrarily many cubes and equally many colors is known NP-hard by a reduction from the EXACT COVER problem (Garey & Johnson, 1979). It is worth emphasizing that this results requires the input instances to be of unlimited size, and thus to require more and more time to solve as a function of the instance size. Any concrete puzzle, say, of four, or ten cubes can be easily solved in some fixed time. Also, precomputed solutions of instances of a fixed size can be stored, retrieved and returned as solutions to specific instances of the puzzle. So, in this sense, any finite problems are uninteresting from the point of view of computability and complexity, since they are solvable in constant time. For this reason, reductions are most relevant in the context of unlimited problems. Remembering that a reduction has to apply to each instance of the source problem is the key to understanding and to explaining the unintuitive directionality of analytic reductions. Let us elaborate this issue by extending our traveling analogy from single locations to wider geographic regions. What makes computational problems unsolvable, or hard, is that they have some instances which cannot be solved by an algorithm in a finite time, or in a time which is bounded by a polynomial of instance size.3 Unsolvable and intractable problems have also easy cases. For example, all straight-line programs which do not use loops or recursion halt with any inputs, and the satisfiability of several special classes of logical formulas are easy despite the hardness of their general versions. Let us extend our traveling analogy in such a way that we equate solvable problems with such regions that we can reach Rome from each location of that region. Conversely, unsolvable problems are modeled by regions such that some of their locations have no connection to Rome. Regions with a finite number of locations are sufficient for us, but the essence is that they contain several locations. The landscape of computational problems is quite abstract and for that reason it takes some imagination to model it by geographic landscapes, but the task is possible, to some extent. For example, we can explain the directionality of analytic reductions as follows. 1 Additionally, the set of instances of a problem is often unlimited, and thus infinite in theory, but the finiteness of our analogies is not an issue here. 2 Instant Insanity is a trademark of Parker Brothers. 3 Notice that there have to be infinitely many such difficult instances; otherwise they could be listed, recognized and solved as known special cases by some finite algorithm.

June 15, 2010

11:57

Computer Science Education

8

RoadsToRome-preprint Pekka Kilpel¨ ainen

Consider the Province of Naples. Most of this province lies on the mainland but it contains also isolated territories like the islands of Capri and Ischia. So, Rome is not reachable from each location of the Province of Naples, and the province is thus a model of an unsolvable problem, say A. Then assume that we model a problem B by a region B ′ such that we can travel from each location in the Province of Naples to some location of B ′ . This corresponds to a reduction from problem A to problem B. (For example, the entire Italy would be a suitable value for region B ′ .) This means that region B ′ has to contain, among others, some locations on the islands of Capri and Ischia, and these locations have no connection to Rome. This corresponds to the argumentation by a reduction from problem A which shows that problem B is unsolvable. In contrast, a reduction in the opposite direction wouldn’t give us any information of the solvability of B: A reduction of B to A would correspond to a way of traveling from each location of B ′ to some location in the Province of Naples. Such ways would exist whether B ′ is, say, the island of Capri, and thus not connected to Rome, or some mainland province, like Frosinone, which has good connections to Rome. Similarly, we can explain that concluding the hardness of a problem requires a reduction from a known hard problem, while a reduction to a hard problem provides no new information. For example, model a hard problem—with some difficult instances—by the whole mainland Italy, and model a polynomial-time reduction by a relatively short hike. Then, if there is a short hike from each location of mainland Italy to some region B ′ , it is clear that some locations of B ′ must be far from Rome, and thus B ′ corresponds to a hard problem. Again, a reduction in the opposite direction gives no information of the difficulty of the source problem. For example, B ′ could be, say, either the Vatican State (inside Rome) or Trentino (by the border of Austria). In both cases some locations of mainland Italy would be in the walking distance of each location of B ′ , and yet the Vatican State would clearly be an ”easy region” (∼ a polynomial-time problem), while Trentino would be a ”hard region” (∼ an exponential-time problem).

5

Similar Journeys

In this section we review some previous work and references on reduction and on the use of analogies in computer science education. The textbook of Garey & Johnson (1979) is the classic reference for the theory of NPcompleteness and the use of reductions therein. Several NP-completeness reductions are normally worked out in detail on advanced algorithms courses. Students often have difficulties to motivate themselves to these proofs. Skiena (1998, Sec. 6) tries to offer such motivation as follows: The theory of NP-completeness also enables us to identify what properties make a particular problem hard, thus providing for us to model it in different ways or exploit more benevolent characteristics of the problem. Developing a sense for which problems are hard and which are not is a fundamental skill for algorithm designers, and it can come only from hands-on experience proving hardness.

Skiena (1998, Sec. 6.6) also gives practical advice for seeking NP-completeness proofs. The textbook of Harel & Feldman (2004) offers delightful popularization of several central topics in algorithmic computing, including some illuminating examples of reductions both for showing problems unsolvable and for showing them NP-hard. According to Armoni (2009), most standard textbooks on algorithms do not mention reduction explicitly, or discuss it only in the advanced sections close to the end of the book. Luckily there are some exceptions, too. Levitin’s textbook (2007, Chap. 6) discusses reduction explicitly as an algorithmic problem solving method. Levitin treats a category of algorithmic methods under the title of transformand-conquer. The main ingredient of transform-and-conquer methods is to apply an initial transformation to problem instances, which helps to solve them. Levitin mentions instance simplification, representation change, and problem reduction as the three major variations of transformand-conquer methods. In instance simplification, the problem instance is transformed to a simpler

June 15, 2010

11:57

Computer Science Education

RoadsToRome-preprint Do All Roads Lead to Rome?

9

or easier-to-work-with instance of the same problem. In representation change, the instance remains the same but its representation is transformed into a more convenient form. Horner’s rule for evaluating polynomials is a well-known example of a useful representation change. Finally, in problem reduction, the given instance is first transformed into an instance of a totally different problem. All these variations are reductions in the sense of the current article: In each of them, the given instance is transformed into another one, whether it is the same instance in a different form, or a smaller or simpler instance of the same problem, or an instance of a different problem. Also the textbook of Dasgupta et al. (2008) provides some explicit discussion of reductions, especially in the context of linear programming. The importance of linear programming as a general methodology stems from the wide variety of problems that reduce to it. Maximum network flow, to which several other problems can be reduced, is a prime example of a generic problem solvable in terms of linear programming. Dasgupta et al. (2008, Sec. 7.7) also sketch a simple proof for the surprising result that any problem which is solvable in polynomial time can be reduced to linear programming. Problem reductions have a fundamental role in mathematics. Levitin (2007) points out how the whole branch of analytical geometry is based on reducing geometric problems to algebraic ones. In a similar manner, we could observe how computer science is based on reducing ”realworld” problems, which deal with information, to syntactic ones, which deal with data and are thus amenable for computer processing. Michal Armoni and her co-authors have carried out extensive research on the teaching of reduction in computer science (Armoni, 2004; Armoni & Gal-Ezer, 2005, 2006; Armoni et al., 2006; Armoni, 2009). They argue that developing reductive thinking is important and should be emphasized. As a way to this, Armoni and Gal-Ezer (2005) suggest to present, and to encourage students to find, reductive solutions for language-theoretic problems on computational models courses. In (Armoni & Gal-Ezer, 2006) they report empirical findings which indicate that university students have difficulties in fully perceiving the notion of reduction. Armoni et al. (2006) and (the larger, quantitative study) Armoni (2009) report findings of undergraduate student’s perception of reduction and identify several mental obstacles therein. Especially student’s limited recognition and application of reduction outside the formal context of the course on which it had been taught, that is, a lack of transfer, seems to be a problem. Ib´an ˜ez and S´ anchez (2009) have presented a programming approach for teaching computability in such a way that the students can learn about reductions between problems by concretely programming them. The article of Lowther & Shene (2004) is related, by presenting attempts to make a computability course interesting to the students by applying intuitive explanations based on a programming approach. Lowther and Shene also present examples of intuitive reductions for showing some interesting properties of programs to be undecidable. (Notice that the authors use terminology which is opposite to ours, by saying that these are reductions to the halting problem.) The use of metaphor and analogy in learning and teaching science has received some attention in pedagogical research. This work has been surveyed in the collection edited by Aubusson et al. (2006). By ”metaphor” we refer to comparisons of things in general, and when the comparison is extended by highlighting the similarities and the differences between the two things, we call it an ”analogy” (Aubusson et al., 2006). Familiar analogies are intrinsically interesting to the students and thus have potential of promoting understanding. Despite this, analogies are also seen as problematic by the education research community (Harrison & Treagust, 2006). All analogies break down somewhere, that is, they contain also features that are irrelevant or misleading for the target concept. In order to avoid potential misconceptions, Hativa (2001, Ch. 10) presents six steps that should be included when presenting an analogy. These are (a) introduce the target concept; (b) recall the source concept and ascertain students’ knowledge of it; (c) identify similar features of the two concepts; (d) map similar features; (e) draw conclusions about the concepts; and (f) indicate where the analogy breaks down. Hativa (2001) also discusses simplification as a technique for promoting student understanding in general.

June 15, 2010

11:57

Computer Science Education

10

RoadsToRome-preprint REFERENCES

A method of lecturing based on combining analogy with exaggeration has been described by Matocha et al. (1998). The authors call this combination an ”extended analogy”. They give three examples of using extended analogies for teaching technicalities of computer networking, which are basics of TCP/IP, encryption, and differences between the Ethernet and the token ring protocols. Sid Stamm (2004) discusses the use of alternative classroom techniques for introductory computer science courses. He argues that alternative methods are especially useful for gaining student attention, and for being able to reiterate central concepts using different techniques and thus avoiding the risk of seeming redundant. A repertoire of alternative teaching methods should match and support students’ diverse learning styles, and thereby increase the effectiveness of their learning. The results of an experiment carried out and discussed by Stamm suggest that the effectiveness of alternative teaching methods depends on students’ personal learning styles. The instructors who had applied activating role-plays to teach some core concepts of Java were excited about their refreshing effect and plausible efficiency. Even though Stamm’s statistical results seem to suggest that role-play had a clear positive effect on students whose initial knowledge of the topics was below average, it also seemed to have minimal negative effects on those students who were doing well with traditional lectures and group-work.

6

Conclusion

In this article we have suggested and discussed analogies based on the metaphor of traveling to be used for explaining basic ideas of the concept of reduction on introductory computer science courses. I invite the readers to invent, to test in class, and to report their own favorite analogies for explaining reduction, and other concepts of computing.

References Abrahamson, C.E. (1998). Storytelling as a pedagogical tool in higher education. Education, 118(3), 440–451. Armoni, M. (2004). Reductive Thinking: How to Teach it? In ITICSE ’04, June (p. 280). Leeds, UK: ACM. Armoni, M. (2009). Reduction in CS: A (Mostly) Quantitative Analysis of Reductive Solutions to Algorithmic Problems. ACM Journal on Educational Resources in Computing, 8(4), Article 11. Armoni, M., & Gal-Ezer, J. (2005). Teaching Reductive Thinking. Mathematics and Computer Education, 39(2), 131–142. Armoni, M., & Gal-Ezer, J. (2006). Reduction – and Abstract Thinking Pattern: The Case of the Computational Models Course. In SIGCSE ’06, Mar. (pp. 389–393). Houston, Texas: ACM. Armoni, M., Gal-Ezer, J., & Hazzan, O. (2006). Reductive Thinking in Computer Science. Computer Science Education, 16(4), 281–301. Armoni, M., & Ginat, D. (2008). Reversing: a fundamental idea in computer science. Computer Science Education, 18(3), 213–230. Aubusson, P.J., Harrison, A.G., & Ritchie, S. (Eds.). (2006). Metaphor and analogy in science education. Springer Verlag. Aubusson, P.J., Harrison, A.G., & Ritchie, S. (2006). Metaphor and Analogy. In P.J. Aubusson, A.G. Harrison & S. Ritchie (Eds.), (pp. 1–9). Springer Verlag. Bruner, J.S. (1960). The Process of Education. Harvard University Press. CS2008 Review Taskforce, Computer Science Curriculum 2008: An Interim Revision of CS 2001. (2008). Technical report, ACM & IEEE Computer Society. Dasgupta, S., Papadimitriou, C., & Vazirani, U. (2008). Algorithms. McGraw-Hill. Garey, M.R., & Johnson, D.S. (1979). Computers and Intractability, A Guide to the Theory of NPcompleteness. W.H. Freemand and Company. Harel, D., & Feldman, Y. (2004). Algorithmics: The Spirit of Computing (Third edition). Addison-Wesley.

June 15, 2010

11:57

Computer Science Education

RoadsToRome-preprint REFERENCES

11

Harrison, A.G., & Treagust, D.F. (2006). Teaching and Learning with Analogies. In P.J. Aubusson, A.G. Harrison & S. Ritchie (Eds.), (pp. 11–24). Springer Verlag. Hativa, N. (2001). Teaching for Effective Learning in Higher Education. Kluwer Academic Publishers. Ib´ an ˜ ez, J., & S´ anchez, A. (2009). Constructive Reduction: Understanding Uncomputability through Programming. inroads – SICCSE Bulletin, 41(2), 90–94. Knuth, D.E. (1973). The Art of Computer Programming (Second edition). Addison Wesley. Levitin, A. (2007). Introduction to The Design and Analysis of Algorithms (Second edition). Pearson Education. Lowther, J.L., & Shene, C.K. (2004). Toward an intutive and interesting theory course: the first step of a road map. Journal of Computing Sciences in Colleges, 20(1), 124–135. Matocha, J., Camp, T., & Hooper, R. (1998). Extended Analogy: An Alternative Lecture Method. In SIGCSE 98 (pp. 262–266). Atlanta, GA: ACM. McDrury, J., & Alterio, M. (2002). Learning through storytelling in higher education: using reflection in higher education contexts. Dunmore Press Limited. Schwill, A. (1994). Fundamental Ideas of Computer Science. Bulletin of the EATCS, 53, 274–295. Skiena, S. (1998). The Algorithm Design Manual. Springer Verlag TELOS. Stamm, S. (2004). Mixed Nuts: Atypical Classroom Techniques for Computer Science Courses. ACM Crossroads, 10(4). Wing, J.M. (2006). Viewpoint: Computational thinking. Communications of the ACM, 46(3), 33–35.