Lecture 12 Summary

This was the second lecture on recurrences, done with student submissions. The timing on student submissions was different than I expected, so I shifted material in the lecture, and dropped most of the student submissions. See the activity summary for additional details.

This lecture is dominated by two student activities that took a long time. Other than that, there is not too much interaction with the students. The students were very engaged when working on the activities, which turned out to be more challenging than I had anticipated.



Lecture begins with a brief summary of the previous lecture and discussion of some basic facts on logarithms.

At 4:30 Instructor asks a question trying to get students to give the value of the geometric sum. It is not essential that you stop at this point - but students should know what this sum is!



A lot of time is spent on matrix multiplication. This is not from the next. The way the lecture goes is to first give a recursive matix multiplication algorithm (which turns out to be O(n3)). A student submission is done on this. At first this is done just to show a divide and conquer algorithm. However, this sets the stage for Strassen's matrix multiplication algorithm, which by a very clever algorithm reduces matrix multiplication to n2.83.

At 10:00 a student asks about what happens if n is odd - the instructor says lets just stick to powers of two.


The student submission activity is to write down the recurrence and then solve it. It would be very helpful for students to be able to see the algorithm when they are asked to write the results. In class students found various ways to look at the algorithm results.

Quite a few students got off on the wrong track, thinking there were four recursive calls, and not eight. While working on the recurrence, students gradually found the right answer.


At 17:00 the instructor reviews student submissions. The question is "Where did the 8 come from" - this is the correct number of recursive calls, coming from the number of matrix multiplications used when multiplying the 2x2 sub matrices.

Student Submission


This lead directly into the second student submission activity, where the instructor wrote down the correct version of the recurrence and asked students to solve it. These two activities took much longer than planned, leading to a lot of material being skipped. Over seven minutes were spent on this - which was very long for an activity, but students were all working on it.


Student Submission


Student Submission


Students had enough difficulty with this example, that I decided to work through the result. This was unplanned, but it was necessary to go through the derivation. This meant that I cut back on a lot of the planned material.

Whiteboard Slide


Since I spent so much time on matrix multiplication, I decided to skip ahead and include the Strassen slides. This was to give some "pay-off" for the time invested. These are slides 15 and 16 in the slide deck.

At 37:00 a student correctly points out a typo on the slide - it should read: p7 = (b-d)(f+h)

The key point for Strassen's algorithm is that 7 multiplications are performed instead of 8 - which gives a recurrence with a better run time bound.



The instructor returns to the main lecture - but covers the material very fast. The goal was to convey the high level classification of recurrences - increasing work, decreasing work, and balanced work.

At 42:40, the instructor asks which type of recurrence this is. Stop for an answer. (Students did not provide an answer, so the instructor derived the answer).

At 44:10 the instructor asks about the next recurrence - where is the majority of work done - on the first level, on the last level, or balanced across all levels.


At 46:30 the instructor asks how many problems will be solved at the very bottom level of the recurrence. There is no answer from the students.


The lecture ends with a summary slide on recurrences. This is important intuition for working with recurrences.



The following planned activity was skipped because of lack of time. The plan for the lecture was to convey the intuition on recurrences, and then test them with this slide.