Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Discovering the Structure of Recursion

Rodolphe Courtier
courtier@stanford.edu

December 15, 2008


Abstract

The hypothesis that I am testing is whether tangible artifacts can lead to the

discovery of recursion and transfer of recursive thinking. This was tested by

giving subjects two problems to solve, both of which have recursive solutions:

the matchstick game and the knapsack problem. Subjects in the first condition

were given real chopsticks during the matchstick game, whereas subjects in the

second were not. Then the knapsack problem was given to all subjects afterward

with no tangible items. The study looked at whether or not the tangible artifacts

were involved in the discovery of recursion. None of the subjects gave any

indication that they were solving the second problem recursively, with the only

recursive thinking appearing in the first problem. Because of the small sample

size and problems with the design of the materials, the results of the study are

inconclusive, but seem to suggest that the tangible artifacts have an effect on

the discovery of recursive solutions but not on the transfer of recursive structure.
1 Introduction

What is the 5th value of the Fibonacci sequence? What about the 10th? What

about any arbitrary nth value of the Fibonacci sequence? How would you solve

this problem anyway? If you asked a group of computer scientists, many of

them would inevitably mention the classic example of a recursive solution to a

problem:

f ib(1) = 1

f ib(2) = 1

f ib(n) = f ib(n − 1) + f ib(n − 2)

Recursion in mathematics and computer science is a way of defining a func-

tion such that the function calls itself, like in the example of the Fibonacci

sequence above. It is also a way to describe any process where an object re-

peats itself, such as definition of the acronym PHP, which stands for PHP:

Hypertext Processor.

Recursion is also one of the most difficult ways of thinking that young stu-

dents in computer science have to grapple with. So how can we teach these

young students to think in this bizarre way? And can tangible artifacts help

teach people to think this way? Artifacts have long been shown to greatly

augment human cognition. One need only look at writing to see that human

memory faculties have been greatly expanded by offloading memory from the

brain to written artifacts. That is the question of this study: can tangible ar-

tifacts help students discover recursive solutions to problems and then transfer

this knowledge to other recursive problems?

The practical application of this experiment is in furthering the pedagogy of

1
teaching recursion, which is a difficult problem in computer science programs.

Thinking recursively isn’t natural. One of the subjects mentioned to me after

the experiment that she considered solving the first problem recursively, but

opted not to. She said that she had been taught to always look for short cuts

or tricks to problems, which is what she said she was trying to do.

This experiment also addresses the problem of transfer: how do we get people

to learn a concept, such as recursion, so that they are also able to transfer it new

situations? In this study, subjects were given two recursive problems to solve.

In the first condition, subjects were given tangible artifacts to help them solve

the first problem, whereas subjects in the second condition were not. Then they

were all given the second problem to solve without artifacts. Then we looked at

whether or not subjects who solved the first problem recursively would also solve

the second recursively. This would perhaps indicate that they had managed to

start thinking recursively and had seen the similarity of the structure of the

two problems and transferred, even though they are both on the surface very

different.

2 General Experiment Description

This study will be looking at whether or not having tangible artifacts that

reflect the task will encourage the discovery and transfer of recursive solutions

to recursive problems. This leads to two hypotheses that will be tested. Do

tangible artifacts aid in the discovery of recursive solutions to problems? And

do tangible artifacts aid in the transfer of knowledge about recursive solutions?

To test these hypotheses, the study will have each subject solve two recursive

problems while doing a talk-out-loud protocol. The problems are the matchstick

problem and the knapsack problem. These problems were chosen because they

are understood in the Math and Computer Science community as problems

2
that have recursive solutions. They were also chosen because both problems

have very clear physical analogs.

The matchstick problem is the problem of winning the matchstick game.

The matchstick game is played by two people who remove matchsticks 1, 2 or

3 matchsticks at a time from a central pile. The loser is the one who picks up

the last matchstick. The problem subjects have to solve is how to guarantee

