CS 624: Analysis of Algorithms

Carl Offner

Spring 2021

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.)


Assignments:

All assignments should be scanned in as PDF files and emailed to me at the email address above. Use the message subject "CS 624 Assignment XXX", where XXX is of course the number of the assignment.

The email must reach me by 5 PM on the day it is due. Late work will not be accepted.


Prerequisite:

This prerequisite is important. You really need to have taken this course, and done well in it, or can convince me you really do know this material, to get the benefit of CS 624.

Further, while this 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. I do know that 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:

I don't mean this to be intimidating. Many people get very frightened by even elementary mathematics. There is no need to be frightened. And I'll always be available to help you out.

Class meetings: M/W 5:30-6:45 PM

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


Text:

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

This is the most widely used text (by far) in this kind of course, all over this country, and maybe all over the world. It's a great book; it's very well written; it covers a vast number of important topics; and you can keep it and refer to it throughout your career.


Syllabus:

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.


Grading:

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. That doesn't mean, though, that I expect you to be experts in proving things. Constructing proofs is a very sophisticated skill that we will work on all term. You will gradually get better at it. And I'll be very willing to help you every way I can.

There is a style to writing proofs. In fact, there are several styles. But the main thing to keep in mind when writing a proof is this: Your goal should be to write a proof that is easy to read and that illuminates the reason why something is true. That's really what a proof is. And 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 that you have had some experience with this technique, and I'll give you some pointers, since we will be using it a lot.

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 hard to help you. 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 you could write something like this:
    2x - 1 = 5
  so
         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. Asking me questions, and sending me email does not lower your grade. And it does not make me think badly of you. In fact, it shows me that your are taking this material seriously. This material we will be studying is very sophisticated. Of course you will have questions. That's good.

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.

I also expect you to read the file ~offner/cs624/honesty.pdf. This file spells out in more detail exactly how we should look at our work in this course.

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: