CSC363 - Computational Complexity and Computability (Summer 2005)

This is the teaching page. Go to:Administrative page.

Previous versions of this course:

Because of future versions of the course, I removed the solutions from the webpage. If you really need them, come see me in my office.

Week 13
Here are the slides I used this week: [ps] [pdf].
The FPTAS for MAX-GK appears in Paul's lecture notes on "Approximation Schemes".

Here is the solution to Assignment 4: [ps] [pdf].
I've put in many more details than I expected from you. There was a problem about k-SKD, explained in the solutions at the end. If you dealt with it, you'll get 3p bonus. If not, you won't lose marks. Note, you still have to have dealt with the "regular" case.

Here are some comments regarding the marking of Assignment 3: [txt]. The TA who marked this assignment will be in regular office hours this Thursday if you have questions about marking.

Week 12
Here are the slides I used this week: [ps] [pdf]. The Powerpoint to ps and pdf translation is giving me headaches. Let me know if you have troubles reading them.
The material is compiled from various sources, like Francois' lecture notes, Paul's lecture notes, and the books. Both approximation results (Vertex Cover and TSP) appear in the last chapter of CLRS. I think the Vertex Cover result also appears in Sipser 10.1. If you want to have a look at the TSP result and you don't have CLRS, it's also covered by Paul in his lecture notes.

I've updated Assignment 4: [ps] [pdf].
The main differences are that in question 3a, I'm only asking for the maximum weight that you can get, not for the set achieving it. For question 3b, you may perform divisions involving weights.
I posted it on July 28th, and it is due on August 9th, before lecture. For policies on lateness and collaboration, check the main course web page.

Notes on Assignment 4:

Week 11
This week, we've seen two of the difficult reductions, 3-SAT to HAM-PATH and 3-SAT to SUBSET-SUM. This concludes the list of "hard" reductions. You can review the details in section 7.5 in Sipser. Next week, we will talk about how to deal with NP-completeness, including basic approximation algorithms. These appear in section 10.1 in Sipser, and also in the last chapter in CLRS.

If you ever doubted that NP-completeness is encountered in practice, check out this page. This link is provided for fun.

Here is the solution to Assignment 3: [ps] [pdf].
I expect to return Assignment 3 in the last lecture.

Week 10
This week, we finished the polytime reduction from CNF-SAT to 3-SAT. Then, we saw a polytime reduction from 3-SAT to CLIQUE, showing that CLIQUE is NP hard. Finally, we talked about the Cook-Levin Theorem, and the general structure of the proof that any NP language is polytime reducible to SAT. Details for these proofs are in the book. A very good reference are also Steve Cook's lecture notes on NP and NP completeness, available on his course webpage.

The course drop date is this coming weekend. I will try to be around my office most of the time, so that you can drop by to talk about your concerns with the course. Send me an email if you know when you want to meet, preferably with several time options, and I will pick one.

Here are some marking comments on Assignment 2: [txt]. Although I expected Enping to have office hours next Tuesday, he will hold them this Thursday, so that you can get remarks if you need them before the drop date. He will be in the regular office hour room in BA.

Notes on Assignment 3:

Week 9
This week in lecture, we talked about polynomial time reductions. We saw that if A is polytime reducible to B and B is in P (resp. NP), then A is in P (resp. NP). In order to formalize our intuition to search for the "hardest" problems in NP, we introduced the notions of NP-hard and NP-complete problems. We saw that deciding whether an NP-complete problem has a polynomial time algorithm is equivalent to deciding whether P=NP. We then introduced a number of notions related to boolean formulas, and defined the languages SAT, CNF-SAT and 3-SAT. We started proving a polytime reduction from CNF-SAT to 3-SAT. This material appears in Sipser 7.4 and 7.5. The reduction we were talking about is given in Francois' lecture notes for week 8. For the Complexity part of our course, chapter 34 of Cormen, Leiserson, Rivest and Stein is also very relevant.

Here is an updated version of Assignment 3: [ps] [pdf].
The main difference with the original version is that I am explicitly asking you to only talk about vertex covers, and not about cliques and/or independent sets. I posted it originally on July 7th. Due to a number of reasons, I will push back the due date by a week. So Assignment 3 is now due on July 26th, before lecture. For policies on lateness and collaboration, check the main course web page.
Note: University regulations require that assignments be collected during the term. As a result, I cannot push back the due date for Assignment 4, which means you will have exactly two weeks to work on it. Please schedule your work load accordingly. At this time, you should be able to do most of Assignment 3, except possibly 2c. You may turn it in early.

Here is the solution to the midterm: [ps] [pdf].
I will take questions about the midterm during regular office hours on Thursday, July 14th.

Week 8
Here is the solution to Assignment 2: [ps] [pdf].

This week in lecture, we introduced the complexity class NP, by giving two characterizations, one involving non-deterministic TMs, the other involving polynomial time verifiers. We've seen that the two definitions are equivalent. We've also seen an example of a problem in NP that is not known to be in P, namely HAM-CYCLE. In the end, we gave informal descriptions of P, NP and coNP, and we presented the "views of the world" - the possible relations between these classes. All this material is in 7.3 in Sipser. Next week, we will talk about polynomial time reductions and NP-completeness, found in 7.4. We might also see material from 7.5.

Week 7
This week, we talked about the difference in time complexity between various models of computation, multi-tape vs single tape TMs and non-deterministic vs deterministic TMs. We introduced and talked about P and the tractability thesis. This corresponds to sections 7.1 and 7.2 in Sipser. The midterm will cover everything we did in class or tutorial, up to and including P (7.2). Specifically, NP (7.3) will not be on the midterm. I might, however, ask you about non-deterministic TMs.

Regarding Assingment 1: Nazanin will hold office hours about marking questions on Tuesday, July 5th, 4pm, in SF3207. This will be just before the midterm, and the office hour is NOT about the midterm. I will ask her NOT to answer any such questions.

Regarding Assignment 2: it is due on Monday, July 4th, and 9pm sharp. You may submit it in the course drop box in BA2220. We've also set up a drop box at UTSC, on the 6th floor of the S-wing, next to the elevator. I will post solutions on Monday shortly after 9pm.

Regarding the midterm:

Week 6
This week, we finished the Computability chapter, and started talking about Complexity. I first presented Rice's Theorem, together with several applications and several instances where it cannot be applied. We then saw how the proof goes in one of the two possible cases, and argued the other case is treated similarly. The full proof appears in Paul McCabe's lecture notes 9. I then spent quite a bit of time talking about why this material is important, with implications regarding such things as perfect virus checkers and debugging.

We started talking about Complexity, which is chapter 7 in Sipser. We defined worst-case time complexity of a machine, and we considered two machines, in different models, both deciding the language {0k1k : k>=0}. We saw a regular, single tape TM which needs O(n2) time, and a two-tape TM which needs only O(n) time, suggesting that the choice of a particular model affects the time required to solve a certain problem. Next week, we will make this intuition more formal, reading from sections 7.1 and 7.2.

I haven't been able to return Assignment 1 this week, and as a consequence, I will move back the due date for Assignment 2. Under no circumstances will the midterm date be changed. In class, we agreed to have Assignment 2 due on July 4th, the Monday just before the midterm, at 9pm sharp. I will post solutions shortly after I collect the assignments.

Notes on Assignment 2:

Week 5
Here is Assignment 2: [ps] [pdf]. I posted it on June 15th, and it is due on June 28th, before lecture. For policies on lateness and collaboration, check the main course web page.

In lecture, we continued talking about how we can show that a problem B is hard by reducing another known hard problem A to B. We defined the notion of computable function, and we showed how the absence of this notion allows us to derive potentially contradicting statements using the construction in question 4a of assignment 1. In the process, we showed that the function which maps every positive integer k to a decider Mk for the set of strings of size at most k in ATMc is uncomputable.

Equipped with the idea of computable function, we introduced the notion of mapping reducibility. We saw that if A is mapping reducible to B and A is undecidable, then B is undecidable; and if A is unrecognizable, then B is unrecognizable. We defined INFTM as the set of encodings of TMs which accept an infinite language, and we showed that both this set and its complement are not recognizable by reducing ATMc to both.

Week 4
Here is the solution to Assignment 1: [ps] [pdf]. I plan to return it two weeks after it was due, that is, on June 21st.

This week in lecture we went over the diagonalization method from 4.2 in Sipser, defining what it means for two infinite languages to have the same size, defining what countable sets are, and showing that the set of real numbers is uncountable. We returned to the course material and showed by diagonalization that the set of all languages over a finite alphabet is uncountable, while the set of all TMs (and thus of recognizable languages) is countable. This shows that there are unrecognizable languages. We argued that this fact remains true even if one does not believe the Church-Turing thesis, as long as every "algorithm" has a finite representation. We went on to show how the proof that ATM is undecidable can be seen as a diagonalization argument.

We then started to talk about reductions, a general procedure in which we assume that we can solve a certain problem B and we show how to solve another problem A. In our case, we reduced ATM to ETM. Since the former is provably undecidable, we concluded that the later is also undecidable. We will continue talking about reductions next week. This material is in chapter 5, sections 5.1 and 5.3, in Sipser.

Week 3
In this week's lecture, we first proved that we can assume, without loss of generality, that the input alphabet of a TM contains only 0 and 1, and that its tape alphabet contains only 0, 1 and blank. We went on to talk about a specific way to encode a general TM into a string of 0s and 1s. We then defined the language ATM and we explained in detail how the "universal" TM U recognizes this language. All this material can be found in Paul McCabe's lecture notes 4. Go look it up if things are still unclear.

The last thing we did in lecture was to prove by contradiction that ATM is not decidable. This argument can be found in section 4.2 of Sipser, specifically on p.165 (in the first edition). Don't worry about "The Diagonalization Method", we haven't covered it yet.

Notes on assignment 1:

Week 2
Due to unforseen circumstances, the TA assignment for the first week had to be changed drastically. One of the original four TAs was moved to another course, and another one is sick. This leaves us with only two TAs available this week, and three in general. See administrative page for details.

This week in lecture, we began by defining TM configurations and what it means for a configuration to yield another configuration. We went on to define the language recognized by a TM. After introducing the terms Turing-recognizable and Turing-decidable and their equivalents, we saw a couple of tricky examples of decidable languages. The one about the decimal expansion of Pi appears in Francois' first assignment. I said I was ruining a good assignment question, but I did manage to salvage something out of it (see Assignment 1). We talked about several variants of Turing Machines, including one-way infinite tapes, stay-put transitions, multiple tapes and nondeterminism. We proved that TMs with one-way infinite tapes and two-way infinite tapes recognize the same class of languages.

Here is Assignment 1: [ps] [pdf]. I posted it on May 26th, and it is due on June 7th, before lecture. For policies on lateness and collaboration, check the main course web page.

Week 1
We talked about what kind of problems we will consider in this course and why they are relevant. We then started the Computability part by defining what a Turing Machine is and going through an example. As a motivation for Turing's work, we mentioned Hilbert's tenth problem. This corresponds to sections 3.1 and 3.3 in Sipser's book.

If you want to see a Turing Machine at work, there are various simulations on the web. Here is one, and here is another one. Each simulation might have a special way to enter the transition function and it's tape might be only one-way (as opposed to two-way) infinite. For course purposes, we'll stick with the definition from class. I'm posting these links mainly for fun.