Chapters 11 and 12 Decision Problems and Undecidability.

Slides:



Advertisements
Similar presentations
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Advertisements

Variants of Turing machines
Cook’s Theorem The Foundation of NP-Completeness.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Decidable A problem P is decidable if it can be solved by a Turing machine T that always halt. (We say that P has an effective algorithm.) Note that the.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
Recursively Enumerable and Recursive Languages
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.
CHAPTER 4 Decidability Contents Decidable Languages
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Homework #9 Solutions.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
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.
Chapter 9 Turing Machine (TMs).
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
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.
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.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
Recursively Enumerable and Recursive Languages
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
Decidability Decidable/Undecidable problems. Jaruloj Chongstitvatana Decidability2 Accepting: Definition Let T = (Q, , , , s) be a TM. T accepts.
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
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.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
The Acceptance Problem for TMs
Recursively Enumerable Languages
Recursively Enumerable and Recursive Languages
PROPERTIES OF REGULAR LANGUAGES
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
CSE 105 theory of computation
LIMITS OF ALGORITHMIC COMPUTATION
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
COSC 3340: Introduction to Theory of Computation
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Turing acceptable languages and Enumerators
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
Turing acceptable languages and Enumerators
Proposed in Turing’s 1936 paper
Formal Languages, Automata and Models of Computation
CSE 105 theory of computation
Instructor: Aaron Roth
Instructor: Aaron Roth
Decidability continued….
Turing Machines Everything is an Integer
CSE 105 theory of computation
Presentation transcript:

Chapters 11 and 12 Decision Problems and Undecidability

Decision Problems n A decision problem  consists of a set of questions whose answers are either yes or no  is undecidable if no algorithm that can solve the problem; otherwise, it is decidable n The Church-Turing thesis asserts that  a decision problem P has a solution if, and only if, there exists a TM that determines the answer for every p  P  if no such TM exists, the problem is said to be undecidable n An unsolvable problem  is a problem such that there does not exist any TM that can solve the problem

3 Decision Problems n Algorithm L that solves a decision problem should be effective, i.e.,  Complete: L produces the correct answer (yes/or) to each question (of the problem)  Mechanistic: L consists of a finite sequence of instructions  Deterministic: L produces the same result for the same input n The Church-Turing Thesis for Computable Functions:  A function f is effective, i.e., effectively computable, if and only if there is a TM that computes f.

Recursive Languages n Defn. A recursive language L is a formal language for which there exists a TM that will halt and accept an input string in L, and halt and reject, otherwise.  Example The decision problem of determining whether a natural number is a perfect square (represented by using the string a n ) is decidable.  Example The decision problem of determining whether there is a path P from node v i to a node v j in a directed graph G (with nodes v 1, …, v n ) using a NTM M with 2-tape is decidable. G is represented over {0, 1} as Encode v k (1  k  n) as 1 k+1, and arc (v s,v t ) as 1 s t+1 Separate each arc by 00; three 0’s separate G and v i and v j Write v i (as v s ) on tape 2 and consider each arc (v s,v t ) in G M accepts, if v t = v j, or rejects if v t has been visited/no edge

5 n The halting problem Given an arbitrary TM M with input alphabet  and a string w   *, will the computation of M with w halt? n There is no algorithm that solves the halting problem, i.e., the halting problem is undecidable. n A solution to the halting problem requires a general algorithm that answers the halting question for each combination of TM and input string.  Proposed solution: encode the TM M and the string w as an input over the alphabet { 0, 1 } and tape alphabet { 0,1, B } with { q 0, q 1, …, q n } being the states of M and q 0 is the start state The Halting Problem for TMs

6 n Consider the following encoding scheme (as shown in Section 11.5): SymbolEncoding B 111 q 0 1 q 1 11 … … q n 1 n+1 L 1 R 11 Let en(Z) denotes the encoding of a symbol Z. A transition  (q i, X) = [q j, Y, d] is encoded by the string en(q i ) 0 en(X) 0 en(q j ) 0 en(Y) 0 en(d) where 0’s separate the components of the transition, 2 0s separate transitions, and 3 0s designate the beginning & end of the encoding 12.1 The Halting Problem for TMs

7 n We can construct a TM to determine whether an arbitrary string u  { 0, 1 }* is the encoding of a DTM M. n Theorem The halting problem of TMs is undecidable. Proof. The proof is by contradiction. Assume that there is a TM H that solves the halting problem. A string z is accepted by H if (i) z consists of the representation of a TM M following by a string W, and (ii) the computation of M with input W halts. If either of these conditions is not satisfied, then H rejects the input. …

Recursive vs. Recursively Enumerable Languages n Defn. A recursively enumerable language L is a formal language for which there exists a TM that will halt and accept an input string in L, and may either (i) halt and reject, or (ii) loop forever, otherwise. n Defn. A recursive language L is a formal language for which there exists a TM that will halt and accept an input string in L, and halt and reject, otherwise. n Corollary The recursive languages are a proper subset of recursively enumerable languages. Proof. Let a language L be L H = { R(M)w | R(M) is the representation of a TM M and M halts with input w } over { 0, 1 }* is recursively enumerable according to Theorem (i.e., L H is recursively enumerable). L H is not recursive according to Corollary , which states that the language L H is not recursive.

Recursive vs. Recursively Enumerable Languages n Given that L and P are two recursively enumerable languages, then the following languages are recursively enumerable:  The union, L  P  The intersection, L  P  The concatenation LP of L and P  The Kleene star L * of L n Recursively enumerable languages are not closed under set difference or complementation, i.e., given two recursively enumerable languages L and P  If L is also recursively enumerable, then L is recursive  L – P may or may not be recursively enumerable, since L – P = L  L  P

Recursive vs. Recursively Enumerable Languages n The union of two recursively enumerable languages is recursively enumerable Proof. Let L 1 and L 2 be two recursively enumerable languages accepted by TMs M 1 and M 2, respectively. We show that L 1  L 2 is accepted by a 2-tape TM M. Let x = w 1  w 2. To determine if M 1 or M 2 accepts x, i.e., w 1  L 1 or w 2  L 2, run both M 1 & M 2 on x simultaneously using the 2-tape TM M. M simulates M 1 on the first tape & M 2 on the second tape. If either one of the TM enters the final state and halts, then the input x is accepted by M, i.e., x M1M1 M2M2 Yes M

Recursive vs. Recursively Enumerable Languages n If the languages L and L are recursively enumerable, then L is recursive. Proof. Let M 1 & M 2 be two TMs, such that L = L(M 1 ) and L = L( M 2 ). Construct a 2-tapeTM that simulates M 1 & M 2 in parallel, with M 1 on tape 1 & M 2 on tape 2. If an input x to M is in L, then M 1 halts & accepts x, and hence M accepts x and halts. If input x to M is not in L, hence it is in L, then M 2 accepts and halts for x and M halts w/o accepting. Hence, M halts with every input and L = L(M), and L is recursive. x M1M1 M2M2 Accept Reject M Accept

Recursive vs. Recursively Enumerable Languages n Given that L and P are two recursive languages, then the following languages are recursive as well:  The union, L  P  The intersection, L  P  The difference, L – P  The complement of L, L  The concatenation LP of L and P  The Kleene star L * of L n Recursively languages L and P are closed under set difference, since L – P = L  L  P

Recursive vs. Recursively Enumerable Languages n Given that L is a recursive language and P is a recursively enumerable language, then the following languages are recursively enumerable as well:  The union, L  P  The intersection, L  P  The concatenation LP of L and P  The difference, P – L (but not L – P)

Recursive vs. Recursively Enumerable Languages n The intersection of a recursive language L 1 & a recursively enumerable language L 2 is recursively enumerable Proof. Let L 1 and L 2 be the languages accepted by TMs M 1 and M 2, respectively. We show that L 1  L 2 is accepted by a TM M which halts and accepts an input string x if x  L 1  L 2. M simply simulates M 1 & M 2 one after the other on the same input x. If M 1 halts and accepts x, M clears the tape, copies x on the tape & starts simulating M 2. If M 2 also halts & accepts x, then M accepts x. Clearly, M accepts L 1  L 2, and if M 1 & M 2 halts on all inputs, then M also halts on all inputs x M1M1 M2M2 Yes M

The Church-Turing Thesis n The Church-Turing thesis asserts that every solvable decision problem can be transformed into an equivalent Turing machine problem. n The Church-Turing thesis for decision problems: There is an effective procedure to solve a decision problem if, and only if, there is a TM that halts for all input strings and solves the problem.  A solution to a decision problem is a equivalent to the question of membership in a recursive language. n The Church-Turing thesis for Recognition Problems: A decision problem P is partially solvable if, and only if, there is a TM that accepts precisely the instances of P whose answer is “yes”.  A partial solution to a decision problem is equivalent to the question of membership in a recursively enumerable language.

A Universal Machine n Universal Turning machine (U)  designed to simulate the computations of any TM M  Accepts the input R(M)w, whenever M (accepts by halting) halts with w  Loop whenever M does not halt with w  U accepts the set of strings in L(U), which consists of all strings R(M)w for which M halts with input w  U represents the entire family of TMs, since the outcome of the computation of any TM M with input w can be obtained by the computation of U with input R(M)w Universal Machine U M halts with input w M does not halt with w Accept Loop R(M)wR(M)w

A Universal Machine n Theorem The language L H = { R(M)w | M halts with input w } is recursively enumerable. Proof. Use a deterministic 3-tape TM U to accept L H by halting, where 1) an input string S is placed on tape 1 and U moves indefinitely to the right if S does not have the form R(M)w 2) the computation of M with w, which is copied to tape 3, is simulated on tape 3 3) the current state, i.e., start state q 0, is encoded as ‘1’ on tape 2 4) let x be the symbol on tape 3 and q i the state encoded on tape 2: a) Scan tape 1 for en(q i ) and en(x). If such transition does not exist, U halts and accepts S. (* Recall that U accepts by halting *) b) Otherwise, en(q i ) 0 en(x) 0 en(q j ) 0 en(y) 0 en(d) exists. Then i. Replace en(q i ) by en(q j ) on tape 2. ii. Write y to tape 3. iii. Move the tape head of tape 3 in the direction of d. 5) Repeat Step 4 to simulate the next transition of M.