CS 31: Algorithms, Spring 2020 (The Online Edition)
Course Description and Goals:
Algorithms are stepbystep instructions for a computation problem.
Although this sounds like a cooking recipe, good algorithms is what makes the modern world run.
In this course, we will study algorithms rigorously. At the end of the course, the student should be able to
design algorithms for problems, reason about these algorithms, and communicate the algorithm and its analysis.
Background Assumed:
Students should have basic knowledge about programming and should be able to read and write math proofs.
If you have taken CS 1, CS 10, and CS 30, you should be fine. In case you haven't, then please see the instructor.
See this for what I teach in CS30.
Course Methodology
CS 31, Spring 2020 will be offered online. Almost all information will be available via the Canvas page.
The course will be sortofflipped. We will post material (videos and notes) beforehand, and these will be the primary sources of your knowledge.
On the usual class hours (the 2A hour), we will discuss some predetermined material over zoom, which you will be expected to go through beforehand.
I envision this discussion to be (a) a quick summary from my end, (b) addressing questions and clarifications, and (c) if time permits, perhaps see an application problem pertaining to the material.
A schedule of this will also be posted very soon on the class webpage.
To see you have learnt the material, we will have three types of deliverables.
 Drills. For almost every lecture note, I will have a corresponding drill. These are supposed to be "simple" questions which check if you are following the material you are consuming.
 Coding Assignments. Every week, I will post a coding assignment which will mostly involve you implementing one or two of the algorithms we learn in the course. This will allow you to move from the abstract to the concrete.
 Problem Set. Every week, you will be given two problems to do. Almost always, these will have subproblems. Doing these problems is where the *real* learning will take place.
Apart from this, I will also provide, every week, one advanced problem , bunch of ungraded practice problems , and some creative reductionstyle problems.
These are not for submission, but doing all these is what will make a topnotch algorithmist.
Logistics
Videos and Notes : Canvas (under construction)
Live Class Times : 2A (TR: 2:25pm  4:15pm)
Venue : Zoom (meeting id and password in email)
Discussions : Piazza (via Canvas)
Drills, Coding, PSets : All submissions via Canvas
Personnel :
 Deeparnab Chakrabarty (Instructor)
 Maryam Negahbani (Head TA)
 Anup Joshi (TA)
 Themis Haris (TA)
 Sarah Hong (TA)
 Runze Liu (TA)
 Alex Quill (TA)
 Linda Xiao (TA)
Office hours will be posted on Canvas with Zoom links.
Text Books
There is no required textbook.
However, the material is mostly going to be from the following two books, and I will give pointers to them as well if needed.
 (DPV) Algorithms by Dasgupta, Papadimitriou, Vazirani
 (CLRS) Introduction to Algorithms by Cormen, Leiserson, Rivest, Stein
Students don't have to buy any of the above books. Indeed, if you Google, you may find pdf copies on the web.
You are, however, not allowed to look at or refer to the solutions manuals for these books.
Grading
As you all know, this term every student will be getting a (CT/NC) grade. Below is the distribution of points.
 Drills: 15%
 Coding Assignments: 25%
 Weekly Problem Sets : 30%
 Take Home Test 1 : 15%
 Take Home Test 2 : 15%
If you get more than 60% in the course, you will get an CT.
This is a sufficient condition, not a necessary one.
If you do well in this course, you will get a citation.
More details here. Warning: The grading policies are subject to change.
Tentative Weekly Schedule
Week 
Topics 
Relevant Lecture Notes 
Other Info 
Week 1
(3/31, 4/2)

Introduction, Worst Case Running Time
Number Algorithms

Lec 0
Lec 0 Supplement
Lec 1
Lec 1 Supplement

Coding 0 due (4/4)
PSet 0 due (4/4) 
Week 2 (4/7, 4/9) 
BigOh notation
Divide & Conquer: Merge Sort, Inversions 
Lec 2
Lec 3
Lec 3 Supplement 
Coding 1 due (4/11)
PSet 1 due (4/11)

Week 3 (4/14) 
Divide & Conquer: Max Range Subarray
Divide & Conquer: Polynomial Multiplication 
Lec 4
Lec 4 Supp (Closest Point)

Coding 2 due (4/18)
PSet 2 due (4/18)

Week 4 (4/19, 4/21, 4/23) 
Dynamic Programming: Smart Recursion
Dynamic Programming: Subset Sum + Knapsack 
Lec 5
Lec 6
Lec 7

Coding 3 due (4/26)
PSet 3 due (4/26)

Week 5 (4/28, 4/30) 
Dynamic Programming : String Problems
Dynamic Programming : Wrap up + Graph Algorithms : Intro

Lec 8
Lec 8 supp

Coding 4 due (5/2)
PSet 4 due (5/2)

Test 1 
Syllabus: BigOh, Analyzing Algorithms Divide and Conquer, Dynamic Programming 
May 3, 4 (Sun, Mon) 
~36 hours 
Week 6 (5/5, 5/7) 
Graph Algorithms : Depth First Search
Graph Algorithms : Applications of DFS

Lec 10
Lec 11

Coding 5 due (5/10)

Week 7 (5/12, 5/14) 
Graph Algorithms : Shortest Paths
Graph Algorithms : BFS, Dijkstra, BellmanFord

Lec 12
Lec 13

PSet 5 due (5/17)

Week 8 (5/19, 5/20, 5/21) 
Graph Algorithms : Max Flow, Min Cut, Applications
Graph Algorithms : Flow Algorithms

Lec 14
Lec 15
Lec 15 Supp 1 (Irrational FordFulkerson)
Lec 15 Supp 2 (Faster Flows)
Lec 16
Lec 16 Supp (Hall's Theorem)

Coding 6 due (5/24)
PSet 6 due (5/24)

Week 9 + 10 (5/26, 5/28, 6/2) 
"Extra" Topics : Randomized Algorithms
"Extra" Topics : The Experts Problem
"Extra" Topics : P, NP, and all that jazz.

Lec 17
Lec 18
Lec 19

PSet 7 due (5/31)

Test 2 
Syllabus: Graphs DFS, Shortest Paths, Flows, Cuts 
June 6,7th (Sat, Sun) 
~36 hours 
Policies
Evaluation Policies : Details
 Lateness Policy. You are not allowed to be late. All timestamps will be based on what Canvas says.
However, for coding assignments and weekly psets, you will be given a bonus +1 point if you are more than 24 hours early.
We are aware that sometimes stuff comes in the way, especially during these uncertain times, and that is why we will have *slack* for drills, coding assignments, and weekly psets.
 Slack. There is 15% slack on all deliverables. What this means is that at the end of the course, whatever percentage you obtain in each of these sections, will be multiplied by 100/85, capping at 100%.
So, if you get 90% on the Drills, 85% on the Coding assignmnets, and 80% on the Psets, your final score will be 100% on the drills, 100% on the Coding assignments, and 94.12% on the Psets.
Apart from releasing some stress, this slack also takes care of discrepancies in grading by various TAs.
 Tests. There will be two tests. Ideally, these would be inclass, closedbook, 3 hour tests. But this time, I will make them 2436 hours long, opennotes (but no web), nodiscussion, test.
The extended time does not mean it is going to need this much time; indeed, the test should be doable under 34 hours.
 Focus on learning and fun. I hope that all of you will make the best of this situation and actually learn this beautiful subject.
Please have fun. Algorithms are indeed difficult to master, and the barrage of problems that I provide from my end (although only a few are for credit) may feel stressful.
Please don't be stressed. Algorithms, it is good to remember, are not the most important thing in life.
Regrading Policy
If you feel a grader has not graded accurately, then please contact them via email ccing the head TA (Maryam).
If even after this you feel unsatisfied, then you can email the instructor for a full regrade .
I will look at the entire problem set and regrade it completely. Note: this has to be done within 2 weeks of you being handed the solution.
Also, remember, the slack available though before you exercise regrading.
Zoom Etiquette
I am sure we will all learn various etiquettes on the fly (and I will keep posting them).
But a few standard things.
 Please try to be completely engaged when attending a Zoom lecture or Zoom office hours.
 Please keep your microphone and camera "muted" when not using. I know this tends to decrease engagement, but overall may be a better idea.
 Please be polite and kind to everyone. I am sure we will all make mistakes, and grace is something all of us will need.
Academic Integrity / Honor Code
Algorithms are tough, but fun. And it is even more fun when one works with a friend. I highly recommend forming study groups and watch the videos together, go over notes together, pore over practice problem + solutions together.
And bang heads on the weekly problem set together. This is not only allowed, I highly encourage it. However, the final solution you write, must be your own.
For coding assignments and drills, I recommend working on your own. This will make you understand the concepts better, and make you all better coders.
Only if stuck, contact the teaching personnel or your friend. For instance, if your code is not working, this is the perfect thing to share your screen with a TA and ask them what's wrong.
Or asking your friend, "Hey, how does one convert a string to an integer in Python?" Perfectly OK. But there is a line here which you must make sure you don't cross.
This is important : For all your submissions, you must provide a credit statment even if you have worked alone (in which case, state "Worked alone").
Please write the names of all you have worked with. If this set is empty say so. Not writing a credit statement can give you a zero .
I know many solutions are written at the last minute; spend the first 10 seconds of that minute to
cite people who help you. Good habit.
Finally, some possible honor principle violations to be aware of in this online course offering.
 Sharing the same overleaf, github, replit, etc website for sharing any part of the (drill, coding, weekly pset) assignments. You simply cannot share this.
 Obtaining answers on the Web, and then simply copyandpasting. Especially pertains to coding assignments.
I stress here that since you all will be "socially distant", you will probably using tools like above to brainstorm, etc.
For instance, you may zoom with a classmate about a pset, and then you may obtain (say in a recorded session) some written material from your friend about a weekly pset.
You must not use it as is; everything you write must be your own words.
Simply put, there is a line, and you would know if you are crossing it. Just don't.
Dartmouth's Academic Honor Principle applies to this course. Please be sure to read the principle, which you can
find here .
Please ask me if you have any questions about the honor code as it applies to CS 31. Please, please don't be in a situation where you and I need to go through unpleasantries.