Lecture 4: Unsolvable Problems

Slides:



Advertisements
Similar presentations
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Advertisements

1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
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)
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.
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.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
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.
A Universal Turing Machine
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)
Lecture 3: Count Programs, While Programs and Recursively Defined Functions 虞台文 大同大學資工所 智慧型多媒體研究室.
Recursively Enumerable and Recursive Languages
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:
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 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
 2005 SDU Lecture14 Mapping Reducibility, Complexity.
Chapters 11 and 12 Decision Problems and Undecidability.
The Acceptance Problem for TMs
A Universal Turing Machine
Recursively Enumerable and Recursive Languages
Automata, Grammars and Languages
This statement is false.
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
CSE 311 Foundations of Computing I
Reductions.
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
BCS 2143 Theory of Computer Science
Computing with Turing Machines
LIMITS OF ALGORITHMIC COMPUTATION
Turing Machines Acceptors; Enumerators
NP-Completeness Yin Tat Lee
Homework: Friday Read Section 4.1. In particular, you must understand the proofs of Theorems 4.1, 4.2, 4.3, and 4.4, so you can do this homework. Exercises.
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
Functional Properties and Problem Reduction
Decidable Languages A language L is decidable if there is a Turing machine ML such that given any word w  0*, then: Input of ML: a  b  … w Output of.
Undecidable problems:
MA/CSSE 474 Theory of Computation
Proposed in Turing’s 1936 paper
Formal Languages, Automata and Models of Computation
Instructor: Aaron Roth
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Decidability continued….
Instructor: Aaron Roth
Automata, Grammars and Languages
More Undecidable Problems
Turing Machines Everything is an Integer
MA/CSSE 474 Theory of Computation
Presentation transcript:

Lecture 4: Unsolvable Problems 虞台文 大同大學資工所 智慧型多媒體研究室

Content Enumerable and Decidable Sets Algorithm Solvability Problem Reduction Diagonalization Method

Lecture 4: Unsolvable Problems Enumerable and Decidable Sets 大同大學資工所 智慧型多媒體研究室

Set Enumerability and Generability A  * is enumerable (generable) if  computable function g: N* such that If g is not totally defined, then D(g)={0, 1, …, k 1}.

The Generation Process Enumerable (Generable) The Generation Process A = = = Generate =

The Enumeration Process Enumerable (Generable) The Enumeration Process A  = Enumerate  =   =

The Enumeration Process Enumerable (Generable) The Enumeration Process Is such a process always terminable? A  = Enumerate  =   =

The Enumeration Process Enumerable (Generable) The Enumeration Process A  = Enumerate  =  =

Enumerable (Generable) The Labeling Process A  = Labeling  =  = 2

Exercises Write two algorithms to enumerate (generate) the set of all even numbers of integer in different sequences. What is difference between ‘countable’ (studied in discrete math) and `enumerable’?

The Countability of Real Number Is R countable? Is (0,1)R countable?

Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: f0 f1 f2 f3 f4 d01 d02 d03 d04 d00 d11 d12 d13 d14 d10 d21 d22 d23 d24 d20 d31 d32 d33 d34 d30 d41 d42 d43 d44 d40 0. 1 2 3 4 …

Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: f0 f1 f2 f3 f4 d01 d02 d03 d04 d12 d13 d14 d10 d21 d23 d24 d20 d31 d32 d34 d30 d41 d42 d43 d40 0. 1 2 3 4 … Consider the following number: d00 d11 d22 d33 d44 …

Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: f0 f1 f2 f3 f4 d01 d02 d03 d04 d12 d13 d14 d10 d21 d23 d24 d20 d31 d32 d34 d30 d41 d42 d43 d40 0. 1 2 3 4 … Consider the following number: d00 d11 d22 d33 d44 … … v=fk 0. h0 h1 h2 h3 h4 …

Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: f0 f1 f2 f3 f4 d01 d02 d03 d04 d12 d13 d14 d10 d21 d23 d24 d20 d31 d32 d34 d30 d41 d42 d43 d40 0. 1 2 3 4 … Consider the following number: d00 d11 d22 d33 d44 … … v=fk 0. h0 h1 h2 h3 h4 …

Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: f0 f1 f2 f3 f4 d01 d02 d03 d04 d12 d13 d14 d10 d21 d23 d24 d20 d31 d32 d34 d30 d41 d42 d43 d40 0. 1 2 3 4 … Consider the following number: d00 d11 d22 d33 d44 … … v=fk 0. h0 h1 h2 h3 h4 …

Semidecidability A True False or Never Halt A  * is semidecidable if there exists an algorithm which, when applying to any   A, can decide that  is in A, i.e., there exists an membership algorithm for A. A True False or Never Halt

Theorem 1 “” Pf) A is enumerable iff A is semidecidable.  g: N* such that g(N)=A. Hence, given any A, we generate strings g(0)=0 g(1)=1 . . . . . . . . Then, we will finally reach g(k) = k = . This allows us to concludes that A.

There exists an membership algorithm  for A on TM such that We have Want Theorem 1 A is enumerable iff A is semidecidable. Pf) “” Thinking first. What do we know? There exists an membership algorithm  for A on TM such that A is semidecidable How to prove? Find g such that

Theorem 1 “” Pf) A is enumerable iff A is semidecidable. We have Want Theorem 1 A is enumerable iff A is semidecidable. Pf) “” Numbering the following black cells Preliminaries 1 2 3 4 5 6 7 8 9 10

Theorem 1 “” Pf) A is enumerable iff A is semidecidable. We have Want Theorem 1 A is enumerable iff A is semidecidable. Pf) “” Numbering the following black cells Preliminaries 1 2 3 4 5 6 7 8 9 10 6  = {0, 1} * = {, 0, 1, 00, 01, 10, 11, 000, …} 1 5 2 3 Enumerable 0 1 2 3 4 5 6 7 4 7

Theorem 1 “” Pf) A is enumerable iff A is semidecidable. We have Want Theorem 1 A is enumerable iff A is semidecidable. Pf) “” Step 1. Set n = k + 1. Step 2. List the first n strings Step 3. Hand simulates n steps of  on TM for each The algorithm to generate g(k):

Theorem 1 - “” Pf) Terminating Record We have Want Theorem 1 A is enumerable iff A is semidecidable. Pf) “” Step 1. Set n = k + 1. 1 2 3 4 5 6 7 8 9 10 0 n Steps n1 - Step 2. List the first n strings Step 3. Hand simulates n steps of  on TM for each The algorithm to generate g(k): Terminating Record

Theorem 1 - “” Pf) A is enumerable iff A is semidecidable. 0 n1 We have Want Theorem 1 A is enumerable iff A is semidecidable. Pf) “” Step 1. Set n = k + 1. 1 2 3 4 5 6 7 8 9 10 0 n Steps n1 - Step 2. List the first n strings Step 3. Hand simulates n steps of  on TM for each The algorithm to generate g(k): Step 4. Let m= #terminating computations. Step 5. if m < k + 1 n= n + 1; goto Step 2; else return the kth string. k

Theorem 2 A is enumerable iff A is a domain of some computable functions. Pf) Exercise

Theorem 2 How about if A is not enumerable? A is enumerable iff A is a domain of some computable functions. How about if A is not enumerable?

Discussion Program Computability Enumeration Enumeration (Some reformation may be required) Enumeration Membership Determination (Semidecidability)

Complement Set

Decidable Set A  * is decidable if there exists an computable function, say, D such that

Theorem 3 A is decidable iff and are enumerable. A is decidable iff and are semidecidable.

Theorem 3 g: Pf) “” Fact: * can be enumerated as 0, 1, 2, … enumerable. A is decidable iff and are semidecidable. Theorem 3 Pf) “” Show that A is enumerable as follows: Fact: * can be enumerated as 0, 1, 2, … Since A is decidable,  a computable function D st. The computable function g to enumerate A can be: D: 0 1 2 3 4 . . . g: t f . . . A is enumerable. g(0) g(1) g(2) . . .

Theorem 3 h: Pf) “” Fact: * can be enumerated as 0, 1, 2, … enumerable. A is decidable iff and are semidecidable. Theorem 3 Pf) “” Show that is enumerable as follows: Fact: * can be enumerated as 0, 1, 2, … Since A is decidable,  a computable function D st. The computable function h to enumerate can be: D: 0 1 2 3 4 . . . h: t f . . . is enumerable. h(0) . . . h(1)

Theorem 3 Pf) “” Suppose 1 semidecides A, 2 semidecides . enumerable. A is decidable iff and are semidecidable. Theorem 3 Pf) “” Suppose 1 semidecides A, 2 semidecides . For any *, input it to 1 and 2 simultaneously. If 1 terminates, return true. If 2 terminates, return false.

Lecture 4: Unsolvable Problems Algorithm Solvability 大同大學資工所 智慧型多媒體研究室

Enumeration, Decidability and Solvability (Semidecidability) Decidability: Solvability: To deal with the existence of algorithm (program) to solve problems. That is, given a problem, whether there exists a program to solve (any instance of) the problem.

Example Problem (PE: Program Equivalence): PE q = “Are program 1 and program 2 equivalent?” Any Algorithm?

Example Problem (PE: Program Equivalence): PE Solvable? Computable? Example Problem (PE: Program Equivalence): PE q = “Are program 1 and program 2 equivalent?” Decidable? string to represent 1 string to represent 2

Example Problem PE is solvable iff A is decidable (recursive). Solvable? Computable? Problem Reformulation Example Problem (PE: Program Equivalence): PE q = “Are program 1 and program 2 equivalent?” Decidable? Problem PE is solvable iff A is decidable (recursive). string to represent 1 string to represent 2

Definitions Semisolvable: Solvable: Totally Unsolvable: if q is true, it answers ‘yes’. if q is false, it may not give answer (never halt).  algorithm if q is true, it answers ‘yes’. if q is false, it answers ‘no’.  algorithm not semisolvale.

Problem and Complement Problem

Problem and Complement Problem Example: Turing Machine Version

Problem and Complement Problem Example: Register Machine Version

? Theorem 4 Pf) P is solvable iff and are semisolvable. “” algorithm P such that if q is true, it answers ‘yes’. if q is false, it answers ‘no’. To show that P is semisolvable, we need to find a algorithm ’ such that ?

Theorem 4 ’: Pf) P is solvable iff and are semisolvable. “”  algorithm P such that if q is true, it answers ‘yes’. if q is false, it answers ‘no’. To show that P is semisolvable, we need to find a algorithm ’ such that START P TRUE HALT  true false ’: q It can be

Theorem 4 ”: Pf) P is solvable iff and are semisolvable. “”  algorithm P such that if q is true, it answers ‘yes’. if q is false, it answers ‘no’. To show that is semisolvable, we need to find a algorithm ” such that START P TRUE HALT  false true ”: q It can be

Theorem 4 Pf) P is solvable iff and are semisolvable. “” To run ’ and ” alternatively, if ’ answers ‘yes’, then ‘yes’; if ” answers ‘yes’, then ‘no’.

Corollary P is solvable iff and are semisolvable. P is semisolvable but not solvable is totally unsolvable.

The Halting Problem Register Machine Version Turing Machine Version More simple, The Halting Problem Register Machine Version Turing Machine Version

 Theorem 5  會停嗎? The HP (halting problem) is not solvable. … Sk1 Sk Sk+1 Sn1 Sn … Blank Tape Head START  HALT 會停嗎? We will prove a simpler version.

 Theorem 5  會停嗎? The HP (halting problem) is not solvable. … S1 S2 Head START  HALT S1 S2 Sk1 Sk Sk+1 Sn1 Sn … Blank Tape 會停嗎?

Theorem 5 Pf) The HP (halting problem) is not solvable. Assume that HP is solvable. algorithm, given  and <, 1>, can tell whether  will halt on <, 1>. Define We can have an algorithm, say, decide to decide the elements of A. That is,

Theorem 5 Pf) What are done by strange? decide The HP (halting problem) is not solvable. Construct strange by making use of decide Pf) START Duplicate  as  @ HALT decide  true false What are done by strange?

Theorem 5 Pf) decide The HP (halting problem) is not solvable.  Construct strange by making use of decide Pf) START Duplicate  as  @ iff decide true false  HALT

Theorem 5 Pf) decide The HP (halting problem) is not solvable. The input to strange is a program’s string, say, . strange will never halt on  if and only if program  will halt on feeding its code as input parameter. The HP (halting problem) is not solvable. Construct strange by making use of decide Pf) START Duplicate  as  @ iff decide true false  HALT

Theorem 5 The HP (halting problem) is not solvable. Pf) Assume that HP is solvable. . . . . . . . . . . . . . . . . iff iff

Theorem 5 START Duplicate  as  @ HALT decide  true false The HP (halting problem) is not solvable. Pf) Assume that HP is solvable. . . . . . . . . . . . . . . . . iff iff

Trivial Theorem 6 Pf) The HP (halting problem) is semisolvable. The HP (halting problem) is not solvable. Theorem 6 The HP (halting problem) is semisolvable. Pf) Trivial (Run it)

The Non-Halting Problem (NHP) Register Machine Version Turing Machine Version

Theorem 7 The NHP is not semisolvable. The NHP is totally unsolvable.

Lecture 4: Unsolvable Problems Problem Reduction 大同大學資工所 智慧型多媒體研究室

Is a Problem Solvable? Methods to identify the problems’ solvability: Problem Reduction Diagonalization method Rice’s Theorem

Problem Reduction r: Let P and P’ be two problems. If there is an algorithm (r) which will map any qP into q’P st. q is true iff q’ is true. Then, we say that problem P reduces to P’.

Conceptually, P’ is larger. Problem Reduction r: Let P and P’ be two problems. If there is an algorithm (r) which will map any qP into q’P st. q is true iff q’ is true. Then, we say that problem P reduces to P’.

r: Discussion How about P? semisolvable If P’ is solvable q is true iff q’ is true. semisolvable How about P? If P’ is solvable

r: Discussion semisolvable semisolvable If P’ is P is solvable q is true iff q’ is true. semisolvable semisolvable If P’ is P is solvable solvable

r: Discussion How about P’? semisolvable If P is solvable q is true iff q’ is true. semisolvable How about P’? If P is solvable

r: Discussion semisolvable If P is P’ is ????????? solvable q is true iff q’ is true. semisolvable If P is P’ is ????????? solvable

r: Discussion How about P? not solvable If P’ is totally unsolvable q is true iff q’ is true. not solvable How about P? If P’ is totally unsolvable

r: Discussion not solvable If P’ is P is ???????? totally unsolvable q is true iff q’ is true. not solvable If P’ is P is ???????? totally unsolvable

r: Discussion How about P’? not solvable If P is totally unsolvable q is true iff q’ is true. not solvable How about P’? If P is totally unsolvable

r: Discussion not solvable not solvable If P is P’ is totally totally q is true iff q’ is true. not solvable not solvable If P is P’ is totally unsolvable totally unsolvable

Discussion r:

Theorem 8 The halting-problems for TM(), R, SR, SR2, … are semisolvable but not solvable. r:

Theorem 9 The problem of TM equivalence (PE) is totally unsolvable. Any Algorithm?

Theorem 9 The problem of TM equivalence (PE) is totally unsolvable. Pf) Fact: NHP is totally unsolvable. Method of problem reduction: Find r st. iff How?

Theorem 9 doesn’t halt on <k, 1> The problem of TM equivalence (PE) is totally unsolvable. Pf) Fact: NHP is totally unsolvable. ? START Input = <, k>? true  false START   HALT

Theorem 9 doesn’t halt on <k, 1> The problem of TM equivalence (PE) is totally unsolvable. Pf) Fact: NHP is totally unsolvable. ? START Input = <, k>? true  false START   HALT

Lecture 4: Unsolvable Problems Diagonalization Method 大同大學資工所 智慧型多媒體研究室

Example Can you write such a program? Show that HP is not solvable using diagonalization method. Fact: The set of all programs is enumerable. (why?) Let be the string representation of all programs. Suppose that HP is solvable. Then, we can have the following termination record: Construct strange such that: 0 1 2 3 . 1 … . . . Can you write such a program?

Example Show that HP is not solvable using diagonalization method. Fact: The set of all programs is enumerable. (why?) Let be the string representation of all programs. Suppose that HP is solvable. Then, we can have the following termination record: Construct strange such that: 0 1 2 3 . 1 … . . . . k 1 …

Example Show that HP is not solvable using diagonalization method. Fact: The set of all programs is enumerable. (why?) Let be the string representation of all programs. Suppose that HP is solvable. Then, we can have the following termination record: Construct strange such that: 0 1 2 3 . 1 … . . . . k 1 …

Theorem 10 Pf) The total function problem is totally unsolvable. totally unsolvable  not semisolvable Theorem 10 The total function problem is totally unsolvable. Pf) Assume it is semisolvable. Then, we can enumerate the all total function as: Let x1 be the input/output register. Totally defined functions Then,

Theorem 10 Pf) The total function problem is totally unsolvable. totally unsolvable  not semisolvable Theorem 10 The total function problem is totally unsolvable. Pf) Assume it is semisolvable. . . . . . . . . . . . . . . . . . . . . . Define Clearly, g is total.

Theorem 10 Pf) The total function problem is totally unsolvable. totally unsolvable  not semisolvable Theorem 10 The total function problem is totally unsolvable. Pf) Assume it is semisolvable. . . . . . . . . . . . . . . . . . . . . . Define Clearly, g is total.

Theorem 10 Pf) The total function problem is totally unsolvable. totally unsolvable  not semisolvable Theorem 10 The total function problem is totally unsolvable. Pf) Assume it is semisolvable. . . . . . . . . . . . . . . . . . . . . . Define Clearly, g is total.

Theorem 11 There is a total function which is not the associate function of any count program. While programs Total Functions Count programs

Exercises Special halting problem (SHP) and general halting problem (GHP) are defined as follows: Prove: If GHP is not solvable, then SHP is not solvable. If SHP is not solvable, then GHP is not solvable.

Exercises Special equivalence problem (SE) is defined as: Show that SE is not solvable. General equivalence problem (GE) is defined as: Show that GE is not solvable.

Exercises Define Show that MEMBER is not solvable.