Caution! You are looking at an out-of-date version of this website from Spring 2016.
To access the current version, click here.


Description. This course is an introduction to computer science in the context of scientific, engineering, and commercial applications. The goal of the course is to teach basic principles and practical issues, while at the same time preparing students to use computers effectively for applications in computer science, physics, biology, chemistry, engineering, and other disciplines. Topics include: programming in Java; hardware and software systems; algorithms and data structures; fundamental principles of computation; and scientific computing, including simulation, optimization, and data analysis.

Prerequisites. None.

Video lectures. Available online.

Class meetings. Class meetings are held twice per week, on Tuesdays & Thursdays.

Precepts. Precepts meet twice a week, on either Tuesdays & Thursdays or Wednesdays & Fridays.

Required reading. R. Sedgewick and K. Wayne, Introduction to Programming in Java: An Interdisciplinary Approach, Addison-Wesley, 2007. ISBN 0-321-49805-4. We will be referencing this text all semester. The lectures are based on its contents. (Labyrinth)

Suggested reading.D. Harel, Computers Ltd.: What They Really Can't Do, Oxford, 2003. ISBN 0-19-860442-4. This is an introduction to theory that will be useful in the second half of the semester. (Labyrinth)


Below you will find our contact information, but please keep in mind that it is almost always more appropriate to post your question on Piazza rather than emailing an individual staff member. Our office hours and precept schedule can be found on the Help page.

Need to switch into a full precept? Please contact Colleen Kenny-McGinley.

Kevin Wayne

Dan Leyzberg
Co-Lead Preceptor

Jérémie Lumbroso
Co-Lead Preceptor

Alan Kaplan
Co-Lead Preceptor

Donna Gabai

Stephen Cook
Graduate Student

Ranjana Addanki
Graduate Student

Aohui "Lawrence" Lin
Graduate Student

Kevin Boutarel
Graduate Student

KatieAnna Wolf
Graduate Student

Robert MacDavid
Graduate Student

Laura Roberts
Graduate Student

Hussein Nagree
Graduate Student

Alex Tarr
Graduate Student

Debbie Varnell
Graduate Student


Precepts are an integral part of this course. We offer two formats: those intended for absolute beginners ("novice precepts") and those intended for beginners with some degree of comfort with computational/logical thinking ("regular precepts"). This entire course is designed to be approachable for students with no computing background, but we have found that absolute beginners enjoy having extra time in precept to cover the same material.

If you miss your precept, you can attend any other precept section. All Tuesday/Wednesday and Thursday/Friday precepts contain the same instructional content. Just email both preceptors to let them know where you'll be.

P01 Tuesdays & Thursdays 12:30-1:20pm with Dan Leyzberg in Friend 109
P01A Tuesdays & Thursdays 12:30-1:20pm with Jérémie Lumbroso in Friend 009
P01B Tuesdays & Thursdays 12:30-1:20pm with Stephen Cook in Friend 110
P01C Tuesdays & Thursdays 12:30-1:20pm with Ranjana Addanki in Friend 112
P02 Tuesdays & Thursdays 1:30-2:20pm with Jérémie Lumbroso in Friend 009
P02A Tuesdays & Thursdays 1:30-2:20pm with Kevin Boutarel in Friend 110
P02B Tuesdays & Thursdays 1:30-2:20pm with Katie Wolf in Friend 111
P04 Tuesdays & Thursdays 3:30-4:20pm with Stephen Cook in Friend 009
P05 Tuesdays & Thursdays 7:30-8:20pm with Lawrence Lin in Friend 108
P06 Wednesdays & Fridays 11:00-11:50am with Alex Tarr in Friend 112
P06A Wednesdays & Fridays 11:00-11:50am with Robert MacDavid in Friend 009
P07 Wednesdays & Fridays 12:30-1:20pm with Hussein Nagree in Friend 109
P08 Wednesdays & Fridays 1:30-2:20pm with Laura Roberts in Sherrerd 001
80-minute novice precepts:
P11 Tuesdays & Thursdays 1:30-2:50pm with Alan Kaplan in Friend 108
P11A Tuesdays & Thursdays 1:30-2:50pm with Dan Leyzberg in Friend 109
P12 Wednesdays & Fridays 1:30-2:50pm with Donna Gabai in Friend 108
P13 Tuesdays & Thursdays 3:00-4:20pm with Alan Kaplan in Friend 108
P14 Wednesdays & Fridays 3:00-4:20pm with Donna Gabai in Friend 108


Help. COS 126 is a challenging course that requires a significant time commitment for most students. If you fall behind, please ask for help.

Course website. This website contains a wealth of documents and online tools for you to practice and study computer science, including the course lecture slides, online programming activities (with solutions), a Java code visualizer, and an exam archive.

Booksite. The booksite is a resource that accompanies the textbook for use while online (for example, while programming); it contains the code from the book and solutions to selected exercises. The textbook is for your use when initially learning new material or reinforcing your understanding of that material (for example, when reviewing for an exam).

Piazza. Piazza is an online forum where you can ask and answer short questions.

Blackboard. You can check your assignment and exam grades on Blackboard.

Course software.This course has an associated software package called introcs that provides a complete Java programming environment. Install it on your computer by following the instructions for your operating system: Mac OS X, Windows, or Linux.

Cluster computers.For students who may not have a computer or for students whose computers fail during the semester, OIT cluster machines are available in Friend Center 017. Click here for information on using the labs.


