Student Activities from Lecture 16

November 1, 2006

Overview

This lecture is the first full lecture on Dynamic Programming. Lecture 15 spent about 20 minutes on an initial discussion of the weighted interval problem, so I will need to summarize the discussion before proceeding.

I think this should be a fairly good lecture for student submissions, since it is early in a new topic, so I want to emphasize 'discovery'. There are quite a few places where I would naturally ask for student input, and student submissions allow all of the students to answer.

Activity 1: Construct an Interative Algorithm for MaxValue

Before class notes:

This follows a slide where I present the recursive algorithm with 'memoization'. This exercise will be a chance for the students to do a little bit of coding - it would have been helpful for the students to see the original code as well. This is an important link between the recursive algorithms and the iterative ones, so there is value to having students spend some time to reinforce the idea. I suspect that students will do quite well on this.

After class notes:

Students worked on this one for quite a while - it took some students a while to get started - and a number of students did not seem to get it. One solution was displayed which had a number of minor errors - which other students identified.

Student submission examples

Activity 2: Fill in Opt

Before class notes:

This is the key step from the iterative algorithm (with code provided) - this is just stepping through the array - should be straight forward, but I want students to do it, instead of watching it.

After class notes:

This worked as expected - students were able to get the right answer, and this reinforced the computation. The example was sufficiently difficult that students had to think about it. (The example was changed just before lecture from one that had not been thought out as carefully).

Student submission examples

Activities 3, 4, and 5: Optimal Linear Interpolation

Before class notes:

These are three different activities on the same data - draw the optimal linear interpolation - the example is set up for three lines. With two lines there is a little bit of judgement. The final example, with n lines allows perfect interpolation between adjacent pairs. These should be fast.

After class notes:

This went pretty much as expected - answers were given quite quickly. All students got the final point that interpolation with n lines was just pairwise interpolations

Student submission examples

Activity 6: Interpolation of two segments

Before class notes:

This asks the students for the equation for the minimal error of two segments. The goal of this activity is to get broader participation than if I just asked for the equation. My slight concern on this activity is conveying what I am asking for.

After class notes:

Student submission examples

Activity 7: Optimality equation

Before class notes:

I am not certain I will reach this in lecture - but I put together the slides for the full topic, so this could easily fall over to the next lecture. I want to have some students express the optimality equation - however, I might just have a few volunteers send in a submission, instead of having everyone do it. This is a complicated enough equation, that it will be helpful to get written, instead of verbal responses.

After class notes:

Student submission examples