The Limits of Computation

Similar documents
Undecibability. Hilbert's 10th Problem: Give an algorithm that given a polynomial decides if the polynomial has integer roots or not.

CHAPTER 6. Copyright Cengage Learning. All rights reserved.

Set Theory. CSE 215, Foundations of Computer Science Stony Brook University

CSCI3390-Lecture 6: An Undecidable Problem

Principles of Computing, Carnegie Mellon University. The Limits of Computing

Introduction to Computer Science

Theory of Computation

Warm-Up Problem. Please fill out your Teaching Evaluation Survey! Please comment on the warm-up problems if you haven t filled in your survey yet.

Turing Machine Recap

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Lecture Notes: The Halting Problem; Reductions

NP-Complete and Non-Computable Problems. COMP385 Dr. Ken Williams

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

CS/MA 109 Quantitative Reasoning. Wayne Snyder Computer Science Department Boston University

Theory of Computation

Section 14.1 Computability then else

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 20. To Infinity And Beyond: Countability and Computability

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

1 Reals are Uncountable

Decidability and Undecidability

CS6902 Theory of Computation and Algorithms

Class 24: Computability

Notes for Lecture Notes 2

COMP Logic for Computer Scientists. Lecture 16

CSCI3390-Assignment 2 Solutions

CPSC 421: Tutorial #1

CS151 Complexity Theory. Lecture 1 April 3, 2017

COMP Logic for Computer Scientists. Lecture 16

CS Automata, Computability and Formal Languages

(a) Definition of TMs. First Problem of URMs

Assignment 3 Logic and Reasoning KEY

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

ECS 120 Lesson 20 The Post Correspondence Problem

Problems and Solutions. Decidability and Complexity

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

1 Computational Problems

A Universal Turing Machine

Introduction to Turing Machines. Reading: Chapters 8 & 9

A Note on Turing Machine Design

Chapter 4. Regular Expressions. 4.1 Some Definitions

The Binomial Theorem.

1 Definition of a Turing machine

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable

A Little History Incompleteness The First Theorem The Second Theorem Implications. Gödel s Theorem. Anders O.F. Hendrickson

Equivalent Variations of Turing Machines

CSCI 340: Computational Models. Regular Expressions. Department of Computer Science

Lecture 27: Theory of Computation. Marvin Zhang 08/08/2016

Q520: Answers to the Homework on Hopfield Networks. 1. For each of the following, answer true or false with an explanation:

CSE 105 Theory of Computation

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

Farewell (for now) to modular arithmetic...

Turing Machines Part Three

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

Embedded systems specification and design

Computer Sciences Department

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lecture 1 : Introduction

Decidability (What, stuff is unsolvable?)

7.2 Turing Machines as Language Acceptors 7.3 Turing Machines that Compute Partial Functions

Turing Machines Part III

ECS 120 Lesson 18 Decidable Problems, the Halting Problem

Problems, and How Computer Scientists Solve Them Manas Thakur

Formal Definition of a Finite Automaton. August 26, 2013

Automata Theory CS S-FR2 Final Review

Non-emptiness Testing for TMs

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

Data Structures in Java

ELEMENTS IN MATHEMATICS FOR INFORMATION SCIENCE NO.6 TURING MACHINE AND COMPUTABILITY. Tatsuya Hagino

Theory of Computation

HW6 Solutions. Micha l Dereziński. March 20, 2015

Busch Complexity Lectures: Turing s Thesis. Costas Busch - LSU 1

10. The GNFA method is used to show that

CS 21 Decidability and Tractability Winter Solution Set 3

Computability, Undeciability and the Halting Problem

that shows the semi-decidability of the problem (i.e. a semi-decision procedure for EXISTS-HALTING) and argue that it is correct.

FABER Formal Languages, Automata. Lecture 2. Mälardalen University

CS6901: review of Theory of Computation and Algorithms

Reductions in Computability Theory

Lecture 36: Other Non-computable Problems

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

Time Magazine (1984)

CS20a: Turing Machines (Oct 29, 2002)

1 Showing Recognizability

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5.

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

V Honors Theory of Computation

{a, b, c} {a, b} {a, c} {b, c} {a}

CSE 460: Computabilty and Formal Languages Turing Machine (TM) S. Pramanik

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Theory of Computation Turing Machine and Pushdown Automata

6.8 The Post Correspondence Problem

NP, polynomial-time mapping reductions, and NP-completeness

How to Make a Proof of Halting Problem More Convincing: A Pedagogical Remark

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

Transcription:

The Limits of Computation 7B Noncomputability 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 1 It gets worse... Tractable Problems Problems that have reasonable, polynomialtime solutions Intractable Problems Problems that have no reasonable, polynomialtime solutions Noncomputable Problems Problems that have no algorithms at all to solve them 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 2 1

Noncomputability and Undecidability An algorithmic problem that has no algorithm is called noncomputable. If the noncomputable algorithm requires a yes/no answer, the problem is called undecidable. Example: Given any set of any number of different tile designs (examples shown above), with an infinite number of each type of tile, can we tile any area with these tiles so that like colored edges touch? This problem is undecidable! 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 3 Tiling Problem YE Note the periodicity in the tiling. 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 4 2

Tiling Problem For this 3 X 3 room, if we try all 3 9 tiling configurations, no tiling works. 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 5 Tiling Problem Possible algorithm: If we find a repeating pattern, report YE. If we find a floor we cannot tile, report. BUT: there are some tilings which have no repeating pattern! 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 6 3

Tiling Problem The only way to know if this set of tiles can tile every finite-sized floor is to evaluate every possible floor. BUT: there are an infinite number of finite-sized floors! o we could never answer YE in this case. This problem is undecidable. 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 7 Word Correspondence Given a finite alphabet (e.g. {a, b}) Consider two groups (call them X and Y) of N words made from the alphabet. X Y 1 abb bbab 2 a aa 3 bab ab 4 baba aa 5 aba a Is there a way to concatenate words in the same sequence from X and Y to form the same word? 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 8 4

Word Correspondence equence: 2, 1, 1, 4, 1, 5 X: a + abb + abb + baba + abb + aba Y: aa + bbab + bbab + aa + bbab + a Both sequences yield aabbabbbabaabbaba Answer: yes 1 2 3 4 5 X abb a bab baba aba Y bbab aa ab aa a 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 9 Word Correspondence Consider the following word correspondence problem. Is there a solution this time? 1 2 3 4 5 X bb a bab baba aba Y bab aa ab aa a 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 10 5

Word Correspondence 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 11 Word Correspondence The word correspondence problem is undecidable. For any set of n pairs of words for a finite alphabet of any size, there is no general algorithm that can determine if there is a valid correspondence or not. If there were an algorithm, how would it know when to output an answer of? 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 12 6

Another Undecidable Problem: The Barber Paradox uppose there is a town with one male barber; and that every man in the town keeps himself clean-shaven: some shave themselves and some are shaved by the barber. Only the barber can shave another man. The barber shaves all and only those men who do not shave themselves. Does the barber shave himself? 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 13 Program Termination Can we determine if a program will terminate given a valid input? Example: 1. Input x 2. While x is not equal to 1, do the following: (a) ubtract 2 from x. Does this algorithm terminate when x = 15105? Does this algorithm terminate when x = 2008? 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 14 7

Program Termination Another Example: 1. Input x 2. While x is not equal to 1, do the following: (a) If x is even, divide x by 2. (b) Otherwise, et x to 3x + 1. Does this algorithm terminate for x = 15? Does this algorithm terminate for x = 105? Does this algorithm terminate for any positive x? 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 15 Program Termination uestion: Does an program exist that can take any program P and an input I and determine if P terminates/halts when run with input I? 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 16 8

What is a program anyway? A computer program is simply a long string of characters. Example: Program P is stored in the computer as one long string. Program P(I); output I*2; end. Program P requires one input I. Program P(I); output I*2; end. 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 17 A program that runs a program Let be a program that takes another program P (as a string) and an input I, and runs P using input I. Program (P,I); run P(I); end. Program P(I); output I*2; end. runs program P, feeding it input I 15105 P 30210 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 18 9

The Halting Problem Can we write a general program that takes as its input any program P and an input I and determines if program P will terminate (halt) when run with input I? It will answer YE if P terminates successfully on input I. It will answer if P never terminates on input I. This computational problem is undecidable! No such general program can exist! 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 19 The Halting Problem (1) Assume a program exists that requires a program P and an input I. determines if program P will halt when P is executed using input I. P I YE We will show that can never exist through contradiction. outputs YE if P halts when run with input I outputs if P does not halt when run with input I 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 20 10

The Halting Problem (2) Define a new program that takes a program W as its input. W 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 21 The Halting Problem (3) feeds W as the inputs for as the program and the program's input. W W W 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 22 11

The Halting Problem (4) Then looks at the answer gives. If answers YE, purposely forces itself into an infinite loop. If answers, halts with an output of OK. W W W YE OK 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 23 The Halting Problem (5) ince requires as its input a program, and is a program, what happens if the input to is itself? YE OK 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 24 12

The Halting Problem (6) Put another way, asks : What do I do if I execute using myself as input? YE OK 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 25 The Halting Problem (7) If outputs YE, it computes that will halt if it uses itself as input. But if outputs YE, purposely goes into an infinite loop when it uses itself as input. YE OK 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 26 13

The Halting Problem (8) If outputs, it computes that will not halt if it uses itself as input (i.e. it will run forever). But if outputs, purposely halts with the output OK when it uses itself as input. YE OK 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 27 The Halting Problem (9) We get contradictions no matter what outputs. Our initial assumption must have been false! can't exist! YE OK 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 28 14

The Halting Problem is Undecidable We can never write a computer program that determines if ANY program halts with ANY input. It doesn t matter how powerful the computer is. It doesn t matter how much time we devote to the computation. It s undecidable! 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 29 Contradiction isn't just for computer scientists... 15-105 Principles of Computation, Carnegie Mellon University - CORTINA 30 15