CS:3330 Algorithms, Section 0002 Spring 2018

Section 0002: 12:30-1:45 TTh Room 110 MLH (MacLean Hall)

Instructor:
Sriram V. Pemmaraju
Office: 101G MLH, sriram-pemmaraju@uiowa.edu, 319-353-2956
Office Hours: 1:30-2:30 M, 10:30-11:30 W, 2:00-3:00 F (and by appointment)

Course website: http://www.cs.uiowa.edu/~sriram/3330/spring18/
Department website: http://www.cs.uiowa.edu/

Algorithms are "recipes" for solving computational problems and have been around at least since 300 BCE when Euclid described an algorithm for computing the greatest common divisor of a given pair of numbers. Now algorithms are viewed as the greatest contribution of the field of computer science to every day life. Algorithms are used wherever computers are; search engines, weather prediction, drug design, financial markets, supply-chain management and even "JEOPARDY!" are just a few examples from among many. Previous courses have already given you a taste of "algorithmic thinking" and the main aims of this course are to (i) deepen your algorithmic intuition, (ii) help you build a toolbox of algorithmic design and analysis techniques, and (iii) to develop the ability to effectively communicate algorithms.

In this course, we will practise the precise statement of various computational problems, think about different algorithmic strategies to solve them -- either exactly or with some controlled error, reason about their correctness, evaluate these algorithms from the point of view of efficiency (usually running time) and accuracy, and develop a feel for the difficulty of problems and the applicability of various techniques we will learn.

We will organize the course in terms of the following topics:

1. Introduction to algorithms and algorithm analysis
2. Numerical algorithms
3. Introduction to randomized algorithms
4. The Divide-and-Conquer paradigm
5. Graph traversal and decomposition
6. Shortest path problems
7. Greedy algorithms
8. Dynamic programming.
9. Computational intractability
A more detailed description of each of these topics is provided further below in this syllabus.

In recognition of the fundamental role that the design and analysis of algorithms plays in computer science, more and more employers have started to ask algorithmic questions in job interviews. Students with a good understanding of the material in this course invariably do well in these job interviews. This is an additional incentive to make a serious attempt to be successful in this course.

Reading Material As the main source of material, we will use the following textbook: Algorithms by Sanjoy Dasgupta, Christos Papadimitriou, and Umesh Vazirani, McGraw Hill, ISBN-13: 978-0073523408. We might occasionally dip into material from the following textbooks, but you don't need to own either of these.

• Algorithm Design by Jon Kleinberg and Eva Tardos. (ISBN-13: 978-0321295354)
• Introduction to Algorithms by Thomas Cormen, Charles Leiserson, Ronald Rivest, and Clifford Stein. (ISBN-13: 978-0262033848)

Prerequisite
CS:2210 (Discrete Structures) and CS:2230 (Computer Science II: Data structures) and either MATH: 1550 (Engineering Math I Single Variable Calculus) or MATH: 1850 (Calculus I).

Teaching Assistants
Two seniors, Wes Weirather and Junbin Ma will be the Teaching Assistants for the course. They will grade homeworks, provide feedback and will hold office hours for homework help. Details regarding their office hours will be posted on the course webpage soon.

Plus/Minus grading will be used for the course. Based on performance in my most recent offerings of CS:3330, I have decided to use the following ranges for letter grades. Note that I will not be assigning D-'s.

```[88, 100] A
[83, 88) A-
[78, 83) B+
[73, 78) B
[68, 73) B-
[63, 68) C+
[58, 63) C
[52, 58) C-
[45, 52) D
[0, 45) F
```
There are three components of evaluation that will collectively determine your grade.
• Homeworks 40% You will be assigned 10 homeworks over the course of the semester and you will have about a week to complete each homework. Some of the homeork problems will involve programming. You can use your favorite high-level programming language (e.g., Python, Java, C++, Scala, etc.) to solve programming problems.

• Quizzes 10% There will be 5 in-class quizzes, possibly unannounced. Each quiz will be 5-10 mins long and will serve as a way to test your expertise on a specific topic

