Lecture 18 Summary

See the activity summary for an overview of the lecture.



The instructor says that dynamic programming is the most important algorithmic technique that the students will learn in this class, and the most important thing they learn about dynamic programming is the structure of constructing a dynamic programming algorithm.

At 00:55 the instructor uses the phrase "straw man implementation" which is the easiest, but not best, way to implement something.


Here the instructor says that the point of class today is to have students apply the dynamic programming techniques of 1. Identifying the subproblems and 2. Specifying how to compute the result from the subproblems, to two new problems


Here the instructor introduces the billboard placement problem. The instructor tends to verbally use the phrase "road sign" instead of billboard; road signs and billboards are both just signs that are placed along the side of a road for information or advertisement.

At 6:28, the instructor asks, "What is the best way to place these?" referring to the solution subset of the example set of (position, value) pairs. It's hard to hear the student response, but the instructor repeats what was said. It might be good to stop here to make sure the students understand the problem formulation.


This is an activity slide. You can stop the video at 7:28.

While the students are working (at 8:44) the instructor clarifies: "All I'm looking for now is a description of the meaning of it, NOT the formula for computing it."

At 10:12 the instructor begins displaying and discussing solutions.


This is an activity slide. You can stop the video at 11:15.

At 16:15 the instructor begins discussing. The first submission shown, slide 2.19, captures the point that the hardest part of this is determining how to express Opt[at least five miles back].


The instructor accidentally shows slide 14 at 8:16; at 18:27 he goes to slide 7, which is the right slide.

Slide 7 addresses the issue made clear in the student submissions: How do we express Opt[at least five miles back]?

The instructor then skips to slide 15.


The instructor moves on to the next problem: string approximation. He explains the problem using an example.

At 21:00 the instructor asks "What should I do next?" Again, it's hard to hear the student response but the instructor repeats what was said.

It's probably not necessary to stop here unless the students seem confused.

The instructor emphasizes that 1. You can skip characters, 2. You can use a library string more than once, and 3. You can have mismatches.



At 25:35 the instructor asks if there are any questions about the problem formulation. You should stop here.


This is an activity slide. You can stop the video at 26:16.

At 26:40, the instructor says, "So the optimization problem is going to minimize delta times unmatched plus gamma times mismatched, but for the first submission I just want the definition of what the optimal solution is, and then on the next activity you can do the computation."

At 28:54, the instructor starts displaying and discussing.


This is an activity slide. You can stop the lecture at 30:20.

At 31:40, you can hear the instructor answering an individual student question. It's not important.

At 34:40, the instructor gives the hint that the correct solution involves delta, gamma, and _all_ of the strings in the library.


The instructor goes to a whiteboard slide to derive the answer before showing any student submissions. You should show this whiteboard discussion (or do your own whiteboard discussion) before showing student submissions.

At 40:02 the instructor asks, "So what does the case of sk being unmatched add to the solution?" The student response is hard to hear but the instructor writes it down..

At 41:00 the instructor says, "We're going to cover the character sk using the string bj from our library. How does that contribute to the optimization?" You should stop here to let the students respond. In the discussion at UW, there are several incorrect responses, and a question, that are difficult to hear. The instructor repeats all of the important points, so it's ok that you can't hear the students.

At 42:55, the instructor asks, "So how are we going to add in the mismatches from bj?" Again, stop for student response. At UW, a student gives the right response and the instructor writes it down.

The second term is a little difficult to read; it says "gamma mismatch(k-length(bj), j)"

At 44:11 a student asks a question that is difficult to hear; the point is that we don't allow any of the substrings to go beyond the end of the main string.


Here the instructor makes the point that once you've done the work of the last two activities, "programming is just wrapping a loop around it."