Course grades. Course grades are comprised of nine weekly programming assignments (40%), two written exams (35%), two programming exams (15%), a final programming project (10%), and staff discretion (to adjust borderline cases).

Curve. We do not "curve" graded work or course grades. For example, the cutoff for an "A−" will be approximately 90% of the available points.

Midterm exams. There are two two-part exams during the semester. One pair will be given in middle of the semester; the other pair in the last week or so of classes. The exams have a written portion and a programming portion. There is no final exam. No makeup exams will be considered without a Dean's recommendation and our pre-approval.

Programming assignments. There are nine weekly programming assignments, all equally weighted.

Final project. The final project is a large programming assignment, approximately the length of two weekly assignments. It is due towards the end of Reading Period.

Late work. Assignments are due on Monday nights at 11:59pm. Submissions made at 12:00am will be marked late. If any part of an assignment is submitted late, the entire assignment will be marked late. To submit an assignment late, mark the checkbox on our online submission system, Dropbox, that indicates that your work is incomplete. If the deadline has passed and the checkbox is not marked, we will grade any submitted work as-is. We will not accept any work for this semester after Dean's Date.

Penalties for late work. Late assignments are assessed a penalty equal to 20% of the possible points on the assignment per day or partial day that it is late. The penalties for your first four late days are automatically waived. (This waiver applies only to programming assignments, not the final project.) Additional late penalties will be waived only in the case of a medical or personal emergency, as documented in a note from a Dean, Director of Studies, or McCosh Health Center.

Regrades. If you feel we have made a mistake while grading your work, write a short note describing the potential mistake and attach it to the graded work. Return it to your preceptor within two weeks of the work being handed back.

Auditors. Auditors must identify themselves to the lead preceptors via email as soon as possible. Auditors will receive only automated feedback on work. To earn audit credit, you must successfully complete all of the programming assignments and the final project, using at most four late days. Auditors do not take exams in this course.

Collaboration Policy

This course permits (and encourages) many forms of collaboration, including with course staff, classmates, and lab TAs. However, you must be careful to collaborate only as authorized below. Here is an executive summary:
COS 126

Your solutions. You must individually compose all of your solutions. The term solutions refers to any of the products created when completing a programming assignment, such as source code (including comments) and the readme.txt file. It includes both finished and unfinished products, regardless of correctness or completeness.

These rules continue to apply even after this semester is over.

Collaboration with course staff. You are welcome to discuss your solutions with course staff members (instructor and preceptors) in office hours or via private Piazza posts. Do not post or email us your code; instead, submit it via the course submission system.

Collaboration with classmates. We encourage you to discuss common concerns with classmates either private via personal interactions or publicly in the Piazza course forum. These discussions must be kept at a general level, without exposing your solutions. For example, you may ask about:

But, for example, you you may not:

Collaboration with COS 126 graduates (including lab TAs and peer tutors). Anyone who successfully completed COS 126 in a previous term (including lab TAs) may assist you in the following ways:

Other individuals may help you under these same conditions, provided they are not taking COS 126 now and never will in the future.

Collaboration with a partner. On certain assignments the collaboration policy is relaxed to allow working with a partner, subject to the following rules:

If two students begin working on an assignment as partners and cannot complete it together, at least one student must contact a lead preceptor to request a partnership dissolution.

Collaboration with yourself. If you took COS 126 (or part of it) during a previous term, then you may refer to your solution for an assignment from the previous term provided that (1) you composed the solution individually, (2) you don't partner on that assignment this term, and (3) you acknowledge it in your readme.txt. However, in our experience, redoing the assignment from scratch will significantly increase your chance of success in the course.

Collaboration acknowledgment. You must acknowledge any collaboration (whether authorized or unauthorized) in the readme.txt file for that week's assignment. Using and acknowledging unauthorized collaboration will typically result in a grade of 0 for the assignment (but no further penalty).


Plagiarism and abetting plagiarism are serious academic infractions. Programming is a creative work and the academic regulations that apply to plagiarizing prose also apply to plagiarizing code. Princeton's Rights, Rules, Responsibilities defines plagiarism as "the use of any outside source without proper acknowledgment." It ranges from "verbatim copying" (e.g., cutting-and-pasting code) to "thorough paraphrasing" (e.g., changing variable names or rearranging code).

Outside sources and citations. Copying or adapting code that is not yours is permitted only if it comes from the course materials (i.e., the course textbook, companion booksite, programming assignment specifications, checklists, lecture slides, lecture videos, and precepts). If you do so, you must cite any code that you copy or adapt (with the exception of code that is included with the assignment).

Plagiarism detection. We use sophisticated software tools to detect plagiarism. For example, we compare each submission against a code database, which includes all submissions from this offering and previous offerings of the course. While we take no pleasure in bringing cases to the Committee on Discipline, it is our duty to keep the playing field level for the overwhelming majority of students who work very hard in this course and follow the rules.

Penalties. We refer alleged academic violations (including plagiarism and abetting plagiarism) to the Committee on Discipline. If found responsible, the typical penalty is an F as a course grade plus whatever penalty that the CoD imposes. (The typical CoD penalty for plagiarism is suspension from the University for one year.) Violators of course policies that are not adjudicated by the CoD will receive penalties based on the severity of the violation, ranging from a warning (for violations that are both unintentional and innocuous) to an F in the course (for violations that are both intentional and serious).