• Exams 50% There will be two mid-terms exams and one final exam. Each mid-term exam will be worth 15% of your grade and the final will be worth 20%, for a total of 50%. The time and place for the mid-term exams are as follows:
```Mid-term exam 1 	Tue Feb 20th, 6:30-8:30 pm 	Room: W128 CB (Chemistry Building)
Mid-term exam 2 	Tue April 3rd, 6:30-8:30 pm 	Room: W128 CB (Chemistry Building)
```
The final is also two hours long. The final will take place during the week of May 7th and the exact date and time of the final exam will be announced in March on the course website. The final exam date and time will also be announced by the Registrar via email using your uiowa address generally within the first several weeks of the semester. All exams will be open notes/books exams.

With the exception of programming problems, your solutions to homeworks will have to be handed in during class. Your solutions to programming problems will have to submitted via ICON's dropbox feature. Our solutions to homeworks will also be published on ICON. Homeworks, quizzes, and exams will be regularly posted on the course page (http://www.cs.uiowa.edu/~sriram/3330/spring18/) and all together these will form a significant study resource for students.

Tardiness and Absences
Late submissions will not be accepted and make-up exams should not be expected. To get credit for assignments you should plan on turning in what you have on time. Having said this, it is also worth noting that this course will follow the University and College of Liberal Arts and Sciences (CLAS) policies that require that students be allowed to make up missed examinations and assignments due to illness, certain University activities, circumstances beyond a student's control (such as a death in the family), or mandatory religious obligations. See http://clas.uiowa.edu/students/handbook/attendance-absences for more details on this policy. Attendance will not be marked, however there is a strong correlation between attendance and performance in the course. For most students, to be successful in this course will at the minimum require consistent attendance.

The key to completing homeworks on time is starting early and asking questions. The instructors and the TAs will be glad to help with any questions you may have on homeworks, either by e-mail or in person. So please feel free to visit us often during our office hours and if necessary, outside our office hours as well by making an appointment.

Communicating with Instructors and TAs

Effort Level
According to University guidelines, a student should expect to work for 2 hours per week (outside the classroom) for each course credit. This is a 3 credit course and so you should expect to spend on average about 6 hours per week studying lecture notes and the textbook, solving homeworks, preparing for exams, etc. However, the "6 hours per week" estimate is an average and it also presupposes that you attend classes regularly, pay attention in class, visit the professor and the TA with your questions during their office hours, etc.

Course Home
This course is run by the Computer Science department which is part of the College of Liberal Arts and Sciences. This means that class policies on matters such as requirements, grading, and sanctions for academic dishonesty are governed by the College of Liberal Arts and Sciences. Students wishing to add or drop this course after the official deadline must receive the approval of the Dean of the College of Liberal Arts and Sciences. Details of the University policy of cross enrollments may be found online at http://www.uiowa.edu/~provost/deos/crossenroll.doc.

Students with disabilities
We would like to hear from anyone who has a disability which may require seating modifications or testing accommodations or accommodations of other class requirements, so that appropriate arrangements may be made. Please contact the instructor by e-mail or in person during office hours. For more information visit the website of Student Disability Services at http://sds.studentlife.uiowa.edu/.

The components of evaluation for this course (quizzes, homeworks, and exams) are meant to test your individual mastery of the material. Hence none of these are collaborative and under no circumstances should you pass off the work of someone else as your own. Doing so would constitute academic dishonesty. This also applies to code or other material that you might find on the internet. Providing answers to another student also constitutes academic dishonesty. Note that we will routinely use available software systems for detecting software plagiarism, to test any suspicions we might have.

We do want students to talk to each other about concepts and ideas that relate to the class. We believe that this type of peer-interaction can be quite helpful to students. However, this interaction needs to happen without actual exchange of written answers (e.g., code or pseudocode snippets) to homeworks. Of course, students are welcome (in fact, encouraged) to study together for exams.

If you are unclear about what constitutes academic dishonesty contact the instructor or consult the CLAS Code of Academic Honesty at http://clas.uiowa.edu/students/handbook/academic-fraud-honor-code.

Student Complaints
If you have any complaints or concerns about how the course is being conducted please feel free to talk to the instrutors. You are also welcome to get in touch with Prof. Alberto Segre, the Computer Science department chair (alberto-segre@uiowa.edu, 319-335-1713, 14D MacLean Hall). Consult the CLAS statement on Student Rights and Responsibilities at http://clas.uiowa.edu/students/handbook/student-rights-responsibilities for more information.

