Computability and Complexity
Total Page:16
File Type:pdf, Size:1020Kb
Computability and Complexity Lecture Notes Winter Semester 2016/2017 Wolfgang Schreiner Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria [email protected] July 18, 2016 Contents List of Definitions5 List of Theorems7 List of Theses9 List of Figures9 Notions, Notations, Translations 12 1. Introduction 18 I. Computability 23 2. Finite State Machines and Regular Languages 24 2.1. Deterministic Finite State Machines...................... 25 2.2. Nondeterministic Finite State Machines.................... 30 2.3. Minimization of Finite State Machines..................... 38 2.4. Regular Languages and Finite State Machines................. 43 2.5. The Expressiveness of Regular Languages................... 58 3. Turing Complete Computational Models 63 3.1. Turing Machines................................ 63 3.1.1. Basics.................................. 63 3.1.2. Recognizing Languages........................ 68 3.1.3. Generating Languages......................... 72 3.1.4. Computing Functions.......................... 74 3.1.5. The Church-Turing Thesis....................... 79 Contents 3 3.2. Turing Complete Computational Models.................... 80 3.2.1. Random Access Machines....................... 80 3.2.2. Loop and While Programs....................... 84 3.2.3. Primitive Recursive and µ-recursive Functions............ 95 3.2.4. Further Models............................. 106 3.3. The Chomsky Hierarchy............................ 111 3.4. Real Computers................................. 118 4. Limits of Computability 120 4.1. Decision Problems............................... 120 4.2. The Halting Problem.............................. 123 4.3. Reduction Proofs................................ 127 4.4. Rice’s Theorem................................. 132 II. Complexity 137 5. Basics of Complexity 138 5.1. Complexity of Computations.......................... 138 5.2. Asymptotic Complexity............................. 143 5.3. Working with Asymptotic Complexity..................... 148 5.4. Complexity Classes............................... 151 6. Analysis of Complexity 155 6.1. Sums...................................... 158 6.2. Recurrences................................... 165 6.3. Divide and Conquer............................... 172 6.4. Randomization................................. 182 6.5. Amortized Analysis............................... 190 7. Limits of Feasibility 197 7.1. Complexity Relationships Among Models................... 197 7.2. Problem Complexity.............................. 201 7.3. NP-Complete Problems............................ 208 7.4. Complements of Problems........................... 213 Bibliography 219 4 Contents Index 220 © 2012– Wolfgang Schreiner. List of Definitions 1. Alphabet....................................... 25 2. DFSM........................................ 25 3. Word, Concatenation, Closure, Language..................... 27 4. Extended transition function............................ 28 5. Language of a DFSM................................ 29 6. Powerset....................................... 31 7. NFSM........................................ 31 8. Extended transition function............................ 33 9. Language and Acceptance of a NFSM....................... 33 10. State Equivalence, Bisimulation.......................... 38 11. State Partition.................................... 39 12. Regular Expression................................. 43 13. Language Concatenation and Closure....................... 44 14. Language of Regular Expressions......................... 45 15. Regular Language.................................. 45 16. Turing Machine................................... 63 17. Turing Machine Language............................. 68 18. Recursively Enumerable and Recursive Languages................ 69 19. Enumerator, Generated Language......................... 72 20. Functions...................................... 74 21. Turing Computability................................ 75 22. Random Access Machine.............................. 81 23. Loop Program Syntax................................ 84 24. Loop Program Semantics.............................. 85 25. Loop Computability................................. 86 26. While Program Syntax............................... 88 27. While Program Semantics............................. 89 28. While Computability................................ 90 6 Contents 29. Primitive Recursion................................. 96 30. µ-Recursion..................................... 102 31. Goto Programs................................... 107 32. Lambda calculus .................................. 108 33. Term Rewriting System............................... 110 34. Grammar...................................... 111 35. Language of a Grammar.............................. 111 36. Right Linear Grammars............................... 113 37. Type 2 Grammars and Machines.......................... 116 38. Type 1 Grammars and Machines.......................... 116 39. Decision Problem.................................. 120 40. Semi-Decidability and Decidability........................ 121 41. Halting Problem................................... 124 42. Reducibility..................................... 127 43. Property of Recursively Enumerable Language.................. 132 44. Complexity..................................... 138 45. Big-O notation, Big-Ω notation, Big-Θ notation .................. 143 46. Asymptotic Notation in Equations......................... 149 47. Little-o notation, Little-! notation ......................... 151 48. Logarithmic Cost Model of RAM......................... 200 49. Resource Consumption of Non-Deterministic Turing Machine.......... 201 50. Problem Complexity................................ 204 51. Problem Complexity Classes............................ 204 52. Verifier....................................... 205 53. Polynomial-Time-Reducibility........................... 208 54. NP-Completeness................................. 210 55. Satisfiability..................................... 212 56. co-NP ....................................... 214 © 2012– Wolfgang Schreiner. List of Theorems 1. Subset construction ................................. 35 2. DFSM Partitioning and Minimization ....................... 41 3. Equivalence of Regular Expressions and Automata................ 46 4. Arden’s Lemma................................... 56 5. Closure properties of Regular Languages..................... 58 6. Pumping Lemma .................................. 59 7. Nondeterministic Turing Machine......................... 67 8. Recursive Language................................. 69 9. Closure of Recursive Languages.......................... 71 10. Generated Langues................................. 72 11. Turing Computability................................ 78 12. Turing Machines and RAMs............................ 82 13. Function a "n b and Loops............................. 87 14. Computability of a "n b ............................... 88 15. Kleene’s Normal Form Theorem.......................... 91 16. Turing Machines and While Programs....................... 93 17. While Computability and Turing Computability.................. 95 18. Primitive Recursion and Loop Computability................... 99 19. µ-Recursion and While Computability....................... 103 20. Kleene’s Normal Form Theorem.......................... 105 21. Church-Rosser Theorem.............................. 108 22. Regular Languages and Right-Linear Grammars.................. 113 23. Recursively Enumerable Languages and Unrestricted Grammars......... 114 24. Chomsky hierarchy ................................. 115 25. Decidabilty of Complement............................. 122 26. Decidability..................................... 122 27. Decidability and Computability........................... 122 28. Turing Machine Code................................ 123 8 Contents 29. Undecidability of Halting Problem......................... 124 30. Word Enumeration................................. 124 31. Turing Machine Enumeration............................ 125 32. Reduction Proof................................... 127 33. Undecidability of Restricted Halting Problem................... 128 34. Undecidability of Acceptance Problem....................... 129 35. Semi-Decidability of the Acceptance Problem................... 130 36. The Non-Acceptance Problem........................... 131 37. Semi-Decidability of the Halting Problem..................... 131 38. Rice’s Theorem ................................... 133 39. Duality of O and Ω ................................. 145 40. Asymptotic Complexity of Polynomial Functions................. 147 41. Logarithms..................................... 147 42. Polynomial versus Exponential........................... 147 43. Asymptotic Bounds................................. 148 44. Asymptotic Laws.................................. 149 45. Further Asymptotic Equations........................... 150 46. Duality of o and ! ................................. 151 47. Properties of o and ! ................................ 152 48. Hierarchy of Complexity Classes.......................... 152 49. Master theorem ................................... 177 50. Complexity of Random Access Machine versus Turing Machine......... 200 51. Polynomial Time Verification............................ 206 52. Some Relationships Between Complexity Classes................. 206 53. Savitch’s Theorem................................