This is the home page for CMPSCI 401. CMPSCI 401 is an advanced undergraduate core course in the theory of computation and will deal with formal language theory (finite automata, regular languages, grammars, and pushdown automata), computability theory, and complexity theory.

**Instructor Contact Info:**
David Mix Barrington, 210 CMPSCI
building, 545-4329, office hours TBA.
I generally answer my email fairly
reliably. Office hours Tuesday 2-4, Wednesday 2:30-3:30, Friday 2:30-3:30
(but not Fri 21 January).

**TA Contact Info:** Thanh Tran,
ttran@cs.umass.edu, Office hours Thursday 11:30-12:30 in LGRT TA room.

The course is primarily intended for undergraduates in computer science and related majors such as mathematics or computer engineering. CMPSCI 311 (theory of algorithms) is the primary prerequisite, though this may be negotiable for students with a strong mathematics background. The mathematical techniques taught in CMPSCI 250 (or similar courses like MATH 300 or MATH 455) will be used heavily. No programming will be assigned, but familiarity with programming at the level of at least CMPSCI 187 (data structures) will sometimes be assumed. This is probably the mathematically most difficult course in the CMPSCI undergraduate curriculum. It is a semi-elective course -- it fills requirements for any CMPSCI major and many MATH majors, but should be taken only by students whose mathematical ability and/or motivation is average or above relative to CMPSCI majors.

The textbook for the course is Introduction to the Theory of Computation by Michael Sipser, *second
edition*. This is a very good book: I will be following it very closely
for my lectures, and it is a very good long-term reference, but it is rather
expensive. The first edition is available more cheaply, and the main text of
the two is virtually identical, but the second edition will be the source of
the problems I assign and it has a large number of solved exercises. I have
ordered the book at the Textbook Annex.

The course will meet for three lecture meetings a week, MWF 1:25-2:15 in LGRC 203. (This is Lederle low-rise, not the tower.) There is no formal attendance requirement but there will be occasional graded in-class activities.

There is also an scheduled honors section for the course called CMPSCI H401, a one-credit seminar intended for undergraduates in Commonwealth College (but open to non-CC students as well if there is room). I will lead a seminar on some topics related to the main course, such its connections to formal logic and abstract algebra. This class will meet Mondays 2:30-3:30 in room 343 of the Computer Science Building.