their victory. The knapsack problem is the problem of maximizing the value of

combinations of items in your knapsack which have varying weights and values.

In the first condition, subjects are given the matchstick problem and told to

solve it out loud. They are also given 11 chopsticks to use which they can use to

help solve the problem. They are given 5 minutes to solve it before they move

on to the knapsack problem, in which they are not given any tangible items to

help them think. In the second condition, subjects are not given the chopsticks

while they solve the problem. Afterward, they are administered the knapsack

problem in the same manner, without tangibles.

The independent variable is whether or not they are given the chopsticks to

help them solve the problem. These tangible items form a very direct represen-

tation of one form of the matchstick problem, which is why they were chosen

as the tangible object. The dependent measure is whether or not the subject

engaged in recursive thinking or problem solving during the tasks.

There are a few possible outcomes. The one that would best support my

hypothesis is one where subjects in the first condition with the tangible artifacts

engage in recursive thinking in both tasks while subjects in the second condition

do not engage in recursive thinking in either condition. A more likely version of

this scenario is that more subjects in the first condition with the artifacts use a

recursive solution than in the second condition without the tangible artifacts.

3
3 Methods

3.1 Participants

There were six participants in this study, five of whose data were kept. One

was thrown out due to corrupt video files. The subjects were college students

between the ages of 19 and 23 of mixed gender and chosen for convenience. All

of the subjects were non-programmers, which was known to the experimenter

prior to the study, and was not mentioned as a precondition to participating in

the experiment to the subjects.

3.2 Materials

Participants in the first condition were given 11 chopsticks as an artifact to use

while solving the matchstick problem, as a proxy for actual matchsticks.

Besides the chopsticks, users were given verbal instructions at the beginning

from a script (see appendix), as well as scripted descriptions of the problems

prior to each problem. Each script emphasized the fact that the subjects needed

to talk out loud and that the emphasis was on how they were solving their

problem, not whether or not they reached the correct answer.

3.3 Design

This experiment contrasts discovery and transfer of recursion when there is a

tangible artifact during the problem solving, and whether or not this discovery

will transfer. Each subject had to solve two problems, the matchstick problem

first and then the knapsack problem. People in the first condition were given

chopsticks as a proxy for matchsticks to use as artifacts during the matchstick

problem. People in the second condition were given nothing for the first ques-

tion. In both conditions, participants were given nothing to solve their problem.

4
The same amount of time was allotted for each procedure.

The differences between the conditions is in the first problem. The indepen-

dent variable is the presence of the tangible artifacts. The dependent measures

are the presence of recursive thinking in the first problem, the presence of re-

cursive thinking in the second problem, and the relationship between the two

presences.

3.4 Procedure

Each experiment started with the experimenter and subject sitting at a table.

Subjects were read the introductory script, which explained to them that they

would be solving two problems, that they should speak aloud while solving the

problems and that they would be video recorded for analysis.

Once they understood, the camera was set up. The camera was oriented to

pick up the table in front of the subject and the subject’s hands and arms so as

to pick up any gestures they made.

In the first condition, 11 chopsticks were placed in front of the subject. Then

the description of the matchstick game was read to them, which explained to

them the rules of the game and then asked them to figure out how they would

guarantee their win for any game. It was emphasized to them that they weren’t

solving the game in front of them specifically, but how would they win any game

of matchsticks. Subjects in the second condition were not given any chopsticks

and were just given the instructions. In both conditions subjects were reminded

to think out loud.

Subjects were given 5 minutes to solve the problem. Subjects were not

required to use all 5 and could move on to the next problem as soon as they

felt that they had solved the problem. Their questions were answered if they

pertained to clarification of the rules of the game or what the task at hand

5
was supposed to be. If users just gave an answer such as I would just do x,

the experimenter would ask them to explain further what they had done, or

how they had figured that out. If the subject asked questions pertaining to the