Classroom Etiquette
Showing up to class late, leaving your cell phone ringer on, reading a newspaper in class, chatting with your friends, etc., can be quite distracting to the professor and to fellow students. If you are in class, it is your responsibility to pay attention and to make sure that you are not doing anything that makes it harder for fellow-students to pay attention. When disruptive activity occurs, a University instructor has the authority to determine classroom seating patterns and to request that a student exit immediately for the remainder of the period. One-day suspensions are reported to appropriate departmental, collegiate, and Student Services personnel (Office of the Vice President for Student Services and Dean of Students). For more information consult the CLAS statement on Student Rights and Responsibilities at http://clas.uiowa.edu/students/handbook/student-rights-responsibilities.

University Statement on Sexual Harassment
Sexual harassment subverts the mission of the University and threatens the well-being of students, faculty, and staff. All members of the UI community have a responsibility to uphold this mission and to contribute to a safe environment that enhances learning. Incidents of sexual harassment should be reported immediately. See the UI policy on sexual harassment at http://www.uiowa.edu/~our/opmanual/ii/04.htm for assistance, definitions, and the full University policy. Also see http://www.sexualharassment.uiowa.edu/ for additional resources.

Reacting Safely to Severe Weather
In severe weather, class members should seek appropriate shelter immediately, leaving the classroom if necessary. The class will continue if possible when the event is over. For more information on Hawk Alert and the siren warning system, visit the Public Safety web site at http://police.uiowa.edu/stay-informed/emergency-communication/.

Detailed List of Topics

• Introduction to algorithms
Computing modulo Fibonacci numbers, recursive functions, recurrence relations, introduction to running time analysis, the notion of input size, the notion of basic operations, efficiency of algorithms, asymptotic growth of functions, the "Big Oh", Omega, and Theta notation for asymptotic growth, properties of asymptotic growth notation, examples of common running times: logarithmic, polynomial, exponential running times, solving recurrence relations by unrolling them.
• Numerical Algorithms
Computing powers efficiently by repeated squaring, modular arithmetic, primality testing, introduction to randomized algorithms, Monte Carlo algorithms and Las Vegas algorithms, hashing and randomized hash functions.
• The Divide-and-Conquer paradigm
The Merge Sort algorithm, writing and solving the recurrence for the running time of Merge Sort, the recursion tree method for solving recurrences, the Integer Multiplication problem, improving over the grade-school multiplication algorithm using Karatsuba's algorithm, the Master Method for solving recurrences, randomized selection and the probabilistic recurrences.
• Graph Traversal and Decomposition
The Depth-first search (DFS) and its analysis, Using DFS to find connected components, strongly connected components, biconnected components.
• The minimum spanning tree problem
The Minimum Spanning Tree (MST) problem, Prim's algorithm and Kruskal's algorithm for MST, implementation of Prim's algorithm in O((|V| + |E|) log |V|) time, implementation of Kruskal's algorithm using the Disjoint Set Union-Find data structure, example of amortized analysis: find in worst case O(1) time, union in O(log |V|) amortized time, an alternate implementation of the Disjoint Set Union-Find data structure with find in worst case O(log |V|) time and union in worst case O(1) time.
• Other Greedy Algorithms
Finding optimal prefix-free codes for lossless compression and Huffman' greedy encoding algorithm, Greedy approximation algorithm for Set Cover, a quick tour of approximation algorithms.
• Shortest path problems
Dijkstra's shortest path algorithm for the Single Source Shortest Path (SSSP) problem, implementation of Dijkstra's algorithm in O((|V| + |E|) log |V|) time using the min-heap data structure, Negative edge-weights and the Bellman-Ford algorithm.
• Introduction to Dynamic Programming
Why plain recursion is a bad idea for some problems, the idea of memoization, 1-dimensional dynamic programming: the Longest Increasing Subsequence problem, 2-dimensional dynamic programming: the Edit Distance problem, the Knapsack problem, the Maximum Independent Set problem in trees.
• Computational Intractability
Decisions problems, the class P and the class NP, examples of problems in NP that are not known to be in P: Minimum Vertex Cover (MVC), Maximum Independent Set, Maximum Clique, SAT, 3SAT, Hamiltonian Cycle and Travelling Salesman Problem (TSP), polynomial-time reductions, the classes NP-hard and NP-complete, the Cook-Levin Theorem: CircuitSAT is NP-complete, NP-completeness of 3SAT and a bunch of other problems.