# The Theory of Computation

## Bernard M.E. Moret

#### 1. Introduction

1.1 Motivation and Overview
1.2 History

#### 2. Preliminaries

2.1 Numbers and their Representation
2.2 Problems, Instances, and Solutions
2.3 Asymptotic Notation
2.4 Graphs
2.5 Alphabets, Strings, and Languages
2.6 Functions and Infinite Sets
2.7 Pairing Functions
2.8 Cantor's Proof: the Technique of Diagonalization
2.9 Implications for Computability
2.10 Exercises
2.11 Bibliography

#### 3. Finite Automata and Regular Languages

3.1 Introduction
3.1.1 States and Automata
3.1.2 Finite Automata as Language Acceptors
3.1.3 Determinism and Nondeterminism
3.1.4 Checking vs. Computing
3.2 Properties of Finite Automata
3.2.1 Equivalence of Finite Automata
3.2.2 epsilon Transitions
3.3 Regular Expressions
3.3.1 Definitions and Examples
3.3.2 Regular Expressions and Finite Automata
3.3.3 Regular Expressions from Deterministic Finite Automata
The Base Case
The Inductive Step
Completing the Proof
Reviewing the Construction of Regular Expressions from Finite Automata
3.4 The Pumping Lemma and Closure Properties
3.4.1 The Pumping Lemma
3.4.2 Closure Properties of Regular Languages
3.5 Conclusion
3.6 Exercises
3.7 Bibliography

#### 4. Universal Models of Computation

4.1 Encoding Instances
4.2 Choosing a Model of Computation
4.2.1 Issues of Computability
4.2.2 The Turing Machine
4.2.3 Multitape Turing Machines
4.2.4 The Register Machine
4.2.5 Translation Between Models
4.3 Model Independence
4.4 Turing Machines as Enumerators and Acceptors
4.5 Exercises
4.6 Bibliography

#### 5. Computability Theory

5.1 Primitive Recursive Functions
5.1.1 Defining Primitive Recursive Functions
5.1.2 Ackermann's Function and the Grzegorczyk Hierarchy
5.2 Partial Recursive Functions
5.3 Arithmetization: Encoding a Turing Machine
5.4 Programming Systems
5.5 Recursive and R.E. Sets
5.6 Rice's Theorem and the Recursion Theorem
5.7 Degrees of Unsolvability
5.8 Exercises
5.9 Bibliography

#### 6. Complexity Theory: Foundations

6.1 Reductions
6.1.1 Reducibility Between Problems
6.1.2 Reductions and Complexity Classes
6.2 Classes of Complexity
6.2.1 Hierarchy Theorems
6.2.2 Model-Independent Complexity Classes
Deterministic complexity classes
Certificates and nondeterminism
6.3 Complete Problems
6.3.1 NP-Completeness: Cook's Theorem
6.3.2 Space Completeness
Polynomial space
Polylogarithmic space
6.3.3 Provably Intractable Problems
6.4 Exercises
6.5 Bibliography

#### 7. Proving Problems Hard

7.1 Some Important NP-Complete Problems
7.2 Some P-Completeness Proofs
7.3 From Decision to Optimization and Enumeration
7.3.1 Turing Reductions and Search Problems
7.3.2 The Polynomial Hierarchy
7.3.3 Enumeration Problems
7.4 Exercises
7.5 Bibliography

#### 8. Complexity Theory in Practice

8.1 Circumscribing Hard Problems
8.1.1 Restrictions of Hard Problems
8.1.2 Promise Problems
8.2 Strong NP-Completeness
8.3 The Complexity of Approximation
8.3.1 Definitions
8.3.2 Constant-Distance Approximations
8.3.3 Approximation Schemes
8.3.4 Fixed-Ratio Approximations and the Class OptNP
8.3.5 No Guarantee Unless P equals NP
8.4 The Power of Randomization
8.5 Exercises
8.6 Bibliography

#### 9. Complexity Theory: The Frontier

9.1 Introduction
9.2 The Complexity of Specific Instances
9.3 Average-Case Complexity
9.4 Parallelism and Communication
9.4.1 Parallelism
9.4.2 Models of Parallel Computation
9.4.3 When Does Parallelism Pay?
9.4.4 Communication and Complexity
9.5 Interactive Proofs and Probabilistic Proof Checking
9.5.1 Interactive Proofs
9.5.2 Zero-Knowledge Proofs
9.5.3 Probabilistically Checkable Proofs
9.6 Complexity and Constructive Mathematics
9.7 Bibliography

#### References A. Proofs

A.1 Quod Erat Demonstrandum, or What is a Proof?
A.2 Proof Elements
A.3 Proof Techniques
A.3.1 Construction: Linear Thinking