CS 170

Whereas CS 61B was a bare introduction to the theory of computer science, CS 170 is a full exploration of it. The following is a list of lectures and approximately corresponding reading material. All dates and topics are tentative. Lecture notes may be updated, in which case they will be marked clearly. In general, there will be changes as the semester progresses, so check here periodically. Midterm dates may also change.
Topic  Readings  
1  January 21  Overview 
Notes [ps]
[pdf]. CLR Chapters 1, 2, 10.1; or CLRS Chapters 1, 2, 3 and Section 9.1. 
2  January 23  DivideandConquer; Recurrences 
Notes [ps]
[pdf]. CLR Chapters 3 and 4; or CLRS Chapter 4 and Appendix A. 
3  January 28  Graphs and Trees 
Notes [ps]
[pdf]. CLR Sections 5.45.5 and 23.1; or CLRS Section 22.1 and Appendix B.4B.5. 
4  January 30  DepthFirst Search 
Notes [ps]
[pdf]. CLR Section 23.3; or CLRS Sections 22.3. 
February 4  Topological Sorting 
(see notes from previous lecture) CLR Section 23.4; or CLRS Section 22.4. 

5  February 6  Strongly Connected Components 
Notes [ps]
[pdf]. CLR Section 23.5; or CLRS Section 22.5. 
6  February 11  BreadthFirst Search 
Notes [ps]
[pdf]. CLR Section 23.2; or CLRS Section 22.2. 
7  February 13  Shortest Paths: Dijkstra's Algorithm 
Notes [ps]
[pdf]. CLR Sections 25.125.2; or CLRS Sections 24.3 and 24.5. 
February 18  Shortest Paths: BellmanFord 
(see notes from previous lecture) CLR Sections 25.325.4; or CLRS Sections 24.124.2. 

8  February 20  Minimum Spanning Trees 
Notes [ps]
[pdf]. CLR Chapter 24; or CLRS Chapter 23. 
9  February 25  Hashing; Randomization 
Notes [ps]
[pdf].
(updated 2/27) CLR Chapter 6 and Sections 12.13; or CLRS Chapter 5 and Sections 11.13. 
10  February 27  Bloom Filters 
Notes [ps]
[pdf]. 
11  March 4  Randomized MinCut  Notes [ps] [pdf]. 
March 6  Midterm I  
12  March 11  Disjoint Sets; Amortization 
Notes [ps]
[pdf]. CLR Chapter 22; or CLRS Chapter 21. 
13  March 13  Dynamic Programming I 
Notes [ps]
[pdf]. CLR Chapter 16; or CLRS Chapter 15. 
14  March 18  Dynamic Programming II 
Notes [ps]
[pdf]. CLR Section 26.2; or CLRS Section 25.2. 
March 20  Dynamic Programming II 
(see notes from previous lecture) 

March 25  No lecture; spring break  
March 27  No lecture; spring break  
15  April 1  Horn Clauses 
Notes [ps]
[pdf].
(added 3/29) 
16  April 3  Huffman Codes 
Notes [ps]
[pdf]. CLR Section 17.3; or CLRS Section 16.3. 
17  April 8  LempelZiv Codes; Information Theory  Notes [ps] [pdf]. 
April 10  Midterm II  
18  April 15  Optimization; Linear Programming; Simplex 
Notes [ps]
[pdf]. CLRS Sections 29.129.2. 
19  April 17  Network Flows 
Notes [ps]
[pdf]. CLR Sections 27.127.2; or CLRS Sections 26.126.2. 
20  April 22  Matching 
Notes [ps]
[pdf]. CLR Section 27.3; or CLRS Section 26.3. 
21  April 24  NPCompleteness 
Notes [ps]
[pdf]. CLR Sections 36.136.2; or CLRS Sections 34.134.2. 
22  April 29  Satisfiability 
Notes [ps]
[pdf]. CLR Sections 36.336.4; or CLRS Sections 34.334.4. 
23  May 1  Reductions 
Notes [ps]
[pdf]. CLR Section 36.5; or CLRS Section 34.5. 
24  May 6  Approximation Algorithms 
Notes [ps]
[pdf]. CLR Sections 37.137.3; or CLRS Sections 35.135.3. 
May 8  FiniteState Machines; Juggling  No notes. (updated 5/8) You're not responsible for this material. 

