Students Mental Models of Recursion at Wits Ian Sanders and Vashti Galpin School of Computer Science, University of the Witwatersrand Johannesburg, South Africa ian@cs.wits.ac.za, vashti@cs.wits.ac.za Categories and Subject Descriptors: D.3.3 [Programming Languages]: Language Constructs and Features Recursion; K.3.2 [Computers and Education]: Computer and Information Science Education Computer Science Education General Terms: Algorithms Keywords: Recursion, mental models 1. ABSTRACT Recursion is a concept which all computer scientists should understand and be able to use but novices nd it di cult to master. In the School of Computer Science at the University of the Witwatersrand (Wits) we have for a long time been concerned about how we can assist our students with recursion [4, 1, 3]. One thrust of our research is the study of the mental models of recursion (c.f. Kahney [2]) which our rst year students develop. Most of our students encounter recursion for the rst time in our Fundamental Algorithmic Concepts (FAC) course. When we originally investigated the mental models of our students we noted that although many of them seem to develop the viable copies model there are still many that develop models which are non-viable (i.e. that cannot be relied on to lead to a correct result) [1]. Thus we adapted the way in which recursion was introduced in FAC in 2003, 2004 and 2005 by introducing more complex recursive algorithms earlier to help in the development of the copies mental model. We then compared the mental models developed by the 2003, 2004 and 2005 students to those developed by the earlier group [3]. The results indicate that more of the students were developing viable mental models of recursion and thus that the changes to our teaching were bene tting our students. In 2006 we changed the programing language in which our students implement algorithms to Python (from Scheme). In essence the programming language was the only change made as the course was still taught in a functional style to emphasize the link between the formal speci cation of a problem, the solution to the problem and the program. We did, however, feel it was important to assess the impact of the change on our students mental models of recursion. We thus did a similar study on the 2006 students to that on earlier cohorts. The students traces from two recursive algorithms were Copyright is held by the author/owner(s). ITiCSE 07, June 23 27, 2007, Dundee, Scotland, United Kingdom. ACM 978-1-59593-610-3/07/0006. categorised into the mental models previously observed [1, 3] by identifying how the student deals with the active ow, base case and passive ow in their trace and then by combining this information into an overall categorisation of the trace for that algorithm . Overall the results are in line with our previous results which showed that the copies model is the dominant model for a recurrence relation type of recursive function but that for list manipulation problems some students showed an active or looping model. These results indicate that our teaching approach, even with the switch to Python, is assisting our students in developing a viable copies mental model of recursion. Such a mental model is more likely to lead to correct traces of recursive algorithms. An interesting new result was the emergence of a passive mental model. Here the students recognised that the recursive algorithm would somehow get to the base case and then used the base case plus the implicit de nition of the function in the algorithm to build up the required solution. This model may have arisen because the students were given a recurrence in Tutorial 1 and asked to calculate what value would be returned. Solving the recurrence essentially meant working up from the value where the result is de ned directly until the desired answer is found. Some students may have adopted this as their model of recursion. 2.
/lp/association-for-computing-machinery/students-mental-models-of-recursion-at-wits-JfKKrXfIa8