Princeton University
Computer Science Department

Computer Science 402
Artificial Intelligence

Rob Schapire

Fall 2012

General Information | Schedule & Readings | Assignmentsblackboard

Final exam information

Course summary
Staff, lectures, office hours
Grading and workload
What you will be graded on
Turning in assignments
Late policy
Breadth requirement for CS graduate students
Getting help

Course summary

This course will provide a basic introduction to the core principles, algorithms and techniques of modern artificial intelligence research and practice.  Main topics will include:

Staff, lectures, office hours


TTh, 11-12:20, Computer Science Building, room 104 (large auditorium)


Rob Schapire:  407 CS Building, x8-7726, schapire@cs
Office hours: by appointment.  To schedule an appointment, visit, or send me email if no convenient times are available.


Xiaoyan Li:  xiaoyan@cs
Office hours:  Thursday 1-3, CS 410.


Mehmet Basbug:  mbasbug@cs
Office hours:  Monday 10-11, CS 431 ("AI lab").

Haipeng Luo:  haipengl@cs
Office hours:  Monday 2:30-3:30, open area right outside CS 407.

Rajesh Ranganath:  rajeshr@cs
Office hours:  Wednesday 10-11, open area right outside CS 407.

Undergraduate Coordinator: 

Colleen Kenny-McGinley:  210 CS Building, x8-1746, ckenny@cs



COS 226, or permission of professor.

Although there are no formal math prerequisites, students should have taken enough math to feel comfortable with the mathematical treatment that will be given of much of the material.  Calculus and linear algebra certainly should be sufficient, as should be COS 340, or a course on probability and statistics.  Come see me if you are unsure.


Artificial Intelligence: A Modern Approach
by Stuart J. Russell and Peter Norvig
Third edition
Prentice Hall, 2010

Be sure to get the third edition of this book.

As I am sure you are aware, you may be able to get a better price for the book by shopping around on the web.  If you buy the "international edition," be forewarned that the numbering of some of the exercises is different from what appears in the standard edition.  If you use this edition, it is your own responsibility to be sure that you are doing the exercises that were actually assigned.

Copies of this textbook are (or soon will be) on reserve at the Engineering Library.


Programming in this course will be done in Java.  If you do not already know Java, you will need to learn it in the first couple of weeks of the course.

There are a number of good books on Java, including Java in a Nutshell (available online here or from the university library) and The Java Programming Language (fourth edition) by Ken Arnold, James Gosling and David Holmes (available online here or from the university library).  Additional Java online documentation and tutorials are available here.

One of the advantages of Java is that it comes with the standard Java Platform that includes packages for i/o, string manipulation, various data structures, etc.  You are free (and encouraged) to make use of any of these.  However, it is your responsibility to choose packages that are appropriate for how you are using them.

To get started using Java, see the COS126 "Hello, World" assignment which describes the mechanics of using Java locally.  For this course, you must use Java Standard Edition 5.0 (a.k.a. version 1.5.0) or higher.

Grading and workload

Regular homework assignments will alternate between programming and written exercises, with one or the other due nearly every week.  You will be given roughly two weeks for most of the assignments.  There will be a final exam but no midterms.  In principle, anything covered in lecture or in the assigned readings is "fair game" for the final.  However, realistically, you can expect that the emphasis will be placed on those same topics that were emphasized in lecture.

Final grades will be based 65% on homeworks, and 35% on the final exam.  Note that failure to complete any significant component of the course may result in a grade of D or F, regardless of performance on the other components.  This means that all homeworks must be completed and turned in, even if late.  Final grades may also be adjusted slightly upward for regular and positive class participation, or slightly downward for absence from lecture.

Many of the assignments allow you to earn honors optional points (or hops, for short) by completing additional challenges.  These are entirely optional, and are in no way required for completing the course.  However, students who are aiming for an A in the course may wish to attempt at least some of these challenges (although I guarantee that it will be possible to get an A without any honors optional points).  Note that hops will not necessarily be treated on the same scale as the "regular" points used in grading homeworks.

You can track how well you are doing using blackboard (log on using your OIT login and password), bearing in mind that these posted grades do not include late penalties or honors optional points.  As a rough guide, if the total number of points you get on your homeworks falls close to or below 65% of the total points possible, then you may be heading for a final grade of D or F, and you should certainly seek assistance.

What you will be graded on

For most of the written exercises, you will be graded primarily on getting the right answer, but also on writing up your answer clearly, concisely and precisely.  Likewise, programming assignments are graded largely on whether or not your program works correctly and efficiently, but also on whether your code is written cleanly following good programming practices and including sufficient documentation.  Creativity and ingenuity are important factors in many of the programming assignments.  In addition, some of the written exercises and programming assignments may ask you to explore and experiment (for instance, with the program you have written), and to report on what you have found.  For these, you will be graded on producing a write-up that is thoughtful, perceptive, insightful, critical, clear and concise.

You should always be sure that your code compiles and runs without throwing exceptions (unless given bad data).  A major part of your grade is based on automatic testing of your code, and if it doesn't even compile and run, then we cannot give you any credit for this part.  For most assignments, you can check that your code compiles by pushing the "Check All Submitted Files" button on DropBox after uploading all of your code (see below).  For the sake of automatic testing, it is also important that you please not modify the code that we are providing with each assignment, except for template files or unless specifically told it is okay to do so in the instructions.  You also should not change the "signature" of any of the methods or constructors that you are required to write, i.e., the parameters of the method (or constructor), their types, and the type of the value returned by the method.

Turning in assignments

