Professional Documents
Culture Documents
Student Misconceptions of Dynamic Programming: Shamama Zehra Aishwarya Ramanathan
Student Misconceptions of Dynamic Programming: Shamama Zehra Aishwarya Ramanathan
Student Misconceptions of Dynamic Programming: Shamama Zehra Aishwarya Ramanathan
ABSTRACT levels have been given considerably less attention. For two reasons,
Dynamic Programming (DP) is considered to be one of the most it is important for research to focus on more advanced courses,
difficult topics for students to understand in theoretical CS. Prior even while the community continues to solve pressing issues at the
work suggests that misconceptions arise even when students have introductory level. First, for students who do continue to advanced
completed a course in which there is considerable focus on learning courses, we want to avail ourselves of teaching that is based on
how to solve DP problems. We conducted think-aloud interviews knowledge of student misconceptions. Second, misconceptions at
with students who have completed the DP portion of the Algorithms this level are likely to be largely disjoint from CS1 misconceptions,
course at a top North American research university. We report on so work at different levels of the CS curriculum can be conducted
three themes and their misconceptions discovered through this in parallel.
process. The first theme delves into students’ struggles defining In this paper, we offer a think-aloud study of students as they
the notion of a subproblem and identifying particular subproblems. solve Dynamic Programming (DP) problems. This topic was chosen
The second theme focuses on the understanding and usage of DP based on difficulties reported in recent research on student algo-
solution techniques compared to other algorithmic approaches. The rithmic misconceptions [4]. We interviewed juniors at a top North
third theme is composed of misconceptions related to defining and American research institution, and sought students at a wide range
using recurrences. Analysis of each misconception provides insight of algorithmic facility. We document considerable difficulties with
into student thinking and offers ideas for improving the education the DP problems, some of which replicate prior research, but others
of DP to university students. that, to our knowledge, are reported for the first time.
556
Paper Session: Algorithms SIGCSE’18, February 21-24, 2018, Baltimore, MD, USA
to address. Unfortunately, specific misconceptions and challenges the maximum-value solution using the first i coins, D[i] is
with DP were not provided. the maximum of c i + D[i − 2] (when c i is picked up) and
Another study [11] used lightweight methods (e.g., multiple- D[i − 1] (when c i is not picked up). This problem is concrete
choice or fill-in-the-blank questions) to detect student misconcep- in the sense that the row of coins is provided as input to the
tions of algorithm design and object-oriented concepts. In terms of algorithm and can be visualized.)
DP, students were asked two multiple-choice questions: one on the • Q2: Consecutive 1’s: Describe an algorithm to find the num-
coin-changing problem (given particular coin denominations, what ber of binary strings of length N that do not contain any two
is the minimum number of coins required to make n cents) and one consecutive 1’s. (This problem can be solved by DP; interest-
on the knapsack problem. In each problem, students were asked to ingly, it uses structurally the same subproblem recurrence
fill-in the copy (when the new item under consideration does not as that of the Coin Row problem. This problem is less con-
help) or update (when the new item does help) code required to crete than the Coin Row problem as there is no input array
extend a subsolution to a larger solution. The authors found that provided.)
the coin-changing problem is more challenging than the knapsack • Q3: Maximum Pixel Sum: Given a 2D image where each
problem; and that, within the same problem, copy correctness and pixel can be represented by a value between 0 and 1, find
update correctness were significantly associated. a connected path of pixels that results in the smallest sum
We know of only one DP study that includes specific student mis- of pixel values. The path must begin somewhere in the first
conceptions supported by data [3]. That study used multiple-choice row of the image and end somewhere in the last row of the
questions and student interviews as the data-collection instruments. image. (This problem can be solved with a 2D DP strategy;
Misconceptions included writing a naive recursive solution instead the problem is quite concrete as the input is a grid of pixels.)
of a DP solution, reasoning incorrectly about bottom-up solutions, For each of the three problems, we presented the following ques-
and conflating DP with Divide-and-Conquer algorithms. Only 2 of tions to the students:
23 students were able to fill-in missing code for a solution to the • What is the most appropriate algorithm design technique
coin-changing problem. Compared to that study, our study uses for solving this problem? Note that we did not ask students
what we consider to be conceptually-simpler problems, and we ask to use DP right away; this let us explore variation in how
students to conduct each step of the DP problem-solving approach students’ navigate the algorithm design space. We did direct
rather than fill-in missing pieces of skeleton code. them to a DP solution after several minutes had they not
settled on DP on their own by then.
3 METHOD • What are the sub-problems of this problem and what is the
We conducted in-person interviews that targeted students who were recurrence that relates the sub-problems?
taking the third-year Algorithm Design and Analysis course at a • Write the pseudocode of a bottom-up Dynamic Programming
research-intensive North American university. DP was taught from solution to this problem.
Week 3 to Week 5 of the 12-week course, and our interviews were These steps mirrored the “DP recipe” that was taught to these
conducted in Week 11. Student interviewees were recruited through students in their Algorithms course.
announcements made on our behalf by the course instructor. In We felt that our DP problems were considerably easier than those
particular, the announcements gave no hint that our focus was DP, used in prior research [3]. Still, given the degree of student struggle
instead generally noting that we sought interviewees to inform in that prior research, we worried about students not being able
our research on student conceptions of algorithms. Participation to make any progress at all. With that in mind, we produced two
was voluntary and was compensated with a gift card. Students additional problems that could be solved without using DP:
were selected for interview participation based on a pre-screening • Q4: Stock Market: Given a sequence of historical daily
survey, where we asked for their academic year and self-reported prices for a stock on consecutive days, find the days on
expected grade in the Algorithms course. Fourteen interviews were which someone should have bought the stock and then sold
conducted over four days, each of which lasted approximately one the stock so as to maximize earnings. (A Divide-and-Conquer
hour. solution can be used to solve this problem in O(n log n) time;
Algorithm design problems were prepared and used as the inter- a linear-time scan through the array is also possible.)
view questions. We sought questions that demonstrate the types • Q5: Peak-Finding: Given an array of numbers that we
of variation possible in DP problems [4]. Specifically, we sought know ascends up to some maximum value and then descends
1D- and 2D-array problems, as well as concrete and more abstract until the end of the array, find the maximum element of the
problems. We also chose problems that were unlikely to have been array. (This problem can be solved in O(log n) time using an
covered in the course or studied online by students. We used three approach based on binary search.)
DP problems in our interviews, the first two of which are the focus
These simpler problems served as “morale boosters” in case the DP
of this paper:
problems were not going well for a student. A small number of our
• Q1: Coin Row: There is a row of n coins whose values are students did become agitated or lost confidence when unable to
positive integers c 1 , c 2 , . . . , c n . The goal is to pick up the solve a DP problem. We were cautious of demoralizing students in
maximum-value coins such that no two coins adjacent in that way and then letting them leave the interview; the non-DP
the initial row can be picked up. (This problem can be solved problems were used to mitigate this possibility. Note that these
by DP using a 1D array. Letting subproblem D[i] represent problems were used only when we felt it extremely unlikely that a
557
Paper Session: Algorithms SIGCSE’18, February 21-24, 2018, Baltimore, MD, USA
T# M# Misconception # of Students
T1 M1 Student struggles to write iterative code to solve the problem. 7/14
T1 M2 Student struggles to compose subproblems or define what is meant by “subproblem”. 8/14
T2 M3 Student uses sets for the DP problem. 5/14
T2 M4 Student uses Divide-and-Conquer for the DP problem. 4/14
T2 M5 Student uses a Greedy approach for the DP problem. 8/14
T3 M6 Student struggles to write a recurrence. 4/14
T3 M7 Student fails to use previous experience with a recurrence to solve an analogous problem. 4/10
Table 1: Prevalent Student Themes (T) and Misconceptions (M)
Number of Students
A think-aloud protocol [5] was used in conducting the interviews. 6
This technique involves asking students to verbalize their thoughts S9 S9 S11
as they solve problems. Note that we did not ask students to explain
why they think in the ways that they do; asking why is known to S8 S8 S14 S9
4
change the problem-solving process [5]. Two researchers jointly S5 S5 S10 S10 S7 S12 S8
conducted each interview, with one researcher notetaking and
prompting the student to verbalize their thoughts when required, S4 S3 S6 S9 S5 S9 S7
and the other focusing exclusively on notetaking. We made students 2
aware that we would not be able to provide hints or answer their S3 S2 S3 S2 S2 S8 S6
questions while they worked on a problem, as doing so would S2 S1 S1 S1 S1 S6 S1
influence their thinking and impede our ability to study what they 0
can do on their own. That said, when it became clear that students T1:M1 T1:M2 T2:M3 T2:M4 T2:M5 T3:M6 T3:M7
were not making progress, we did provide hints to inform our Theme: Misconception
understanding of what students can do with help. Once hints were
given, however, further data was analyzed in the context of that
hint, with pre-hint and post-hint progress distinguished in our
Figure 1: Overview of Student Misconceptions.
analysis. This stacked bar graph represents the misconcep-
Each student was first given the Coin Row problem. The second tions that were observed across students (S1-S14).
problem was selected based on the student’s approach and progress
on the first problem. If the student made at least minimal progress
on Coin Row, or understood the general idea of DP and tried to apply
fully-correct solution; intermediate scores were assigned when war-
it, then Consecutive 1’s or Maximum Pixel Sum was selected as the
ranted. This progress-scoring was negotiated by the researchers
second problem. If the student failed to make any progress or gave
and each score was agreed-upon before proceeding with additional
up on Coin Row, then we chose one of the non-DP problems as the
scoring.
second problem and used Consecutive 1’s for the third problem. All
of the interviewees were presented at least two of the DP problems.
For each interview, a digital smart pen device was used to record
4 RESULTS
both the audio of the interview and the student’s written work on Our quantitative and qualitative data reveal many student miscon-
scrap paper. After the interview, all recordings, written work, and ceptions related to DP. In this section, we report on three broad
interviewer notes were analyzed independently by two researchers. themes that were evident from patterns in student misconceptions,
Each researcher segmented each interview and tagged the tran- as shown in Table 1 and Figure 1. Each student in Figure 1 is rep-
scripts with codes representing misconceptions. Misconceptions resented by a colour and label on the graph, and it is evident that
were then clustered into themes. Finally, the researchers met to certain misconceptions co-occur. As an example of interpreting
discuss the themes and codes that were generated as part of their this figure, consider the student labelled S14. We can see that this
individual analyses. Themes and misconceptions are included be- student did not understand how to use subproblems or what is
low only when both researchers agreed on the coding decisions. meant by “subproblems” (M2), used sets to state a solution on a DP
Researchers also jointly coded student progress on each question Problem (M3), and also chose to use a Greedy technique on a DP
on a scale of 0 to 1. A score of 0 indicated no understanding of problem (M5). Each DP question highlighted unique misconcep-
the question; a score of 1 indicated achieving at least a partially- tions. However, for the purposes of understanding student thinking
correct solution which, with minor refinement, could become a across contexts, the most valuable misconceptions are those seen
across questions and students.
558
Paper Session: Algorithms SIGCSE’18, February 21-24, 2018, Baltimore, MD, USA
559
Paper Session: Algorithms SIGCSE’18, February 21-24, 2018, Baltimore, MD, USA
560
Paper Session: Algorithms SIGCSE’18, February 21-24, 2018, Baltimore, MD, USA
student was not comfortable solving problems using DP, perhaps 8 CONCLUSION
these were simply attempts to invoke well-understood, practiced We have presented three themes that emerge from 7 misconceptions
knowledge from prior courses. However, it is not clear why so many held by upper-level CS Students solving Dynamic Programming
of the students thought that these techniques were promising, even (DP) problems. The misconceptions explore specific areas of prob-
when these techniques did not lead to progress. lematic thinking across all steps of the DP problem-solving process.
When students used incorrect strategies and made no progress, We hope that this work may serve a similar purpose as the CS1
they were often quite confident in their answers. This suggests that misconceptions literature: fostering for instructors an appreciation
further time could be spent attuning students to the features of of the ways in which students can misapply core CS material.
problems that may suggest one algorithmic technique over another, We offer a tentative conclusion based on the students that we
or revisiting previously-learned techniques to compare and contrast interviewed: typical DP instruction is insufficient if our goal is for
them with more advanced techniques. students to be able to independently solve DP problems. Improv-
ing such instruction likely requires methods similar to those of
6.3 Theme 3: Defining a Recurrence Enström and Kann [4]. Based on our results, it seems prudent to
intervene at the beginning of the DP design process, improving
Many students proposed using a recurrence by beginning to name
instruction on how students can identify subproblems and how and
it with D[i] or OPT[i], but were not able to decide how a recursive
why composing those subproblems is important to a correct DP
relationship could be expressed, even when they had decided on
solution.
the subproblems. Furthermore, they were not able to recognize how
the recursive relationship between the elements in the array would REFERENCES
lead to a DP solution. This suggests that students have difficulty [1] ACM/IEEE-CS Joint Task Force on Computing Curricula. Computer science
with recurrences and building an array from the recurrence, or curricula 2013. Technical report, ACM Press and IEEE Computer Society Press,
deciding on how the array would be used. Hints given to students 2013.
[2] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms,
about how to form the array or connect subproblems generally did Third Edition. The MIT Press, 2009.
not help students progress. [3] H. Danielsiek, W. Paul, and J. Vahrenhold. Detecting and understanding students’
How is it that students can sometimes identify subproblems misconceptions related to algorithms and data structures. In Proceedings of the
43rd ACM Technical Symposium on Computer Science Education, pages 21–26,
but not be able to use them? We suspect that this has to do with 2012.
students reciting information learned in lecture or tutorial, without [4] E. Enström and V. Kann. Iteratively intervening with the “most difficult” topics
of an algorithms and complexity course. Transactions on Computing Education,
understanding the relationship between the various steps of DP. 17(1):4:1–4:38, 2017.
This suggests that core notions of DP itself are not understood by [5] K. A. Ericsson and H. A. Simon. Protocol Analysis: Verbal Reports as Data. MIT
the student. In accordance with results of Enström and Kann [4], Press, 1993.
[6] G. L. Herman, M. C. Loui, and C. Zilles. Creating the digital logic concept
students tend to find the idea of evaluating subproblems in the inventory. In Proceedings of the 41st ACM Technical Symposium on Computer
correct order to be a difficult concept to grasp. Science Education, pages 102–106, 2010.
[7] L. C. Kaczmarczyk, E. R. Petrick, J. P. East, and G. L. Herman. Identifying
student misconceptions of programming. In Proceedings of the 41st ACM Technical
Symposium on Computer Science Education, pages 107–111, 2010.
7 FUTURE WORK [8] K. Karpierz and S. A. Wolfman. Misconceptions and concept inventory questions
A single think-aloud study is insufficient for validating student for binary search trees and hash tables. In Proceedings of the 45th ACM Technical
Symposium on Computer Science Education, pages 109–114, 2014.
misconceptions. We offer three areas here for future work. [9] Y. Kortsarts and V. Kolchenko. Dynamic programming across the CS curriculum
First, recall that students who struggled on Q1 were next given (abstract only). In Proceedings of the 43rd ACM Technical Symposium on Computer
Science Education, pages 671–671, 2012.
Q4, and then often did well on Q2. Future work involves replacing [10] R. McCauley, S. Grissom, S. Fitzgerald, and L. Murphy. Teaching and learning
Q4 with another, simpler DP problem (perhaps generating the nth recursive programming: a review of the research literature. Computer Science
Fibonacci number). Are the Q1-Q2 patterns sustained in this case? Education, 25(1):37–66, 2015.
[11] W. Paul and J. Vahrenhold. Hunting high and low: Instruments to detect mis-
What would result from the interviewer intervening with explicit conceptions related to algorithms and data structures. In Proceedings of the 44th
instruction on students who struggle on Q1? And are students able ACM Technical Symposium on Computer Science Education, pages 29–34, 2013.
to apply this guidance to Q2? [12] A. Robins, J. Rountree, and N. Rountree. Learning and teaching programming: A
review and discussion. Computer Science Education, 13(2):137–172, 2003.
Second, our interview protocol was not designed to assess prior [13] O. Seppälä, L. Malmi, and A. Korhonen. Observations on student misconceptions—
knowledge that is likely to be prerequisite for solving DP problems. a case study of the Build-Heap Algorithm. Computer Science Education, 16(3):241–
255, 2006.
For example, we did not explicitly seek to identify student thinking [14] C. Watson and F. W. Li. Failure rates in introductory programming revisited. In
on D&C problems, Recursion, Greedy Algorithms, or Algorithm Proceedings of the 19th ACM Conference on Innovation and Technology in Computer
Design in general. In particular, we suspect that some of the diffi- Science Education, pages 39–44, 2014.
culty in T3 can be traced to student misconceptions of recursion
and recursive structure, rather than some “new” misconceptions
specific to DP.
Third, it is necessary to offer other DP questions to students, in
order to generalize or refute misconceptions presented in this paper.
What are the features of DP problems that lead to considerable
difficulty? Are students able to progress easily on more introductory
DP examples?
561