Comput Ability Decid Ability Complexity

  • View
    22

  • Download
    2

Embed Size (px)

DESCRIPTION

Comput Ability Decid Ability Complexity

Transcript

  • Alberto Pettorossi

    Elements of Computability,

    Decidability, and Complexity

    Third Edition

    ARACNE

  • Table of Contents

    Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    Chapter 1. TURING MACHINES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    1. Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    2. Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    3. Techniques for Constructing Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    3.1 Use of States to Store Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    3.2 Use of Multiple Tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    3.3 Test of String Equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    3.4 Shift of Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    3.5 Use of Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    4. Extensions of Turing Machines Which Do Not Increase Their Power . . . . . . . . . . . . 24

    4.1 Two-way Infinite Tape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    4.2 Multitape Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    4.3 Multihead Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    4.4 Off-line and On-line Turing Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    4.5 Bidimensional and Multidimensional Turing Machines . . . . . . . . . . . . . . . . . . . . . 28

    4.6 Nondeterministic versus Deterministic Turing Machines . . . . . . . . . . . . . . . . . . . . 29

    5. Restrictions to Turing Machines Which Do Not Diminish Their Power . . . . . . . . . . 31

    5.1 One Tape = One Tape + One Read-only Input Tape = Two Stacks . . . . . . . . 32

    5.2 Two Stacks = Four Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    5.3 Four Counters = Two Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    5.4 Turing Machines with Three or Two States Only . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    5.5 Turing Machines with Three or Two Tape Symbols Only . . . . . . . . . . . . . . . . . . . 38

    6. Turing Machines as Language Generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    7. Turing Computable Functions and Type 0 Languages . . . . . . . . . . . . . . . . . . . . . . . . . . 40

    8. Multitape Turing Machines and Random Access Memory Machines . . . . . . . . . . . . . 42

    9. Other Models of Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    10. Church Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    Chapter 2. PARTIAL RECURSIVE FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . . . 55

    11. Preliminary Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    12. Primitive Recursive Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

    13. Partial Recursive Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

    14. Partial Recursive Functions and Recursively Enumerable Sets . . . . . . . . . . . . . . . . . 72

    15. Recursive Enumerable Sets and Turing Computable Functions . . . . . . . . . . . . . . . . . 79

  • 616. Partial Recursive Functions on Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

    17. Partial Recursive Functions and Turing Computable Functions . . . . . . . . . . . . . . . . 80

    18. Subrecursive Classes of Partial Recursive Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

    Chapter 3. DECIDABILITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    19. Universal Turing Machines and Undecidability of the Halting Problem . . . . . . . . . 87

    20. Rice Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    21. Post Correspondence Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    22. Decidability and Undecidability in Formal Languages . . . . . . . . . . . . . . . . . . . . . . . . . 98

    22.1 Decidable Properties of Deterministic Context-free Languages . . . . . . . . . . . 103

    22.2 Undecidable Properties of Deterministic Context-free Languages . . . . . . . . 104

    22.3 Summary of Decidability and Undecidability Results in Formal Languages 104

    23. Decidability and Undecidability of Tiling Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

    24. Arithmetical Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

    Chapter 4. COMPUTATIONAL COMPLEXITY . . . . . . . . . . . . . . . . . . . . . . . . . . 113

    25. Preliminary Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

    26. P and NP Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

    27. Problem Reducibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

    28. NP-complete Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

    28.1 Logarithmic-Space versus Polynomial-Time Reductions . . . . . . . . . . . . . . . . . 134

    28.2 NP-Complete Problems and Strongly NP-Complete Problems . . . . . . . . . . . 135

    28.3 NP Problems and co-NP Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

    28.4 Complete Problems and Hard Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

    28.5 Approximation Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

    28.6 Stratification of Complexity Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

    29. Computational Complexity Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

    29.1 Deterministic Space and Deterministic Time Hierarchies . . . . . . . . . . . . . . . . 142

    29.2 Relationships among Complexity Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

    29.3 Nondeterministic Space and Nondeterministic Time Hierarchies . . . . . . . . . 144

    29.4 Properties of General Complexity Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

    29.5 Computations with Oracles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

    30. Polynomial Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

    31. Invariance with respect to the Computational Model . . . . . . . . . . . . . . . . . . . . . . . . . 147

    32. Complexity Classes Based on Randomization and Probability . . . . . . . . . . . . . . . . 153

    33. Complexity Classes of Interactive Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

    34. Complexity Classes of Parallel Computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

    References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

  • Preface

    These lecture notes are intended to introduce the reader to the basic notions of com-putability theory, decidability, and complexity. More information on these subjects canbe found in classical books such as [6,8,15,16,33]. The results reported in these notes aretaken from those books and in various parts we closely follow their style of presentation.The reader is encouraged to look at those books for improving his/her knowledge onthese topics. Some parts of the chapter on complexity are taken from the lecture notesof a beautiful course given by Prof. Leslie Valiant at Edinburgh University, Scotland, in1979. It was, indeed, a very stimulating and enjoyable course.

    For the notions of Predicate Calculus we have used in this book the reader may referto [26].

    I would like to thank Dr.Maurizio Proietti at IASI-CNR (Roma, Italy), my colleagues,and my students at the University of Roma Tor Vergata and, in p