May 13  Review 
When  Where  Who  Comments  

101  Fridays 9:0010:00am  3 Evans  Hao Chen  
102  Fridays 10:0011:00am  70 Evans  Hao Chen  
103  Fridays 11:0012:00pm  3 Evans  Rob Johnson  See also here 
104  Fridays 12:001:00pm  6 Evans  Rob Johnson  See also here 
105  Fridays 1:002:00pm  9 Evans  Naveen Sastry  See also here 
106  Fridays 2:003:00pm  70 Evans  Naveen Sastry  See also here 
107  Thursdays 5:006:00pm  405 Soda  Jason Waddle  
108  Thursdays 6:007:00pm  320 Soda  Jason Waddle 
If you have a question, your best option is to post a message to the ucb.class.cs170 newsgroup. The staff (instructor and TAs) will check the newsgroup regularly, and if you use the newsgroup, other students will be able to help you too. When using the newsgroup, please avoid offtopic discussions, and please do not post answers to homework questions before the homework is due.
If your question is personal or not of interest to other students, you may send email to cs170@cory.eecs.berkeley.edu. Email to cs170@cory is forwarded to the instructor and all TAs. We prefer that you use the cs170@cory address, rather than emailing directly the instructor and/or your TA. If you wish to talk with one of us individually, you are welcome to come to our office hours. If the office hours are not convenient, you may make an appointment with any of us by email. There are about 50 of you to every one of us, so please reserve email for the questions you can't get answered in office hours, in discussion sections, or through the newsgroup.
The instructor and TAs will post announcements, clarifications, hints, etc. to this website and to the class newsgroup. Hence you should read the newsgroup regularly whether you post questions to it or not. If you've never done this before, there is online information about how to access UCB newsgroups (see also here for more).
In a class this large, it can be challenging for the instructor to gauge how smoothly the class is going. We always welcome any feedback on what we could be doing better. If you would like to send anonymous comments or criticisms, please feel free to use an anonymous remailer to send us email without revealing your identity, like this one.
Prof. David Wagner
Wed 10:3012pm, Thu 12pm
in 765 Soda, and by appointment.
daw@cs


