2013 June 12,

CS 254: Computability and Complexity

Carleton College, Spring 2013

Prof. Joshua R. Davis, , CMC 325, x4473


This course addresses two fundamental questions in computer science: What can computers do? And how much time and space do they require, to do it? While answering these questions, if only partially, we will touch on various fascinating topics in philosophy, linguistics, programming languages, etc. Your work will be a mixture of proofs and 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 201 (Data Structures) and CS 202 (Mathematics of Computer Science). Math 236 may be substituted for CS 202. Talk to me, if you are concerned about your background. Our class meets in CMC 206 during period 1A (MW 8:30-9:40, F 8:30-9:30). My office hours are Monday 9:50-11:00, Wednesday 9:50-11:30, and Thursday 6:00-6:50. If you can't make an office hour, 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 following elements contribute to the final grade.

You are expected to spend at least 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, say, 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? The answer is simple: 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 short, if a classmate were to read one of your solutions, then she or he should be able to understand what the problem was and how you solved it.

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 is 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 an assignment late. Instead of handing in the assignment, send me e-mail, by the due date, declaring that you are using your late pass. No explanation is necessary. Your work is now due when the next assignment is due. When you submit your late work, mark it "Late Pass Used" prominently at the top. Once you have used your late pass, no late assignments are accepted, except in extreme circumstances that are truly beyond your control.

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:


M 4/0101introductionDay 01010.1-0.4sosupersum.py
W 4/0302deterministic finite automataDay 02031.1
F 4/0503nondeterministic finite automataDay 03061.2
M 4/0804regular expressionsDay 04061.3Python REs
W 4/1005pumping lemma1.29b, 1.35, 1.53, 1.54, 1.55c091.4Radiolab: Loops
F 4/1206catching upDay 0609Stack Exchange: Recursion or Loops?
M 4/1507context-free grammars2.2, 2.4c, 2.6b, 2.17, 2.20092.1
W 4/1708pushdown automataDay 08122.2
F 4/1909pumping lemma2.31, 2.34, 2.36122.3
M 4/2210catching up
W 4/2411EXAM A
F 4/2612Turing machinesDay 12153.1Wikipedia: Alan Turing
M 4/2913Turing machines2.26, 3.9, 3.16153.2
W 5/0114Turing machinesDay 14173.3
F 5/0315decidability4.12, 4.16174.1
M 5/06midterm break
W 5/0816decidabilityDay 16204.2
F 5/1017HALT is undecidableDay 17205.1
M 5/1318Rice's theorem5.1
W 5/1519time complexityDay 19237.1
F 5/1720time complexityEXAM B217.2
M 5/2021time complexity7.4, 7.6, 7.7237.3
W 5/2222time complexity7.4
F 5/2423SAT is NP-completeDay 23267.4
M 5/2724space complexity7.24, 7.25268.0-8.1
W 5/2925space complexity8.2-8.3
F 5/3126TQBF is PSPACE-completeDay 2628TQBF
M 6/0327catching up
W 6/0528what haven't we learned?
M 6/10FINAL EXAM 7:00PM-9:30PM