2014 June 11,

CS 254: Computability and Complexity

Carleton College, Spring 2014, Prof. Joshua R. Davis, , Laird 205A, x4473


This course considers two fundamental questions in computer science: What can computers do? How much time and space do they require, to do it? While addressing these questions we will touch on various fascinating topics in programming languages, information theory, linguistics, philosophy, etc.

Your work will be a mixture of writing proofs, executing algorithms by hand, and writing programs. For example, you will learn how to determine whether a programming problem is solvable by regular expressions, and solve it with them if it is. The official prerequisites for this course are CS 111 (Intro) and either CS 202 (Mathematics of Computer Science) or Math 236. Talk to me if you are concerned about your background.

Our class meets in CMC 206 during period 2A (MonWed 9:50-11:00, Fri 9:40-10:40). My office hours are

If you can't make office hours, then schedule an appointment with me. The course materials are


Final grades (A, B, C, etc.) are assigned according to an approximate curving process. By this I mean that there are no predetermined percentages (90%, 80%, 70%, etc.) required for specific grades. The advantage of this system is that student grades don't suffer when I write a difficult exam. The disadvantage is that you cannot compute your own grade. Visit me in my office, if you want me to estimate your current grade for you. The following elements contribute to your final grade.

You are expected to spend about 10 hours per week on this course outside class. Some students need to spend more than 10 hours. If you find yourself spending more than 15 hours, then talk to me.

Standards for Work

You are encouraged to work with others on all assignments (but not exams). Work together to figure out the problems/programs, but write/type them up separately, in your own words. You may not copy someone else's work or allow them to copy yours. Presenting someone else's work as your own is an act of Academic Dishonesty. If Carleton College finds you to not to have upheld its Academic Honesty standards in this course, then you will receive an F for this course.

Writing is not just for English and history majors. Written and oral communication skills are essential to every academic discipline, and are highly prized by employers. In this course, your written work is evaluated both for correctness and for presentation. You may find it easier to type your solutions in LaTeX than to edit them by hand.

How much work should you show? Compose your solutions as if the intended audience is your fellow students. By doing so, you show enough detail that your grader can ascertain whether you yourself understand the material. Your solutions should also be self-explanatory. In this course, the required level of rigor in proofs is sometimes unclear. Mimic the book's level of rigor, preferably with explanation and motivation, and with note of any pitfalls in the logic. If a fellow student were to read your solution, she should be convinced that you understand the problem.

Although homework is assigned every day, it is collected only once a week (usually Fridays). When handing in a week's homework, staple your pages into a single packet, in the correct order. Packets that are not stapled are unacceptable. I will not accept packets that are not stapled. Is there a stapler in the classroom? Often not, so staple ahead of time. Is a paper clip okay? No.

Computer files should be submitted in plain text (.txt), PDF (.pdf), or Python (.py) formats only, unless otherwise specified. In particular, Microsoft Word documents are unacceptable. Fortunately, you can "print" any document to PDF easily.

Depending on time constraints in any given week, perhaps not all of your homework will be graded. In order to ensure full credit, do all of the assigned problems.

Special Accommodations

During the term, you have one free pass to hand in a week's homework packet late. Instead of handing in the packet, send me e-mail, by the due date, declaring that you are using your late pass. No explanation is necessary. Your packet is now due when the next packet is due. When you submit your late packet, write "Late Pass Used" prominently at the top. Once you have used your late pass, no late assignments are accepted, except in extreme circumstances that typically involve interventions by physicians or deans.

If some medical condition affects your participation in class or your taking of exams, let me know in the first week of class. You may need to make official arrangements with the Office of Disability Services.


Here is some advice from actual students who have taken this course in the past:


This schedule is tentative. It will be adjusted as we go along. To help you decode the schedule, here is an example. On Day 02 we discuss deterministic finite automata, which are covered in Section 1.1 of our textbook. You have homework called "Day 02", which you hand in on Day 04.

M 3/3101introductionDay 01010.1-0.4sosupersum.py
W 4/0202deterministic finite automataDay 02041.1
F 4/0403nondeterministic finite automataDay 03061.2NFA <-> DFA
M 4/0704regular expressionsDay 04061.3Python regular expressions
W 4/0905pumping lemmaDay 05091.4
F 4/1106catching upDay 0609Radiolab: Loops
M 4/1407context-free grammarsDay 07092.1
W 4/1608pushdown automataDay 08122.2Recursion
F 4/1809pumping lemma2.31, 2.36122.3
M 4/2110Turing machines3.1Wikipedia: Alan Turing
W 4/2311EXAM A
F 4/2512Turing machinesDay 12153.2
M 4/2813Turing machines3.15bcde, 3.16bcd153.3
W 4/3014Turing machinesDay 14174.1
F 5/0215Turing machinesDay 15174.2
W 5/0716HALT is undecidableDay 16205.1
F 5/0917Rice's theoremDay 17205.1
M 5/1218time complexityDay 18207.1
W 5/1419time complexity7.6, 7.7237.2
F 5/1620time complexityEXAM B217.3
M 5/1921time complexityDay 21237.3
W 5/2122SAT is NP-completeDay 22267.4
F 5/2323space complexity7.24, 7.25268.0-8.1
M 5/2624NPSPACE = PSPACEDay 24268.2
W 5/2825TQBF is PSPACE-complete8.3TQBF
F 5/3026TQBF is PSPACE-complete6.4
M 6/0227Kolmogorov complexityDay 26 or 27Kolmogorov
W 6/0428what haven't we learned?this, this, this, ...
S 6/08FINAL EXAM 3:30PM-6:00PM