- Course Requirements and Grading
- Homework Assignment Directory (with #6)
- Exam Directory (with final exam ad solution)
- Questions and Answers on Homework (with some on #1)
- Syllabus

**Announcements (20 May 2011):**

- (20 May) The solutions are posted. I can give back graded exams if you find me -- I am generally around this summer. Thanks for a very enjoyable course!
- (19 May) I have posted the final exam, and I will post the solutions late tonight or (more likely) tomorrow.
- (15 May) I have graded the finals, computed final grades, and posted them on SPIRE. I don't think you get to see them for a while, so I will mail them to you individually, probably tomorrow. The finals were disappointing -- two students did very well (only they got 9b) and no one got 7b. (I will post solutions in a few days after I grade CMPSCI 250.) Exam scores were 107, 107, 81, 81, 77, 71, 70, 68, 67, 67, 62, 49, 45, 35, 29. I set the scale at A = 97, B = 80, C = 63, D = 47, F = 30. The course grades for the 15 people who finished the course were A+, A, A-, B+, B+, B, B, B, B-, B-, B-, C+, C-, D, D. Thanks to all of you for an enjoybable course!
- (8 May) I will have office hours tomorrow (Monday) 2-4 p.m., in my office.
- (6 May) Thanh has already graded the HW#6 submissions, so I will have them available (as well as the solutions) at the help session today from 4-5 in room 142 of the CMPSCI building.
- (3 May) I have paper solutions for HW#6, which I will leave for pickup in the CMPSCI main office and have available at my office hours tomorrow.
- (3 May) Opportunities for help before the final -- I will have office hours tomorrow (Wed 4 May) 2:30-4:30, and Thahn will have her normal office hours Thursday 11:30-12:30. I will host a review session Friday 4-5 in room 142 of the computer science building. I'm not sure yet about my availability next week but I will generally be around until the exam.
- (20 Apr) I have posted the last homework assignment, due on Tuesday 3 May (the last day of classes) at 4:00 p.m., to me or to the CMPSCI main office.
- (5 Apr) I've been asked to post the grades and scales for the
first four homeworks. Remember that the best five count 6% of the
total grade each, and that the worst does not count at all.
- HW#1: A = 90, B = 75, C = 60, scores 94, 88, 83, 81, 81, 80, 80, 66, 64, 63, 61, 58, 48, 40, 0, 0
- HW#2: A = 72, B = 60, C = 48, scores 74, 74, 66, 66, 64, 62, 61, 58, 56, 54, 50, 49, 47, 46, 44, 0
- HW#3: A = 90, B = 75, C = 60, scores 98, 93, 92, 83, 81, 80, 70, 66, 66, 66, 62, 62, 55, 47, 0, 0
- HW#4: A = 84, B = 69, C = 54, scores 84, 80, 78, 78, 74, 72, 69, 64, 61, 50, 48, 0, 0, 0, 0

- (3 Apr) I have posted the HW#5 assignment, due on Wednesday 20 April. The last homework will be due at 4:00 p.m. on the last day of classes, which is Tuesday 4 May.
- (2 Apr) I have posted the second
midterm and its solution. I
emailed each of you your grades, and I will return the graded exams
in lecture on Monday. I set the scale at A = 100, B = 82, C = 64,
somewhat lower than I had planned, because I was surprised at how
badly you did on the last question.
The scores in order were 107, 103, 101, 96, 86, 79, 79, 76, 74, 68, 63, 59, 56, 47. None of you are in danger of failing the course, but clearly those with grades below 70 should be disappointed and should prepare better for the final. Half the final will be on material up to now, and the other half will be on the last third of the course. (If you don't understand the ≤

_{m}relation now, you will have trouble with the ≤_{p}relation used in the definition of NP-completeness, which we will see very soon.I owe you an assignment for HW#5 and will get it to you before Monday's lecture.

- (7 Mar) I have posted the HW#4 assignment, due the Friday after break.
- (23 Feb) I have posted the solutions for the first midterm. The scores for the sixteen people who took the exam were 119, 114, 113, 113, 112, 111, 110, 109, 109, 108, 107, 106, 103, 100, 92, 84. The mean was 107, an A-. As I said, the exam was somewhat easier than I intended by I am pleased that you did so well.
- (22 Feb) I have started the exam index page and posted the first midterm. I will post the solutions as soon as I get to it, which may not be until Thursday.
- (22 Feb) I have posted the next HW assignment, which is due a week from Monday. Sorry I haven't gotten to posting the exam and solution yet. I handed back exams in class on Friday -- the scale was A = 112, B = 94.
- (12 Feb) I've started a question and answer page for HW#2 -- so far it has a small correction to the solution to Exercise 1.6(l) on HW#1, which is used on Problem B-2 on HW#2.
- (11 Feb) I want to summarize the state minimization algorithm for DFA's
here, because it is not in the book. (It is the only thing from lecture so far
that is not in the book, though Sipser has only a brief treatment of the
Myhill-Nerode Theorem in Problem 1.52, for which he provides a solution.)
To minimize a DFA (get a DFA for the same language with the smallest possible number of states), we successively create partitions of the states until we reach a particular stopping condition. The initial partition has two classes, F consisting of all final states and N consisting of all non-final states. Starting from one partition, we examine all classes that contain more than one state and list the "behavior" of each state. The behavior of a state p is the function taking each letter a to the

*class*of the state δ(p,a) under the current partition. If more than one behavior appears among the states in a single class, we*divide*that class into multiple classes, one for each behavior, in the next partition. The stopping condition is that for a single partition, each class has a common behavior for all the states within it.For an example, consider the DFA M with Q = {0,1,2,3,4,5}, Σ = {0,1}, q

_{0}= 0, F = {0}, and for any state q and input letter a, δ(q,a) = 2q + a, taken modulo 6. This DFA accepts exactly those binary strings that represent numbers divisible by 6.Our initial partition has F = {0} and N = {1,2,3,4,5}. In the first phase we discover that state 3 has behavior (F,N) while the other four states in N have behavior (N,N). So our second partition has F = {0}, X = {3}, and Y = {1,2,4,5}. Now examining Y, we find that states 1 and 4 have behavior (Y,X) while 2 and 5 have behavior (Y,Y). So we make a third partition that has F = {0}, X = {3}, W = {1,4}, and Z = {2,5}. Now we find that both 1 and 4 have behavior (W,X) and that both 2 and 5 have behavior (W,Z). We have reached the stopping condition and can now build a four-state DFA, with state set (F,X,W,Z), start state F, final state set {F}, and δ given by the behavior function.

You now have two ways to demonstrate that a given DFA M is minimal (has no equivalent DFA with fewer states). You can either run this algorithm, getting a partition with one state in each class, or you can show for each pair of states p and q that there is a string u leading to p and a string v leading to q such that u and v are L(M)-distinguishable.

- (6 Feb) I have posted the second homework assignment, due Monday 14 February in class. I have made this one a bit shorter, because you only have a week.
- (4 Feb) I have posted the first question and answer for HW#1. If I get good questions by email early enough in the weekend, I will post them (but I will not be reading email during either the Silver Chord Bowl Sunday afternoon or during the Super Bowl).
- (4 Feb) I have updated the syllabus to account for the snow day, but in fact there is really no change because I was about a lecture ahead. Today's lecture and next Monday's go beyond Sipser's section 1.4, to include the Myhill-Nerode Theorem (see Sipser's Problem 1.52, with solution in the back) and state minimization for DFA's.
- (27 Jan) Announcements in orange will be for the honors seminar. As I've now posted above, the honors seminar will meet on Mondays 2:30-3:30 in room 343 of the Computer Science Building, starting this Monday 31 January.
- (24 Jan) I have posted the first HW assignment, due in class on Monday 7 February. You will have only one week after that for HW#2, but I will post the HW#2 assignment sometime the week before.
- (19 Jan) I have posted office hours for both me and the TA, Thanh Tran.
- (13 Jan) I have posted the syllabus and the requirements and grading page.
- (8 Jan) This area of the main course page will serve as a blog and will be my primary medium to communicate with the students (though I will email everyone for urgent matters). Please check here frequently. Today I'm setting up some of the basic parts of the course web page. In most respects the course will operate very much like the Spring 2010 version -- the web site for that is still up, here.

Last modified 20 May 2011