CS 624: Analysis of Algorithms

Carl Offner

Spring 2018

office: 130
email: offner "at" cs.umb.edu

In addition to this web page, I will put my lectures and other materials in the directory ~offner/cs624 and subdirectories under it. Feel free to poke around there. Anything there (or under there) is for you to take. (Note that these are not web pages—they are ordinary files, and you have to log in to your cs.umb.edu account to access them.)



This prerequisite is important. If you have not had it, and done well in it, you should not be enrolled in this course.

Further, while CS 320L is the official prerequisite, there is some other material that you really need to know in order to understand what we are doing in this course. Undoubtedly you have studied this before, but I just want to make it explicit here. I will not review this material in class—you are responsible for understanding it. The homework and also the exams will include problems using this material:

Class meetings: M/W 5:30-6:45 PM in room W-1-41 (that's the Wheatley building, first floor)

Please note: The classroom just changed. What you see here is the correct room.

Office hours: Before class: M/W 4:30-5:15 PM


Introduction to Algorithms, Third Edition
by Cormen, Leiserson, Rivest, and Stein
MIT Press, 2009


I'm sure everyone in this class has taken one or more courses in which you have learned some of the really great algorithms.

This is not one of those courses. This is not a course in "really great algorithms", or in writing programs, or even in writing pseudo-code.

This is for all practical purposes a mathematics course. It is a course on the analysis of algorithms. We are going to prove theorems in this course. In fact, that's just about all we are going to do. And when I say we, I really mean you. The homework will consist of theorems that you will have to prove. The exams will consist of theorems that you will will have to prove. That's what we're going to do.

At a minimum, I plan to cover the following material this term:

  1. Introductory material. What do we mean by analysis of algorithms? Why do we care? Some basic examples.
  2. Mathematical background and some useful mathematical techniques. Orders of growth of functions. Solving and estimating solutions of recursions. Generating functions.
  3. The analysis of Heapsort and Quicksort. Best-case, worst-case, and average-case behavior.
  4. Lower bounds on sorting algorithms; bucket sort.
  5. Order statistics.
  6. The theory of binary search trees.
  7. Dynamic programming.
  8. Amortized analysis.
  9. Graph algorithms; in particular:
  10. The theory of NP-completeness.

There are many other topics that I'd really like to cover as well. This is just a fascinating field. We'll see…

Course Work:

There will be one homework assignment each week. I will not accept assignments handed in late.

There will be two in-class "mid-term" exams, and one final exam.

All the exams will be "closed-book" exams. No books, no notes, no smartphones or other electronic equipment, and so on. Just bring something to write with.


I will weight the work in the course roughly as follows when making up final grades:

I will not give out "review sheets" for the exams. It should go without saying, however, that the very best way to prepare for the exams is to

Writing Proofs:

This course does not involve any programming per se, although without a doubt your experiences in building serious programs will help you understand many of the issues we deal with.

In fact, as I already stated above, the course could well be regarded as a mathematics course. I will be proving things in class, and you will be expected to write formal proofs in your assignments and on exams. If this is something you are not ready to come to grips with, you should wait until you are ready to take this class.

There is a style to writing proofs. In fact, there are several styles. Your goal should be to write proofs that are easy to read and that illuminate the reason why something is true. This is not easy to do. Good writing of any kind is difficult, and we will work hard at it all term.

Probably the single most important proof technique in this area is mathematical induction. I will assume not only that you are familiar with this, but are comfortable using it. I will not teach it, but I will expect to see inductive proofs written out clearly and well.

I also expect you to be familiar with standard mathematical notations such as summations (and of course, integrals). Some of this is reviewed in the appendices of the text. I will not review this in class. I expect you to know it, and we will be using it a lot.

One thing is very important to bear in mind: like any other kind of writing, a proof must be understandable. If I can't understand what you are writing, then it can't be correct. And I'm not going to try to guess what you had in mind. (One thing I have noticed is that some students seem to believe there is only one way to do something, and only one way to explain it, and so of course I must understand what they mean. But that's not true. There are almost always many ways to do things, and many ways to explain them. If I write on your paper "I don't understand this", I'm not being irritable—I really don't understand it.) If you are uncertain how to express something, please just talk to me or send me email, and I'll try to help. But don't even bother writing something that can't be understood.

Think of this like you would when writing a computer program. If the compiler or interpreter can't understand it, it's wrong. And you have to be really careful with your use of language and terms. For instance, one thing beginning programmers often get mixed up about is the correct use of "or" and "and". The meaning in computer languages is not the same as in English (or any other natural language, so far as I know). The same is true in proofs. We use language in very precise and fixed ways in proofs, and we do this so that what we write can be understood in its exact meaning by anyone at any time, anywhere in the world.

Just for a simple example: the sentence "All horses are not white." does not mean the same as "Not all horses are white." At least, not when writing proofs. In ordinary English, these two sentences are generally regarded as equivalent. But for our purposes they are not. You have to be careful about this.

Here's another example: The symbol "==>" means "implies". It does not mean "then". So you can write

   if x = 3 then x + 5 = 8
or you can write
   x = 3 ==> x + 5 = 8
But you cannot write
   if x = 3 ==> x + 5 = 8   !!! WRONG !!!
Here's another thing to watch out for: the symbol "=" means "equals". It doesn't mean anything else. (Well, there is one small exception, involving "big-O" notation, which we will cover in the second class.) So could could write something like this:
    2x - 1 = 5
         x = 3
But you cannot write
    2x - 1 = 5
   =     x = 3       !!! WRONG !!!
Please try to be careful about things like this. And please don't be offended if I correct mistakes like this in what you write.

Collaborating with Others

I encourage you to talk with other students—in fact, with anyone—about the topics we are covering. And I also encourage you to send me email with questions; I'll be happy to get back to you as quickly as I can. However, the writeups you hand in must be entirely your own. You may not copy proofs, or algorithms, or parts of proofs or algorithms, or anything else, from anyone else's paper, or from the web, or from books, or from anywhere else, even if you give credit to that person or source. And you must be able to explain to me what you have written.

Please do take this seriously. I'm very happy to try to help you out in person or by email. I really do want every one of you to succeed, and I'll try hard to make that happen. But I have no tolerance at all for plagiarism. If I find evidence of it, you will receive an F for the course. And I don't give "second chances".

On-line resources:

Two web sites that you might profitably look at are:

On both these web sites you can find lecture notes and videos of course lectures.

Some University Policies: