Course CS 136 Fall 2014
Williams College Department of Computer Science
Instructor:Prof. Morgan McGuire
TAs: Hannah Ohlson, Matthew LaRose, Devin Gardella, Jamie Lesser,
Llewellyn Smith, Michael Shaw, and Samuel Donow
Lecture:MWF 9:00-9:50am Room TBD
Lab:Wed 12:10*-1:55pm or 2:05-3:50* TCL 216
(* 10 minutes shorter than the registrar's period)

Honor Code

The course is currently over-enrolled for F14. Students who cannot register through Peoplesoft should sign up on the wait list.

Students who are absent from the first class session without prior consent will be dropped from the course and the wait list. Under CS department policy, preference is then given to first- and second-year students. Any first year student who joins the wait list or registers and then attends the first session is extremely likely to be able to enter the course.


What makes for a good computer program? How should one go about writing one? In this course we will investigate aspects of software construction: careful computational analysis of a problem, choice of data structures, design of efficient algorithms for manipulating those structures, and organization of the program as small reusable abstractions.

Students enter CS136 knowing how to make a computer do almost anything that they wish by programming. They learn to hone that skill to program elegantly and efficiently and gain a deep understanding of how computers and algorithms work. Though readings, lab exercises, and lectures, you will learn a specific set of data structures, programming languages, and development tools (...and how to learn new ones), and as a programmer become: become:

Everyone is welcome in the course and will learn a lot about computer science from taking it. This semester's theme is clever algorithms for scientific and engineering programming, which should especially appeal to two groups. Prospective math and computer science majors in the class will appreciate the lab topics because they are all on inherently interesting algorithms: elegant mathematical machines chosen as assignments because the TAs and I ourselves wanted to take them apart and put them back together to see how they worked. Science and economics majors will appreciate that the lab assignments address core issues that they'll tackle in their own disciplines, such as large data sets, modeling complex systems, and optimization problems. They'll also value learning C/C++ and Python, two of the most popular programming languages, particularly for scientific computing.

CS136 is not a first computer science course; an introduction to programming or computer science course heavily features tutorials guiding students down good paths for solving specific problems and hides a lot of confusing detail from them. That's a good way to start, but computer science isn't about a single right answer or following a tutorial. It is about interesting details, design, and creativity within a rigorous and quantitative discipline. This course embraces detail to give a holistic understanding of programming and the machine model, and is about choice: choice of data structure, choice of program design, choice of resource allocation, and choice of programming language.

These choices extend to the coursework itself, so that everyone can have an experience tailored to their own interests. Through a summer survey, preregistered students chose to eliminate exams in favor of more in person interaction and more evaluation of their project work. Everyone will choose their own textbook, choose lab partners, and even choose how challenging the assignments will be for them.


There are three books for the course, which will collectively cost between $26 and $209, depending on what you're seeking in a text:

  1. Kernighan and Ritchie, The C Programming Language 2nd Edition, 1988 (Amazon: $17 rent, $39 used, $49 new)
  2. Lutz, Python Pocket Reference (Amazon: $9 new; Water St.: $15)
  3. Your choice of one of:

The first two books are reference materials for two of the programming languages that we'll be using. You could get by using only free online materials instead of buying these. However, with the books you'll get trustworthy information right away and save time. They also provide high-quality supplemental material on the languages to what is taught in class, which is particularly helpful if you have trouble adjusting to the new syntax.

The third book covers the computer science aspect of the course, and you have a choice of what it is based on your budget and the kind of experience that you desire. I'm intentionally not offering an algorithms book that is in C/C++ or Python because one goal of this cource is to help you think about computer science independent of a particular language or machine. If you can translate programs from the book's example language into the lab assignment language, then you probably understand both the computer science and programming language portion of the assignment.

I give you a choice for the third book because different students have different goals for the course. Aho et al.'s book is a classic in the field. It has some dated comments about 40-year old computers (and the Pascal programming language), but the pseudo-code is very readable and the presentation is clear and straightforward. The algorithms haven't changed since the 80's, so there's nothing wrong with using an older text.

Bailey's book is friendly, modern, and funny. I laughed out loud when reading several sections of it. However, it is closely tied to Java, which has confusing syntax, and some students don't enjoy his wry sense of humor as much as I do. Because it is free, online, and searchable, the price and format are right for many.

Knuth's text is the undisputed authority on algorithms and data structures. It has absolutely beautiful presentations of topics that will give you deep insights and set you up well for CS256 and CS361. It is also verbose and expensive compared to the alternatives, and only a small amount of these large books will be assigned as reading. If you choose this book, then I recommend buying instead of renting--you'll want to spend Winter Study and the next semester reading the parts that were not assigned in class. Knuth has (so far) written a four-volume set, but only volumes 1 and 3 are used in this course. If you're definitely majoring in CS or Math and CS136 is the most important course for you this semester, then this is the book to choose. The TAs suggest that you might be able to buy volumes 1-4 as a set for about the same price as just the two needed for the course.

How to Read

Do not read a CS or math book like a novel. You have to be an active participant to read college level mathematical material. For many people (including me), it is generally hard and a bit unpleasant, although there is joy in finally grasping something. Read some text, pause, ask yourself a question about it, and try and figure out the next step on your own. If you're not quite sure what is going on, don't keep reading--backtrack and read that section again. Maybe out loud. When there are inline exercises or ones at the end of the chapter, actually do (many of) them. Be prepared to skip around, look up material in the index, and re-read critical passages many, many times. I often have to stop and write a little program to test the ideas from the text or fully grasph them. Don't look at equations or code lisings and say, "yes, that looks about right." Ensure that you could reproduce them. Run through the execution of algorithms by hand as if you were a computer. Also, use a debugger or a lot of output statements to trace the execution of the program on the same data and see how it aligns with what you did by hand. I often skim an entire chapter to get a sense for how much material it will cover and to know which concepts are going to become really important, and then read it carefully through a few times while implementing the really confusing or clever parts.

Remember that you have separate Python and C books, which you'll need in order to implement the ideas in your data structures book. Plan to flip through those a lot, and use the table of contents and index. I don't assign sections from those books because they are for reference. Part of what you're learning is how to find resources and use them to solve a computer science task, and that means taking responsibility for this piece of the reading on your own. Don't shy away from online resources either, but remember to take them with a hefty grain of skepticism. Just because someone said something on the web doesn't mean that it is correct, or a good idea.

I could have assigned a single textbook and a single programming language for the course and gone through them linearly. That would have been easier for you. But I'm not trying to make it easy for you. I believe that you learn the most by adapting and actively engaging the material and having a lot of pieces to figure out on your own, just as in real life. I've curated the content and constructed a series of exercises designed to have you encounter the rough spots and your role is to power through them.

I made the lab assignment documents short so that you can read them completely. Read the specifications closely and literally, as a lawyer would. That's how I'll evaluate them, and how future teachers, graduate advisors, managers, and clients will evaluate your work. The specification is the contract between me and you for the assignment. In many cases, your evaluation may hinge on a technicality of the specification that was very significant to me and the TAs but seems insignificant to you. By the end of the course you'll have learned the significant phrases for a CS specification, but early on you have to assume that everything has hidden significance. You can choose whether to read the informal advice or bonus sections--those are me trying to speak to you in plain language about how to get the most out of the material.


This course contains graded projects, most of which comprise a homework and a programming lab. In response to your feedback on the pre-course survey, there are no exams in CS136 this semester!

You will receive in-person feedback from me and the TAs during lab and in office hours, writen comments on your assignments, and numerical grades. Although only a single numerical grade will appear on your transcript, I consider the other forms more valuable for increasing your skills. Happily, your survey responses over the summer indicated that you agree. I've structured the course to maximize the amount of qualitative feedback and one-on-one or small group time possible within a large introductory course. Of course, the best way to improve your numerical grade is to heed the qualitative feedback and seek more when it is insufficient.

A program's source code is a form of written communication between two humans that happens to also be evaluable by a machine. In CS136, I evaluate your programs based on many factors, including:

Look at sample code shown in class and in the textbooks for examples of how to structure and document your code.

If you have discovered bugs in your solution but do not have sufficient time to fix them, document what you know. What is the symptom? How did you approach correcting it? Where in your program do you believe the problem lies? You will receive almost as much credit for knowing the flaws in your solution and document an effective approach to them as you would for a fully correct solution.

Most assignments contain "bonus" material. These are never required. They are there to challenge you and help you engage more deeply. While there is no explicit extra credit for taking on bonus problems, students who try some of them are likely to learn more and then perform better on later assignments (and in future courses) as a result. You should not work on bonus problems at the expense of completing the specification.

For team projects, both team members usually receive the same grade because part of the point of such projects is to learn to balance workload and to take responsibility for shared work.

When determining final grades, I rank students according to numerical average of all assignments, with the lowest grade dropped. Most assignments contain two parts, homework and lab programming, whose scores are summed to create a single grade. The midterm and final projects count as two assignments each, and at most one of those may be dropped.

I then group students within the ranking to assign letter grades. In rare cases when the ranking does not match my holistic evaluation of a student's ability or engagement with the material, I adjust that student's final grade slightly (this is responsable and standard practice, I'm just making it explicit).

There is no pre-set threshold for a given letter grade, although I calibrate assignment grading so that it is very close to final grades on average. Beware that repeated absence from lecture may lower your grade and each absence from lab will lower your final grade by 0.5 out of 4.0.

Submission and Attendance Policy

Because of the way that we administer and evaluate assignments, you may only submit programs in this course by the cs136-turnin folder. Out of fairness to your peers and practicality, hardcopy, e-mail, USB disks, and other attempts to submit work by other means without prior agreement will be ignored. This is because we cannot validate the submission time and because doing so requires manual intervention into the system for tracking work which detracts from the time available for evaluating everyone's work.

Likewise, it is extremely important that you follow the specification exactly on file and directory naming conventions. It is solely your responsibility to ensure that work is submitted on time, even in the face of potential computer configuration errors, operator error, and power outages (working right up to the deadline is very risky--plan ahead and submit partial solutions as you go).

If something does go wrong with the submission process, e-mail and immediately but do not attempt to submit your work in an alternative way, and do not work past the deadline.

Assignments are due at or before their deadlines. Late work is not accepted. This keeps you from overextending yourself and means that everyone in the class has the same amount of time. If you know that you'll be on a trip, then just start and turn in your work early. Don't worry if you have an emergency or bad week--that's why I drop the lowest lab grade. If you have two emergencies, then please let me know what is going on and talk to the dean's office for support. There will be no individual extensions granted, and class-wide extensions are extremely rare.

Submission deadlines are according to the CS department's Mac server, which may have a clock that differs by a few minutes from other clocks at Williams.

Attendance in lab session is mandatory. Missing a lab session without an excuse approved by a dean or prior arrangement with the professor will reduce your final grade in the course by 0.5 (out of 4.0).

Honor Code

The Honor Code allows professors to create assignments and teaching materials based solely on pedagogial goals, without the need to compromise them to reduce opportunities for unethical behavior. This is a great advantage for Williams students and embodies the mutual trust between teachers and students on our campus.

Students are bound by the CS Department Honor Code and Usage Policy and the College Honor Code. In short: all work should be your own (or that of your assigned project group). Remember, failing an assignment may lower your grade, but cheating will ruin your career! Ask Prof. McGuire if you are unsure about how the Honor Code applies to this course or a specific assignment.

The following is the specific policy for how the Honor Code applies to CS136 assignments. This never becomes relevant to most students, however from experience with the unfortunate exceptional cases I explain it in some detail here to minimize the potential for confusion.

Your work should be your own and performed in accordance with the CS department usage policies. Work by others should be properly identified and attributed via citation. When working on an assigned pair or team project, "you" refers collectively to all members of your team, with whom you are expected to collaborate closely and openly. You may not use deception, including lies by omission, to gain an advantage in the course.

Some implications of this policy:

Generalizing from the last two examples, violating the rules of an assignment in a way that is not academically dishonest is not an Honor Code violation, although it will result in a lower grade on that assignment.

Immediately notify the professor if you are concerned that you may have accidentally violated the Honor Code, to avoid misunderstanding.

Beware that the Honor Code compels professors to report potential Honor Code violations to the Honor and Discipline Committee regardless of the professor's beliefs or feelings about the situation, and that the professor is not permitted to notify the student directly or discuss the case with the student.

The image at the top of this website is derived from a screenshot of the Tomb Raider Underworld video game published by Eidos Interactive