comp3 — Computability and Computational Complexity
Academic year 2019-2020,
CS Master degree at the University of Trento, Italy.

Basic information

Important news

Lecture notes have been updated in the course materials section.

In order to receive urgent updates (e.g., about moved or cancelled lectures), please subscribe to the comp3 Telegram channel.


Fall semester, four hours a week, from September 18 to December 19.

  • Wednesdays: 11:30am–1:30pm, room A206
  • Thursdays: 2:30pm–4:30pm, room A103.


Mauro Brunato <>

Please email me if you want to set up a meeting.

In order to receive urgent updates (e.g., about moved or cancelled lectures), please subscribe to the comp3 Telegram channel.
Note for returning students — To avoid spamming, last year's subscriptions have been removed; if interested, please re-subscribe.

Course description

Aim of the course

The course sets the theoretical bases for being able to discuss two fundamental properties of computational problems.

Given a problem, we will initially be concerned about its computability:

  • Is there a method to solve the problem?
  • Can we describe this method in an unequivocal way?
  • Is there a universal “language” for such task?

When a problem is found out to be solvable, we can wonder how efficiently it can be done.

  • What are the meaningful criteria to express how hard a problem is?
  • Is there a meaningful way to classify problems with respect to their hardness?
  • Does this classification tell us something about the limits of our capability to solve problems?


Basic notions of mathematical logic

Expected outcome

At the end of the course, the students will be able to:

  • Describe problems and problem instances in a formally precise way.
  • Describe the solution of simple problems in terms of a universal computational model (the Turing Machine).
  • Prove that a specific problem (Turing's halting problem) is not computable.
  • Apply the formal notion of reduction in order to extend properties of known problems to new ones.
  • Identify quantitative criteria to describe the complexity of an algorithm with respect to instance size.
  • Describe the main time and space complexity classes, and their inclusion relationships.
  • Define what it means for a problem to be complete for a class.
  • Prove that a specific problem ( SATISFIABILITY) is complete in the NP class (Cook's Theorem).
  • Discuss the P vs. NP problem and its main implications on various branches of computer science.
  • Analyze how extensions of the basic computing model (randomness, quantum computing) can benefit the solution of some problem classes.

Program outline

For the actual program, see below.

  • Computability
    • Turing machines.
    • Decidable languages and computable functions.
    • The Halting Problem.
    • Other undecidable languages and uncomputable functions.
  • Computational Complexity
    • Problem instance size, measures of complexity, classification of problems.
    • Time complexity classes: P, NP, NP-completeness. Study of NP-complete problems.
    • Space complexity classes: LOGSPACE, NLOGSPACE, PSPACE, NPSPACE. Savitch's theorem.
    • Random complexity classes.
    • Advanced topics, depending on available time (interactive proofs, cryptography, quantum computation, approximation).


The following books may be useful, but none is mandatory. References to online material will be provided in the course program section.

Sanjeev Arora and Boaz Barak. Computational Complexity: A Modern Approach. Cambridge University Press, 2009. ISBN 9780521424264 [Draft of the book]

John E. Hopcroft, Rajeev Motwani, and Jeffrey D. Ullman. Introduction to Automata Theory, Languages and Computation. Pearson new International Edition, 2013. ISBN: 9781292039053

Christos H. Papadimitriou. Computational complexity. Addison Wesley (Pearson College Div.), 1994. ISBN 9780020153085

Course materials

Lecture notes

Example code

  • Any code sample shown during the course will be made available here.

External links


The exam consists of a written test, with exercises and theoretical questions. Examples will be provided in due time in the lecture notes. The “Computability” part will account for about 1/3rd of the final mark, “Computational Complexity” for the remaining 2/3rds.

The next exam session will take place during the Winter break (January/February 2020).

Past exams

  • Previous exam sheets will be available here for discussion and self-assessment. However, most exercises will also appear in the lecture notes.

Course program

  • 2019-09-18
    • Basic definitions: alphabet, string, language. Enumerating strings.
    • Existence of uncountable sets (e.g., real numbers): there are not enough strings to describe all real numbers.
  • 2019-09-19
    • Examples of potentially infinite computations based on some unsolved mathematical conjectures (Goldbach, Collatz).
    • Intuitive definitions of recursive and recursively enumerable sets. Diagonal procedure to enumerate R.E. sets.
  • 2019-09-25
    • Common methods to recognise languages: automata, grammars, regular expressions.
    • Turing machines; representation of their transition function as a table or as an automaton. Examples.
  • 2019-09-26
    • Computational power of Turing machines: multiple tapes, alphabet size, extension of the tape.
    • Emulation of a Von Neumann machine with a Turing machine (hints).
  • 2019-10-02
    • Universal Turing machines: string encodings of TMs, simulation of TMs.
    • Uncomputable functions: their existence by cardinality argument, proof of uncomputability. Uncomputability of the halting problem.
  • 2019-10-03
    • Special restricions of the halting problem: machines starting from an empty tape.
    • Recursive and recursively enumerable languages; co-R.E. languages.
  • 2019-10-09
    • Busy beaver functions and their uncomputability.
    • Reductions, Turing reductions. Proofs by reduction: general framework.
  • 2019-10-10
    • Discussion: computability of the halting problem for restricted classes of TMs.