All enrollment is handled by the CS office in 390 Soda. The prerequisites for CS 170 are CS 61B and one of Mathematics 55 or CS 70. If you have not satisfied all prerequisites, but you have taken a course you feel is very similar to CS 61B or Math 55, or if you are on a wait list, fill out an appeal form and turn it in to 390 Soda Hall by Friday, Jan 24th at 5pm. The instructor does not handle appeals, so please do not attempt to lobby him for admission to the course. The department has a FAQ on enrollment, and further information is available as well.
If you are something other than a regular Berkeley undergraduate, then you probably need a signature on a form admitting you to the course. We cannot promise to admit those of you who are not regular Berkeley students. In particular, we will not sign any concurrent enrollment or UC Extension forms until after the second week of classes.
You should be comfortable with mathematical induction, bigO notation, sorting algorithms, basic data structures, and binary heaps. In particular, if you are a transfer student and have not obtained a thorough understanding of binary heaps from CS 61B or a similar course, you should read Chapter 7 of CLR (Chapter 6 of CLRS) in preparation for this course.
You will be required to do a programming exercise in this course. You should have prior experience with C, C++, Java, Scheme, or some other comparable programming language.
If you are not familiar with the Unix operating system and basic tools, it is important that you learn. Some student groups, including CSUA, teach help sessions on Unix. See the CSUA Web pages.
CS and EECS majors should already have named accounts for the lab machines from Instructional Facilities. Lab machines may be found in 2nd floor Soda. If you do not already have an instructional account, go to a Unix machine in 273 Soda and login as 'newacct' (password: 'newacct'). You should receive a 'named' account. You can also read the online instructions. You'll need this for the programming assignment, so don't wait till the last minute.
In addition to the lectures, you should attend a discussion section for one hour each week. The discussions sections are not mandatory, and nothing done in section will directly affect your grade. On the other hand, the discussion sections are your best opportunity to ask questions and learn interactively, and some examples worked out in section will be helpful on the graded assignments. Your section TA will also return and discuss your homeworks and midterms.
Make sure that you are enrolled in a discussion section that has space for you. To find a section that has space, see the online class schedule for discussion section enrollment levels. You may attend a section other than that for which you are registered only if the TA of the section you are attending agrees to it. Outside of your discussion section, you should feel free to attend any of the staff office hours (not just your section TA's) and ask any of us for help.
A problem set is handed out each Tuesday and is due at 3:30 p.m. on the following Tuesday. Most homeworks require mathematical problem solving (algorithm design and analysis), but there is likely to be at least one programming assignment. You should turn in your problem sets in 283 Soda; there is a drop box for CS 170 that will be emptied at 3:30 p.m. every Tuesday. Late homeworks are not accepted.
Everything you turn in must be written legibly and contain your name, your discussion section number, the homework number, and "CS 170Spring 2003". You might receive no credit for assignments that are turned in without this information. We do not attempt to grade messy and unreadable solutions. If a problem can be interpreted in more than one way, clearly state the assumptions under which you solve the problem.
In writing up your homework you are allowed to consult any book, paper, or published material. If you do so, you are required to cite the complete bibliographical data of your source(s). Simply copying a proof is not sufficient; you are expected to write it up in your own words, and you must be able to explain it if you are asked to do so. Your proofs may refer to previous course material and to previous homeworks. Except for this, all results you use must be proved explicitly.
You are allowedeven encouragedto form
Our goal is to get across a maximum amount of understanding in a minimum amount of time. Since you have other courses, we will try to monitor the time you spend on this course. It is easy, however, to misjudge the time required to solve a problem, so we ask you to indicate with each problem set how much time you spent completing the assignment. This is optional, and will not affect your grade. Roughly, you are expected to spend one hour reading and two hours problem solving for every hour of lecture.
Model solutions to the problem sets are handed out and discussed during the discussion sections in the week after a homework is due. The graded problem sets are returned at the same time. Graded problem sets that are not picked up in the discussion section will be kept by your section TA.
It is extremely important that you continuously stay on top of the material, because every new topic and every new homework builds on previous results. If you don't understand the material at the beginning, it will be difficult to catch up later. If you encounter problems, you are encouraged to talk to the course staff as soon as possible. Please do not wait until the last moment to do your homeworkstart thinking about the problems on the day they are handed out!
There will be two inclass midterm exams during the normal lecture time. They have not yet been scheduled. The final exam will take place during the regularly scheduled exam period on May 23 from 12:30 to 3:30 p.m. You must be in town for the final exam to receive a grade different from F for the class.
The midterms will be cumulative, but they will concentrate on new material. The final exam will be comprehensive.
If you miss the final exam, you will receive a grade of F in the class unless you miss it because of a circumstance beyond your control, documented by a physician or equivalent authority, or if it conflicts with another scheduled University of California exam. If we decide to forgive your missing the final exam, you will receive an Incomplete grade and have the opportunity to make it up when we choose to give you an alternate exam, quite possibly at the end of the following semester. A course grade of Incomplete will be granted only for dire medical or personal emergencies that cause you to miss the final, and only if your work up to that point has been satisfactory.
If you miss a midterm, you risk receiving a 0 on that midterm, unless you miss it because of a circumstance beyond your control or unless you gain permission in advance from the instructor. (If anyone misses a midterm, we may decide at our discretion whether to give a zero, or a percentage score based on the final exam, on that midterm.) There will be no makeup midterms.
Your final grade will be based on the weighted average of your problem set, midterm, and final exam scores. Your lowest two homework scores will be dropped. Assignments that you do not turn in will receive a zero; thus, you may skip handing in two homeworks, and then these homeworks will be the two dropped. As stated above, the homework will count for 40% of the final grade, the two midterms will each count for 15%, and the final exam will count for 30%.
We will give no credit for written homework turned in after the deadline, so that we can make online solutions available promptly and so that you can discuss those solutions in your discussion sections. Please do not ask for extensions for homework, even in case of emergencies; excuses for late or missed homeworks will not be accepted. The two lowest homework grades are dropped, so you can safely miss two. However, the material in this class can only be learned by doing lots of problems, so the homework is very important.
If you believe we have misgraded a homework or midterm exam question, return it to your section TA with a written note on a separate piece of paper explaining the problem. If you're requesting regrade, please staple this paper to the front of the homework or exam. The entire homework or exam will be regraded, so be sure to check the solutions to confirm that your final grade will go up after regrading. All requests for regrades and recording corrections must be made within one week after you receive the graded assignment or exam. By University policy, final exams must not be regraded.
Because of the difficulty of evaluating students in a course where much of the homework is based on proofs, the grading scale (conversion of scores to letter grades) will not be established until the end of the semester.
The work you submit in this course must be the result of your individual effort. Penalties for cheating on a homework will be assigned at our discretion, but likely will earn you an F in the class. The penalty for cheating on an exam will be receiving an F in the class (at the least). All incidents of cheating will be reported to the Office of Student Conduct, who will maintain records of your academic misconduct throughout your undergraduate career.
For homework assignments, you are allowed to work in small groups. However, there are several guidelines you must follow. You may discuss the problems within your group. However, you must write up the solution entirely on your own. In no case should you share any part of your writeup with anyone else, nor should you read nor possess any part of anyone else's writeup at any time. The written solution you hand in must list at the top the names of everyone in your group; this will not affect your grade, but it must not be omitted.
We believe that most students can distinguish between helping other students and cheating. Explaining the meaning of a question, discussing a way of approaching a solution, or collaboratively exploring how to solve a problem within your group is an interaction that we encourage. On the other hand, you should never read another student's solution or partial solution, nor have it in your possession, either electronically or on paper. You should write your homework solution strictly by yourself. You must explicitly acknowledge everyone who you have worked with or who has given you any significant ideas about the homework. Not only is this good scholarly conduct, it also protects you from accusations of theft of your colleagues' ideas.
Presenting another person's work as your own constitutes cheating, whether that person is a friend, an unknown student in this class or a previous semester's class, a solution set from a previous semester of this course, or an anonymous person on the Web who happens to have solved the problem you've been asked to solve. Everything you turn in must be your own doing, and it is your responsibility to make it clear to the graders that it really is your own work. The following activities are specifically forbidden in all graded course work:
In our experience, nobody begins the semester with the intention of cheating. Students who cheat do so because they fall behind gradually and then panic. Some students get into this situation because they are afraid of an unpleasant conversation with a professor if they admit to not understanding something. We would much rather deal with your misunderstanding early than deal with its consequences later. Even if you are convinced that you are the only person in the class that doesn't understand the material, and that it is entirely your fault for having fallen behind, please overcome your feeling of guilt and ask for help as soon as you need it. Remember that the other students in the class are working under similar constraintsthey are taking multiple classes and are often holding down outside employment. Don't hesitate to ask us for helphelping you learn the material is what we're paid to do, after all!
Mail inquiries to
cs170@cory.eecs.berkeley.edu.
Last modified by daw on January 19, 2003.