\documentclass[12pt]{article}
% \usepackage{fullpage}
\advance \textheight by \topmargin
\advance \textheight by \topmargin
\advance \textheight by \topmargin
\advance \textwidth by \oddsidemargin
\topmargin 0pt
\oddsidemargin 0pt
\evensidemargin 0pt
\newcommand{\tm}{\mbox{\sc tm}}
\begin{document}
\title{Computer Science 344 \\
Algorithms and Complexity \\
Spring 2002}
\author{Dr. Stephen Bloch \\
office 114 Alumn\ae\ Hall \\
phone 877-4483 \\
email \texttt{sbloch@adelphi.edu} \\
Web page \texttt{http://www.adelphi.edu/sbloch/} \\
Class Web page \texttt{http://www.adelphi.edu/sbloch/class/344/} \\
office hours 10:00-12:00 Monday \& Friday,
1:00-4:00 Tuesday \& Thursday}
\maketitle
\section{Subject Matter}
This is a course for anybody who's ever complained about a computer
being slow. When faced with a computer program that takes unacceptably
long to solve the problem at hand, one option is to buy faster, more
expensive computer hardware. But this option has its limits: perhaps
your money will run out, or perhaps you'll upgrade to the fastest
computer on the market and still be unsatisfied. Often a better option
is to find a more efficient approach to the problem ---~to re-think the
\emph{algorithm} so that it makes \emph{better use} of the hardware.
A \$1,000 personal computer running a good algorithm can often outperform
a \$1,000,000 supercomputer running a bad (though correct) algorithm.
In this course we'll learn how to measure the efficiency of an algorithm,
independent of language, operating system, or hardware. We'll survey a
variety of techniques for designing efficient algorithms.
(Many of these techniques
will help you program correctly even when you're not worried about efficiency.)
We'll even learn how to prove that a given algorithm is ``as good as it
can get,'' in the sense that \emph{no} algorithm, no matter how clever,
will \emph{ever} be better than this one.
\section{Textbook}
This course will involve reading assignments and homework exercises
from the textbook
\emph{The Algorithm Design Manual} by Steven Skiena.
This book is required, and it's the sort of book you'll probably want to
keep to refer to in subsequent courses and software projects.
For any of you who are especially interested in this subject, I recommend
a more advanced book,
\emph{Introduction to Algorithms} by Thomas H. Cormen, Charles E.
Leiserson, Ronald L. Rivest, and Clifford Stein.
I may also give out
other reading assignments by email or in journals.
I hope to cover about two thirds of the textbook this semester,
so you need to read about 10 pages per lecture, on average.
\emph{Make time in your weekly schedule for this!}
\section{Prerequisites}
I assume that everyone in the class has passed CSC-MTH 156 (Discrete
Structures) or an equivalent course covering Boolean logic and algebra,
graphs and trees, and perhaps recurrence relations. I also assume that
everyone in the class has passed one or more programming courses; I
don't care about the language, as long as you have written and debugged
a number of programs and are familiar with the notions of algorithm,
recursion, loop, array, linked list, \emph{etc.}
\section{Grading}
As I write this (the week before classes start), I envision 6
homework assignments, each worth 12.5\% of the semester grade,
a midterm worth 10\%, and a final exam worth 15\%.
If we get behind schedule, we'll
actually do fewer assignments than this;
I'll keep an
up-to-date schedule on my Web page.
% These numeric grades will be converted to letter grades as follows:
% I'll draw a curve showing the distribution of numeric grades, and look
% for naturally-occurring ``clumps''. For each clump, especially the
% top and bottom ones, I'll examine some exam and
% homework papers to decide what letter grade seems appropriate. This
% method corrects for excessively hard or excessively easy assignments
% while not penalizing anybody for having genius classmates.
Exams must be taken at the scheduled time, unless arranged in advance
or prevented by a documented medical or family emergency. If you have
three or more exams scheduled on the same date, or
a religious holiday that conflicts with an exam or assignment due date,
please notify me in writing within the first two
weeks of the semester in order to receive due consideration.
% (and I'd
% prefer it if you let me know earlier --- you should know within the
% first week of class when all your exams are).
Exams not taken without one of
the above excuses will be recorded with a grade of 0.
Homework
assignments will be accepted late, with a penalty of 10\% per 24 hours
or portion thereof after they're due. An hour late is 10\% off, 25
hours late is 20\% off, \emph{etc.} Any homework assignment turned in
more than ten days late will get a zero. Any homework assignment turned
in after May 10 (the last day of class) will get a zero.
(This is so I have, perhaps, time to grade them before the final exam.)
There will be several kinds of homework in this class. At one extreme
are the analysis and ``thought'' problems on paper, resembling problems
in a math class. At the other extreme are programming assignments,
which may be written in any language that you and I both know and that
runs at Adelphi (\emph{e.g.} Scheme, Prolog, Java, C, C++). In between
are pseudocode assignments: these need to be precise descriptions of an
algorithm, like a computer program, but they don't need to meet the
syntactic requirements of a compiler (only a human being will read them)
and you can ignore details that aren't relevant to the problem at hand.
\section{Ethics}
Assignments in this class are to be done either individually or in teams
of two; in the latter case, you \emph{may not do multiple homeworks with
the same partner}. You
may \emph{discuss general approaches} to a problem with classmates, but
you \emph{may not copy} large pieces of programs or homework solutions.
If you do, \emph{all} the students involved will be penalized
(\emph{e.g.} I'll grade the assignment once and divide the points
equally among the several people who turned it in).
All work on an exam must be entirely the work of the one
person whose name is at the top of the page. If I have evidence that
one student copied from another on an exam, \emph{both} students will be
penalized; see above.
\section{Schedule}
This class meets every Monday, Wednesday, and Friday from 9:00-9:50 AM
in Business 204, except on University holidays or if I cancel class.
All dates in the following schedule are tentative, except those fixed
by the University.
%
I expect you to have read the reading assignments
\emph{before} the lecture that deals with that topic; this way I can
concentrate my time on answering questions and clarifying subtle or
difficult points in the textbook, rather than on reading the textbook
to you, which will bore both of us. \textbf{Please read ahead!}
\end{document}
Homework 1: on paper. Something about problems vs. instances.
Analyze timing data for various sorts from 172 last semester;
discuss effect of different factors on time, and predict time for other
combinations of program, computer, and instance size.
A couple of pseudocode exercises from chapter 1.
[Berman & Paul problems:]
1.6-1.8, root-finding by binary search.
1.11, converting digits to numbers
1.12*, Horner eval of p(v) and p(-v)
1.15, converting numbers to digits
1.23-1.26, recurrence relations
1.29, inefficiency of top-down fibonacci algorithm
Homework 2: problems from chap. 2 and sorting.
[Berman & Paul problems:]
2.1-2.4, lists, stacks, and circular queues
2.5-2.15, binary trees
2.16-2.17, combinatorics of binary trees
2.18,2.23, binary search trees
Homework 2: stuff from chapters 3 & 4. Asymptotic notation,
design & analysis of a bunch of sorting algorithms
Homework 3: stuff from chapters 5 & 6. Parallel algorithms & sorting.
Homework 4: chapters 7 & 8. Some proofs, perhaps involving graphs and
graph algorithms
Midterm
Homework 5: chapters 9, 10, 11. Average-case complexity, lower bounds,
parallel prefix algorithms.
Homework 6: chapters 12, 13, 14. Greedy, divide-and-conquer, and
dynamic-programming algorithms.