solution such as is this the right answer?, they were told that the experimenter

couldn’t tell them.

When they were ready to move on (no subject used the entire 5 minutes),

the camera was stopped. Then the description of the knapsack game was read

to them. Because the pilot subject had a lot of trouble understanding the

knapsack problem, an example of potential items that could be placed in the

knapsack was given. Then the camera was started. The same procedure for the

second problem was used in both conditions. Like for the matchstick problem,

participants were given 5 minutes to solve the problem, which they were not

required to complete. If the user had any clarifying questions, they would be

answered, if the subject asked questions pertaining to the solution such as is

this the right answer?, they were told that the experimenter couldn’t tell them.

Once subjects were done with the second problem, the camera was stopped

and the experiment was over. Afterwards, the video was transcribed for analysis.

3.5 Coding

The dependent measure in this study is the presence of recursive thinking. The

evidence for recursive thinking came from an analysis of the transcription of

the subjects while they were solving the problems. Each problem solving round

(each subject went through 2 rounds, one for each problem) was counted as

having evidence of some recursive thinking if the subject explicitly demonstrated

a recursive structure in their discourse, verbal or gestural. The transcription

was done to try and figure out what the state of the problem was for the subject

(e.g. in the matchstick game, how many matchsticks were left), and what actions

6
were being made on the state. A binary coding system was used, either a round

had evidence of recursive thinking or it didn’t.

This structure involved two basic components. First, there had to be some

initial action (verbalized or gestured) that led to the initial state. Initial in this

case meant a local initialness. Second, from that condition, another like action

(like the initial action) had to be made on the initial state, which would lead

to a new state. Third, the subject had to return to the initial state and make

another like action on the initial state that would lead to a new, unique state.

See figure 1 for a visual representation of the structure.

An example of this recursive structure can be seen in the recursive solution

to figuring out all the possible combinations of coins that can be made to sum

up to a particular value. For example, if you wanted to find out how many ways

you could make $.15 with dimes and nickels, this would be part of the structure:

1. Add a nickel to create an initial state of $.05 with 1 nickel

2. Add a dime to create the new state of $.15 with 1 nickel and 1 dime

3. Return to the initial state of $.05 with 1 nickel

4. Add a nickel to create the new, unique state of $.10 with 2 nickels

Evidence of recursive thinking had to contain every step of the recursive

process.

4 Results

The study found that our first hypothesis, that tangible artifacts would help

people discover recursive solutions to a problem was not falsified. The second

hypothesis, that they would learn the underlying structural similarities between

problems with recursive solutions was, according to our data, falsified.

7
Figure 1: Visual representation of recursive structure

8
Subject Tangible Artifact? Matchstick Game Knapsack Problem
1 - X -
2 ˆ X -
3 - - -
4 ˆ X -
5 - - -

Figure 2: Results.A circle in the ”Tangible Artifact?” column means the sub-
ject got chopsticks during the matchstick game. A check in the ”Matchstick
Game” or ”Knapsack Problem” column means the subject showed evidence of
a recursive solution.

Figure 3: Celine’s recursive solution. Quotes were taken directly from the tran-
script of the video. Actions and states are represented abstractly.

9
Speech
1 well, umm..
2 I don’t know.
3 I wouldn’t know— I don’t really know how to solve this
4 I’d probably take, oh oh, I’ll just three,
5 I’ll probably take two
6 (pause)
7 wait, something, hold on
8 I’ll take. I’ll take one.

Figure 4: Transcript. The line numbers are purely for convenience and contain
no time information.

When the data was analyzed using the strict coding system, 2 instances of

recursive struture were found in subject’s solutions (see figure 2). Both instances

were found in the first condition with the tangible artifacts, and both were found

while the subject was solving the matchstick game.

The subject 4 was given 11 chopsticks as tangible artifacts to help her solve

the matchstick problem. This subject (Celine Courtier, who explicitly asked to

be mentioned by name in this paper) discovered a recursive solution to a subset

of the matchstick problem. When there were 5 matchsticks left in the game and

it was her opponents turn, she recursed through every option that her opponent

had (see figure 3).

You can see in figure 3 that she has all the elements of the recursive structure

needed to code it as recursive thinking. She has an initial action that leads to

an initial state— picking up some chopsticks so that the game has 5 chopsticks

left on her opponents turn. Then she takes a like action (has her opponent pick

up 1 chopstick), which she follows through to a few more actions. Then she

returns to the initial state of 5 matchsticks, where she then takes another like

action. She does this for every possible move her opponent has (1, 2 or 3 sticks).

She however did not discover or transfer a recursive solution to the second

problem.

The subject 2 was also given 11 chopsticks as tangible artifacts to help him

10
solve the matchstick problem. The initial state of his recursive sub-problem was

6 sticks. He mentions this verbally and also arranges the chopsticks so there are

6 in front of him. The rest of his interaction is verbal.

The remainder of his actions are verbal, he does not actually move the

chopsticks. The transcription of his speech is in figure 4. The initial state he

is working with is 6 matchsticks. He had arrived at this state earlier, and won

a game. He has now returning to this state to figure out how he would solve

the problem. On line 4 he makes the first like action to a new state. On line

5, there is an implied move back to the initial state, and then a new like action

to another new state. Lines 6 and 7 are an implied move back to the initial

state. Like 8 is a move to a new state. The subject is recursing through all of

the movies he can make from this initial state.

This subject also showed no evidence of a recursive solution in the knapsack

problem.

Subject 1 also showed recursive structure in his solution which was in the

second condition, without tangible artifacts. A full model of his solution is in

figure 5. He reveals his recursive solution in pieces. On lines 1-7 he builds the

top path of figure 5. On line 10-15 he recurses backwards, using 5 sticks as the

initial state and mentally putting back 1, 2 or 3 sticks to get the values of 6, 7

and 8. Lines 17-21 he recurses through the possible moves his opponent could

make from the initial state of 5.

This means a total of 3 subjects had full or partial evidence of recursive

structure in their process, 2 in the first condition with tangible artifacts and 1

without. In addition, none of the subjects had any recursive solution for the

knapsack problem.

11
Speech
1 Like say if there was 7 sticks
2 I’d probably want to pick up 2
3 so that way there’d be 5
4 so even if they picked up 1
5 there’d be 4
6 so I’d pick up 3
7 and then there’d only be 1 left
8 or, so on. and if it was down to...
9 so, see yeah,
10 so, sss-6, 7 or 8
11 you could win pretty easily.
12 that’s probably about it
13 (pause)
14 it’s just that if there were 8 sticks left
15 if I picked up 3
16 it would leave 5
17 and so she only— and that the other person
18 picked up 1 or 2 or 3
19 there would be enough left to where I could pick up
20 either 1, 2 or 3
21 ..to make it to where they had to pick up the last stick and I could win

Figure 5: Subject 1 compiled recursive solution.

12
5 Discussion

The data from the study points toward a non-falsification of the first hypothesis,

that tangible artifacts somehow aid in the discovery of recursive solutions, and

a falsification of the second hypothesis which stated that the tangible artifacts

would aid in the learning of recursive thinking or recursive problem solving in

general.

My data seem to suggest that the tangible artifacts are helping people think

about and solve the matchstick problem recursively. 2/3 of the subjects who

discovered a recursive solution were in the first condition with tangible artifacts.

This also means that 100œof the subjects in the tangible artifact condition found

a recursive solution in the matchstick problem.

I claim that this is because the tangible artifacts offload some of the burden of

thinking recursively. They can offload some of the state information and actions

onto the tangible artifacts, offloading some of the cognitive burden. This leaves

more cognitive resources for thinking through the problem recursively, which

means recursing through all of the possible out comes. This is basically a brute

force method of solving the problem, which seems to be aided by being able

to offload memory tasks into the environment. Althought the fact that the

one subject got a recursive solution in the second condition with no tangible

artifacts muddles that interpretation somewhat.

On the other hand, they did not seem to really grasp the underlying structure

of the problem and solution, the fact that it was recursive and it was a more

general problem solving tool. No subjects in any conditions displayed any sort

of recursive thinking on the second problem. One reason this could be is that

subjects were distracted by the surface features in the first task, and didn’t

grasp the underlying structure of recursion and thus couldn’t transfer it to the

new task.

13
Another alternative is that the second task is just very difficult compared

to the first one. One experiment that could be run to test this would be to

switch the first and second tasks in the conditions, so that subjects in the first

condition would get tangible artifacts to help them with the knapsack problem.

Another way to test this would be to replace the knapsack problem with

another recursive problem that is simpler to understand, or choose two new

recursive problems that are of comparable difficulty. This would also test an

alternative account of my first claim that the tangible artifacts are helping

people think about the problem recursively. It could just be the case that the

problem is just much easier, and the chopsticks only marginally help them solve

the problem recursively. Many subjects did have trouble understanding the

knapsack problem and where the difficulty in the problem lay. They didn’t fully

understand the difficulty of the knapsack problem.

6 General Discussion

The main goal of this study was how tangible artifacts can be used to help

students discover and learn the structure of things. In this case we chose to

focus on recursion. The meager results I have obtained from this study seem to

indicate that while tangible items can be used to discover the recursive structure

of a solution of a problem, they seem to not transfer this knowledge to other

problems.

This study suffered from many flaws, but it is not flawed at its core. But a

great deal many things need to be improved upon to make this study live up to

what it tries to answer. In the view of the experiment, the single most important

thing that could have used improvement was the descriptions of the problems

for the subjects. Many times, the problem or game had to be explained or

clarified to the subjects during the course of the problem solving. Sometimes

14
subjects never really understood what the problem they were trying to solve

was at all, due to a misscomunication. Many of the rounds of the study were

afflicted with this issue, especially for the knapsack problem. This forced the

experimenter to use examples to explain the game, which may have had some

effect on the results.

Another improvement would be to counter balance the order of the games.

In study that was run, the order of the games was the same for all subjects. But

the second game, the knapsack game, seemed much more difficult to understand

and solve than the matchstick game. The order of the games could have had an

effect.

To continue addressing the problem of balancing the difficulty of the prob-

lems, more recursive problems could be added, which could be assigned ran-

domly in a counter-balancing fashion. This would eliminate the problem of just

having one ”easy” problem and one ”hard” problem and instead having a range

of problems.

Finally, we could have used better data gathering techniques. The talk aloud

video data did provide sufficient information for analysis, but a better way to

record what was going on at the time would be beneficial. Some of my subjects

expressed a discomfort at having to verbalize their thought process. One idea

would be to allow them to write or draw on paper. This, along with voice and

gestural data, would give us another channel of information to help discern what

model of the state of the game exists in the subjects mind.

6.1 Future Implications

The implications of this study reach into the realm of whether or not tangible

artifacts, such as manipulatives, are useful pedagogical tools, especially for more

complex ideas such as recursion. The problem is not only in thinking about and

15
discovering the concepts, but also retaining it and understanding the structure,

so that the knowledge can transfer to other problems.

Tangible artifacts are known to aid in thinking. But can they be harnessed

to help people learn? Or are they too bound to their domains and too dis-

tracting with surface features to be of use to learners who want to learn more

generalizable concepts that can be applied elsewhere? This study aimed to be-

gin inquiry into this question, even if the steps were faltering. Further studies

would have more subjects and better materials.

These new tangible artifacts of learning must not only facilitate this dis-

covery and learning, they have to allow people to learn faster or be able to

better transfer their knowledge. It must go above and beyond and improve

upon current teaching methods.

16

You might also like