EECS 3101Z, Winter 2020
EECS 3101Z: Design and Analysis of Algorithms
Web page contents:
Instructor: Eric Ruppert
Office: Room 1003H of the Lassonde Building (enter through Lassonde 1012 hallway)
Telephone: (416) 736-2100 ext. 33993
Lectures: Mondays and Wednesdays, 14:30-16:00 online (starting Mar 16)
Tutorials: Fridays, 14:30-16:00 online (starting Mar 20)
Email: [my last name]@cse.yorku.ca (Please use a York email account when sending me email, and start your subject line with "".)
Professor's Office Hours:
Wednesdays 10:00-11:00 and Fridays 16:00-17:00 online, or by appointment
In this course, you will be invited to develop your ability to think clearly and carefully about algorithms, and to improve your skills in expressing those thoughts about algorithms in a precise way.
Algorithms lie at the heart of computer science; in fact, some would say that computer science is the study of algorithms, so this course plays a central role in your education as a computer scientist.
By the end of this course, you will be able to do the following things.
Choose an appropriate algorithm to solve a given computational problem, and justify that choice
The first step in studying algorithms is to become familiar with a number of standard algorithms that can be applied in a wide variety of contexts. Then, you will be able to recognize when they can be applied. This sometimes requires finding the underlying structure of the problem, and seeing exactly what properties a solution to the problem must have.
Design new algorithms using a variety of techniques (recursion, greedy algorithm, dynamic programming, backtracking)
The next level of studying algorithms is to design your own novel algorithms. Sometimes this can be done by plugging together existing algorithms like modules. In other cases it requires more originality, but you will learn several algorithmic techniques that can be applied to design algorithms for a wide variety of problems.
Prove correctness of an algorithm using pre- and post-conditions and loop invariants
Once you have an algorithm to solve a problem, you want to be sure that it does produce the correct solution. The process of proving it correct helps you find mistakes in the design of the algorithm. Once those bugs are fixed, you can then go on to prove correctness to convince yourself and others that the algorithm is correct.
Prove bounds on the running time or space used by an algorithm
If there are several different algorithms that can be used to solve a problem, we typically want to choose the one that will run in a reasonable amount of time or space. Proving bounds on the resources used by an algorithm allows you to make this choice, and to justify your choice to others.
Apply standard graph algorithms to a variety of problems
Graphs can be used to model a very wide variety of problems from many areas of computer science, so a few standard algorithms for graphs should be part of the toolbox of algorithms that you know about. Sometimes applying one of these graph algorithms requires some ingenuity to look at the problem in the right way to recognize how it can be applied.
How to Learn This Material
Some of the skills that you will develop in this course may be quite new to you, and different from things you have done in previous courses. This is good: it means you're learning new and (I hope) exciting things. However, it means that you will need practice to master them. Just participating in classes isn't enough. There are suggested exercises from the textbook. Web pages for this course in previous terms also include many more problems to work on. The books listed below under "Additional Resources" include more exercises. Do lots.
You learn by struggling with problems. However, if you get too stuck or don't know how to begin, help is available. Talk to your classmates (however; see the notes below about academic honesty regarding discussing assignment problems with others). Go to office hours; the instructor and TA are there to help you! You also learn by making mistakes and getting feedback about them. Just make sure that you use the feedback to improve your understanding.
Groups of students can learn a lot by explaining their solutions to the suggested exercises from the textbook to one another and critiquing the solutions of others. After all, learning how to explain solutions clearly is one of the learning objectives of this course. Seeing where other students' solutions are unclear to you helps you make your own explanations clearer. Be aware that a problem may have many different correct solutions; just because someone's solution is different from yours doesn't necessarily mean that one of them is wrong.
It takes time to build new skills, so it helps if you work on exercises regularly: don't leave all the work to the days right before a test.
The key to academic honesty for this course is simply this: Solutions that you submit should be your own work.
Although you may discuss the general approach to solving a homework problem
with other people, you should not discuss the solution in detail.
You must not take any written notes away from such a discussion.
Also, you must list on the cover page of your solutions any
people with whom you have discussed the problems.
The solutions you hand in should be your own work. While
writing them, you may look at the course textbook and your own
lecture notes but no other outside sources.
It is not acceptable to try to find the answer to a homework question on the web, put it in your own words and submit it. You may learn a little by doing this, but you will learn much, much more by working on the problem yourself, and the purpose of this course is to help you learn how to design and analyze algorithms on your own.
Furthermore, the web will not be available during your exam (or during your job interview at Google), so you should learn to solve problems yourself, instead of relying on others to do your thinking for you.
As time runs out, students are sometimes tempted to get help from other students on assignments in a way that would violate the preceding policy on academic honesty. DO NOT DO THIS! If you do, I will refer the case to the Dean's Office, which will be very unpleasant for you. The assignments are worth very little, so it is not worth risking a sizable punishment. (Furthermore, I have noticed that the students who cheat on the homework assignments almost always fail the tests and exams, so even if I do not catch you cheating, you will likely fail the course if you do not do your own work on the homework assignments.)
It is important that you look at the departmental
on academic honesty.
|Homework exercises || 15% |
|Test #1 || 22.5% |
|Test #2 || 22.5% |
|Exam || 40% |
It's a very good idea to type your solutions to homework assignments, since it allows you to edit and polish the answers, but handwritten solutions are also acceptable, as long as they are legible. If you want to type your solutions, LaTeX produces elegantly typeset documents, is available for free, and was built to handle even the most complicated mathematical notation. It can take a while to learn how to use it, but once you do, you will probably not want to type documents any other way.
You should make every effort to make your answers as brief as possible, while still being thorough. Brevity requires careful thought and editing. (Pascal once excused himself for writing a long letter, saying that he did not have enough time to write a shorter one.) Students who write copious amounts usually do not know what they want to say, or are saying it in a very disorganized way.
Usually, an answer to a homework question should fit on one sheet of paper. If you are writing much more than that, you probably have not found the best way to solve it. On tests, your answer should usually fit into the space provided for it.
- (Apr 8) See course moodle page for pre-exam exercises. Two questions on the exam will be related to these exercises.
- (Apr 6) Grades for Assignments 7-9 and Test 2 are now posted. Log into red.eecs.yorku.ca and use "courseInfo 3101Z" to see your grades, including feedback for Assignment 8,9 and Test 2. Your Test 2 paper was emailed to your my.yorku.ca account on April 6. Assignment 10 is still being marked.
- (Mar 29) Clarification: For assignment 10, each course is one term long.
- (Mar 23) Course evaluations are open from today until April 6. I find the information in them useful, so please fill them out for EECS3101 (and all your courses) at this link. As a bonus, if at least 80% of the class fills out the evaluation of this course, I will drop each student's lowest two assignment grades when computing final marks. (I cannot see who fills out the evaluation, but I can see how many have done so.)
- (Mar 16) You should assume for Assignment 8, Question 2 that failures of communication links are independent. (That is, the failure of one communication link does not affect the probability of another communication link failing.)
- (Mar 16) This page will remain the main source of information about the course, but I have also created a moodle site for the course. The moodle site will include records of classes held during the disruption.
- (Mar 15) There is a typo in Question 1(b) of Assignment 8. EXTRACTMAX should be EXTRACTMIN.
- (Mar 14) The remaining classes of the term will be held online. Please see this link for information about how this will be done for EECS3101Z.
- (Mar 14) The solutions I handed out for Test 2 had an error in Question 3b: the entries should be computed for i = 1..n, not i=n downto 1.
- (Mar 12) You can check the grades that I have recorded for you so far by logging into a departmental machine and typing the command "courseInfo 3101Z". (To do this from home, just ssh into red.cs.yorku.ca.)
- (Mar 12) Reminder: you may bring one 8.5-by-11-inch sheet of paper with handwritten notes on one side to Test #2.
- (Mar 2) As discussed in class last week, my office hours have shifted (instead of Mondays at 4pm, I will have one on Fridays at 4pm.) Also, for this week only, my office hour on Wed, Mar 4 will be at 11:00 instead of 10:00.
- (Feb 10) My office hours for Wednesday, Feb 12 (only) are changed to 13:00-14:00 (in LAS 1003H).
- (Feb 5) The deadline for assignment is moved to 2:30p.m. on Monday, Feb 10.
- (Jan 29) The class on Friday will be more of a lecture and one of the classes next week will be more of a tutorial (for you to ask questions prior to test 1). Test 1 will focus on material covered up to (and including) the Jan 31 class. You may bring an 8.5-by-11-inch page of handwritten notes (written on one side only) to Test 1.
- (Jan 22) If you want to read about the latest development in algorithms to multiply numbers, see this link.
|First class ||Monday, January 6|
|Test 1 ||Friday, February 7|
|Reading week (no classes)|| February 17-21 |
|Last date to drop course without receiving a grade||Friday, March 13|
|Test 2 ||Friday, March 13|
|Last class || Friday, April 3|
|Last date to withdraw from course (receiving W on transcript)||Sunday, April 5|
|Exam period ||April 7-25|
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and
Clifford Stein, Introduction to Algorithms, 3rd edition,
MIT Press & McGraw-Hill, 2009. For solutions to some of the textbook's exercises and known bugs in the text, see the textbook's web page.
Copies of the text are on reserve at the Steacie Library. You can also access an electronic version of the textbook through the York Library website.
Optional Supplementary Reading
- Jeff Edmonds, How to Think About Algorithms, Cambridge University Press, 2008.
- Ian Parberry's book, Problems on Algorithms,
has lots of practice problems for many topics covered in this
course. Solutions to selected problems are also given. The book is
available online; the author asks that you make a small donation to
charity if you choose to download the book. Follow
to access the book.
- Sanjoy Dasgupta, Christos Papadimitriou and Umesh Vazirani, Algorithms, McGraw Hill, 2008. This is a really nice little book.
- Michael R. Garey, and David S. Johnson, Computers and
Intractability: A Guide to the Theory of NP-Completeness,
W. H. Freeman and Company, 1979.
- Ronald L. Graham, Donald E. Knuth, and Oren Patashnik, Concrete
Mathematics: A Foundation for Computer Science (2nd edition),
- Jon Kleinberg and Éva Tardos, Algorithm Design, Pearson, 2006.
- Donald E. Knuth, The Art of Computer Programming (3rd edition),
Volume 1: Fundamental Algorithms, Addison-Wesley, 1997.
Sections 1.1 and 1.2 are a good reference for the material covered
during the first few weeks of the course.
TAOCP also has lots of good exercises with solutions.
- Donald E. Knuth, The Art of Computer Programming (2nd edition),
Volume 3: Sorting and Searching, Addison-Wesley, 1998.
- Anany Levitin, Introduction to the Design and Analysis of
Algorithms (3rd edition), Pearson, 2012.
- Steven S. Skiena, The Algorithm Design Manual (2nd edition), Springer, 2008.
- Steven S. Skiena and Miguel A. Revilla, Programming Challenges: The Programming Contest Training Manual, Springer, 2002. This book covers many topics of the course from a more problem-oriented angle.
- Daniel Solow, How to Read and Do Proofs (6th edition), Wiley, 2013.
- Michael Soltys, An Introduction to the Analysis of Algorithms, World Scientific, 2010.
This section will be filled in as the term progresses.
Don't fall behind with your reading.
|Date||Topics ||Reading in CLRS (3rd ed) ||Suggested questions, mostly from CLRS (3rd ed)|
| January 6
|| 1; optional supplementary reading: Boyer-Moore algorithm
| January 8
|| Background math
|| Chapter 3 and this document
|| Review questions
and 3.1-1 to 3.1-6, 3.2-2, 3.2-7, 3-3(a), 3-4(a to d); see also chapter 2 and 3 of Parberry's book
| January 10-15
|| Proving correctness of loops
|| 2.1, 2.2, 31.2 (up to Lame's Theorem)
|| 2.1-3, 2.1-4, 2.2-2, 2-2, 2-3; see also chapter 5.1 of Parberry's book; 31.2-4, 31.2-8
| January 15-20
|| Proving correctness of recursive algorithms, divide and conquer
|| 2.3, 4.0-4.1, 4.3-4.4, time bound for fast multiplication
|| 2-1, 2.3-3, 2.3-4, 2.3-6, 2.3-7,
4.1-1, 4.1-5, 4.3-1, 4.3-6, 4.4-2; see also chapter 4, 5.2, 7 of Parberry's book
| January 22
|| Selecting kth smallest element from unsorted array
|| 9.1, 9.3 (and skim 9.2)
|| 9.1-1, 9.3-1, 9.3-5, 9.3-6, 9.3-7, 9.3-8, 9-1
| January 24
|| More divide and conquer examples, analysing running time of recursive algorithms
|| 4.2, 4.5, (skim 4.6), 33.4
|| 4.2-3, 4.2-7, 4.5-1, 4.5-4, 4-1, 4-2, 33.4-1, 33.4-6
| January 27
|| pages 147-189 (a lot of this will be a review)
|| 6.1-1 to 6.1-7, 6.2-3, 6.2-6, 6.4-2, 6.4-3, 6.4-4, 6.5-4, 6.5-5, 6.5-8, 6-2,
7.2-4, 7.3-1, 7-1, 7-2
| January 29-31
|| Sorting lower bound and sorting in linear time
|| All of chapter 8
|| 8.1-1, 8.2-4, 8.3-1, 8.3-2, 8.3-3, 8.3-4, 8.4-4, 8-4
| February 10
|| Dynamic programming
|| All of chapter 15
|| 15.1-1 to 15.1-5, 15.2-2, 15.2-6, 15.3-2 to 15.3-6, 15.4-2, 15.4-5, 15-2, 15-5, 15-6, 15-9, 15-10, 15-11
| February 26
|| Greedy algorithms
|| 16.1, 16.2, 16.3
|| 16.1-2, 16.1-3, 16.1-4, 16.2-1, 16.2-3, 16.2-5, 16.2-7, 16.3-1, 16.3-3, 16.3-4, 16.3-7, 16.3-9, 16-1(d), 16-2, 16-4(a), 16-5(a,c)
| March 4
|| Greedy MST algorithms
|| 23, 21.1-21.2 (for implementation of Prim's algorithm)
|| 23.1-1, 23.1-4, 23.1-6, 23.1-7, 23.2-2, 23.2-4, 23.2-5, 23.2-8, 23-4, 21.1-3, 21.2-2, 21.2-5, 21.2-6,
| March 16
|| Dijkstra's Algorithm
|| 24.0, 24.3
|| 22.4-3, 22.4-5, 22.5-1, 22.5-2, 22-2, 22-3, 22-4, 24.3-1 to 24.3-4, 24.3-6, 24.3-8
| March 18
|| Graph Algorithms
|| 25.1, 25.2, 22
|| 25.1-6, 25.1-7, 25.1-8, 25.2-4, 25.2-5, 25-1(a,b), 22.1-5, 22.2-6, 22.2-9, 22.3-2, 22.3-5, 22.3-7, 22.3-9, 22.4-3, 22.4-5, 22.5-1, 22.5-2, 22-2, 22-3, 22-4
| March 30
|| Maximum Flow
|| 26.1-2, 26.1-6, 26.1-7, 26.2-3, 26.2-10, 26.2-11
Solutions to assignments will be made available on the day they are due.
Updated April 8, 2020