The programming part of each assignment (that is, the actual Java code) should be turned in electronically using DropBox by following the link given on each assignment.  To log on, you will need to use your OIT login and password.  Also, you must be registered for the course.  You can upload files in the usual way.  Once uploaded, for most assignments, you can press the "Check All Submitted Files" button to be sure that your code compiles.  Files can be resubmitted, if necessary (but possibly with a late penalty if resubmitted after the deadline).  Many of the programming assignments also have written components called the program report.  These should also be submitted electronically using DropBox following these same instructions.  This report must be contained in a single pdf file called report.pdf.  No other file formats will be accepted.

Written exercises must be submitted in hard copy, and can be turned in at the end of class, or directly to a TA in charge of the assignment, or they can be submitted by placing in one of the boxes that are located on a shelf near the vending machines in the basement of the Computer Science Building, right under the main entrance.  If placing in a box, be sure to write down the day and time of submission (see late policy below).

Late policy

All assignments are due at 11:59pm on the due date.

Each student will be allotted eight free days which can be used to turn in homework assignments late without penalty.  For instance, you might choose to turn in homework W1 two days late, homework P3 three days late, and homework P5 three days late.  Once your free days are used up, late homeworks will be penalized 20% per day.  (For instance, a homework turned in two days late will receive only 60% credit.)  Homeworks will not be accepted for credit more than five days past the deadline, whether or not free days are being used.  Even so, all homeworks must be credibly completed and turned in, even if this five-day limit has passed.  As noted above, failure to do so may result in a final grade of D or F, regardless of performance on other components of the course.

Exceptions to these rules will of course be made for serious illness or other emergency circumstances of a similar nature; in these cases, please contact me as soon as you are aware of the problem.  Also, note that the last programming assignment, which is due on "dean's date," cannot be turned in late without a dean's permission, as per university rules.

A weekend, that is, Saturday and Sunday together, count as a single late "day".  For instance, a homework that is due on Thursday but turned in on Monday would be considered three days late, rather than four.

If you are turning in a written exercises after hours when no one is around to accept it, please clearly mark the day and time when it was turned in.  Failure to do so may result in staff members considering the homework to be submitted at the time when they pick it up (which might be many hours, or even a day or two after when you actually submitted it).

It is your own responsibility to keep track of how many late days you have used.  We will post our own record of late days used on blackboard, but the numbers posted will not always be fully up-to-date.

Note that we do not generally mark late penalties on your returned assignments, but will deduct them from the recorded grade in computing your final grade for the semester.  Knowing how many late days you have used, you can do the same calculation on your own.


The collaboration policy for this course is based on the overarching objective of maximizing your educational experience, that is, what you gain in knowledge, understanding and the ability to solve problems. Obviously, you do not learn anything by copying someone else's solution. On the other hand, forbidding any and all discussion of course material may deprive you of the opportunity to learn from fellow students. The middle ground between these two extremes also needs to be defined with this basic principle in mind. Before working with another student, you should ask yourself if you would gain more or less by working together or individually, and then act accordingly. Here are some specific guidelines based on this principle:

Consulting any kind of website, blog, forum, mailing list or other service for discussing, purchasing, downloading or otherwise obtaining or sharing homework solutions is strictly forbidden (except for piazza and the class mailing list, as discussed below).

Violations of these policies may be grounds for failing the course or university disciplinary action.


Auditors are welcome, and are encouraged to take part in class discussions.  If you wish to receive official "credit" for auditing this course, you must attend the vast majority of the lectures.

Course requirements for CS graduate students

If you are a CS graduate student, you can take this course for credit in partial fulfillment of the department's course requirements.  These requirements were recently changed.  For PhD students who began their graduate studies in 2011 or earlier and who are following the older requirements, the department also allows you the option of not taking the course for credit, but only taking the final exam at the end of the semester.  This option is only intended and recommended for students who have taken a very similar course elsewhere.  To pass the requirement by exam only, you will need to do very well on the final, with a threshold set at least as high as the mean and median among students who are taking the class for a grade.  You may find it easier to pass this requirement by instead taking the course for credit since its fulfillment will then be based on overall performance throughout the course, not just on the final.

Under the new version of these requirements, this exam option is no longer available.  Clearly, if you have taken a similar course elsewhere, you should not take the class a second time but should instead take some other course to fulfill this requirement.

Getting help

The course staff and I are here to help, so don't hesitate to contact us or come see us if you are having trouble.  Because they can be challenging, it is very important that you start the homeworks early, not only so that you have enough time to finish them, but also so that you can get help if you have questions or difficulties.  You should not assume that someone will be available to help you at the very last minute (especially on weekends or at night).

Each homework will be assigned to two of the course staff members, as listed on the assignments page.  These staff members are in charge of all aspects of that homework (including grading it), so questions that are specific to a particular homework (whether before or after it has been turned in or graded) should be directed to them.  General questions regarding material covered in class or the readings can be directed to any instructor or TA.  If you cannot make it to office hours, you can set up an appointment via email.

Like the rest of the staff, I am also available to answer questions on anything (although some matters, such as grading of particular homeworks, should be directed first to the staff members in charge).


An email list is maintained by the university for all students who are registered for the course.  This list will be used by the course staff for important general announcements, such as last minute corrections to the homeworks, changes in due date, etc.  To avoid missing these announcements, it is imperative that you be registered for the course.

This semester, we will be trying out "Piazza", an online forum that will be used for general announcements (in addition to the mailing list), and that can be used by students for discussing course material, general-interest questions about the homeworks, etc.  The course staff will attempt to monitor and respond to questions posted on Piazza.  Of course, if your question is specific to your own work, you will probably want to contact a staff member directly, and you should always avoid giving away the solution to a problem or programming assignment in a general posting.  To sign up for Piazza, visit: