Undecidability and The Halting Problem

Slides:



Advertisements
Similar presentations
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
Advertisements

Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
Turing -Recognizable vs. -Decidable
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
Computability and Complexity 5-1 Classifying Problems Computability and Complexity Andrei Bulatov.
Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Costas Busch - RPI1 Undecidable problems for Recursively enumerable languages continued…
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
Computability and Complexity 7-1 Computability and Complexity Andrei Bulatov Recursion Theorem.
Recursively Enumerable and Recursive Languages
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Fall 2004COMP 3351 The Chomsky Hierarchy. Fall 2004COMP 3352 Non-recursively enumerable Recursively-enumerable Recursive Context-sensitive Context-free.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Linear Bounded Automata LBAs
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
CS21 Decidability and Tractability
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Fall 2003Costas Busch - RPI1 Turing Machines (TMs) Linear Bounded Automata (LBAs)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Decidability A decision problem is a problem with a YES/NO answer. We have seen decision problems for - regular languages: - context free languages: [Sections.
1 Section 14.2 A Hierarchy of Languages Context-Sensitive Languages A context-sensitive grammar has productions of the form xAz  xyz, where A is a nonterminal.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
CS 3813: Introduction to Formal Languages and Automata Chapter 12 Limits of Algorithmic Computation These class notes are based on material from our textbook,
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
CS 461 – Nov. 7 Decidability concepts –Countable = can number the elements  –Uncountable = numbering scheme impossible  –A TM undecidable –Language classes.
Turing -Recognizable vs. -Decidable
Recursively Enumerable and Recursive Languages
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
Decidability Decidable/Undecidable problems. Jaruloj Chongstitvatana Decidability2 Accepting: Definition Let T = (Q, , , , s) be a TM. T accepts.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Productions String of variables and terminals String of variables and terminals.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
Turing Machines- Cont. Theory of Computation Lecture 11 Tasneem Ghnaimat.
THE HALTING PROBLEM - PROOF. Review  What makes a problem decidable?  3 properties of an efficient algorithm?  What is the meaning of “complete”, “mechanistic”,
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Another famous undecidable problem: The halting problem.
1 Recursively Enumerable and Recursive Languages.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
Recursively Enumerable Languages
Recursively Enumerable and Recursive Languages
Linear Bounded Automata LBAs
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
MCC 2093 Advanced Theoretical Computer Science
LIMITS OF ALGORITHMIC COMPUTATION
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Undecidable Problems (unsolvable problems)
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
Undecidable problems:
Formal Languages, Automata and Models of Computation
CS21 Decidability and Tractability
More Undecidable Problems
Presentation transcript:

Undecidability and The Halting Problem CS 130 Theory of Computation HMU Textbook: Chap 9

Problems and Languages Decision problems can be captured as languages Example: The problem of determining whether a number is divisible by 7 corresponds to the language of all strings that form numbers divisible by 7 The finite automaton (or turing machine) for divisibility by 7 solves the problem and represents the language

Using a TM to solve a problem Recall the two possible interpretations of “solving” a problem through Turing Machines Device a TM so that acceptable (input) strings in the corresponding language are those that end up in a final state When not acceptable, we don’t need to care if the TM halts Device a machine so that it leaves YES on the tape when the string is acceptable, NO if not Note: steeper requirement than the first option

Undecidable problems A decision problem (or language) is decidable if there is a Turing Machine that solves that problem Leaves a YES on the tape when the string is acceptable, leaves a NO when it is not A problem (or language) is undecidable if there is no Turing Machine that solves (or decides) that problem The terms solvable/unsolvable are sometimes used instead of decidable/undecidable

The halting problem The Halting Problem (HP): Given a TM P and input i, does P halt on i? HP is undecidable That is, there is no program (turing machine) that solves HP If there was such a program Its input will have two portions, P and i It outputs either a YES or a NO depending on whether P halts on input i

HP is undecidable Proof by contradiction: suppose HP is decidable Plan: arrive at a contradiction If HP is decidable, then there exists a program A that solves HP: YES A P, i NO

HP is undecidable Create a program B based on A as follows: B takes in a program P In B, P is duplicated so that there are now two portions on the input tape Feed this new input into A When it is about to print NO, print YES instead When it is about to print YES, send the program to an infinite loop

HP is undecidable B A Program B takes a program P as input, infinite loop YES A make copy P P, P NO YES Program B takes a program P as input, prints a YES if P does not halt on input P, but goes into an infinite loop if P halts on input P

HP is undecidable Consider feeding program B to itself Consequence (two possibilities) It prints a YES B halts on input B if B does not halt on input B  a contradiction It goes to an infinite loop B does not halt on input B if B halts on input B  a contradiction Therefore the supposition cannot hold, and HP is undecidable

Feeding program B to itself infinite loop YES A make copy B B, B NO YES B halts on input B (prints a YES, see outer box) if B does not halt on input B (A should yield a NO, see inner box) B does not halt on input B (infinite loop, see outer box) if B halts on input B (A should yield a YES, see inner box)

Notes and Conclusions There are problems such as HP that cannot be solved Actually, HP is semidecidable, that is if all we need is print YES when P on i halts, but not worry about printing NO if otherwise, a TM machine exists for the halting problem Just simulate P on i, print YES (or go to a final state) when the simulation stops This means that HP is not recursive but it is recursively enumerable

HP and the Chomsky hierarchy semidecidable problems recursively enumerable HP solvable (decidable) problems recursive context-sensitive context-free regular