890 likes | 1k Views
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.
E N D
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 functiong: N* such that If g is not totally defined, then D(g)={0, 1, …, k 1}.
= = = = Enumerable (Generable) The Generation Process A Generate
= = = Enumerable (Generable) The Enumeration Process A Enumerate
= = = Enumerable (Generable) The Enumeration Process Is such a process always terminable? A Enumerate
= = = 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?
… 0 1 2 3 4 … d00 d01 d02 d03 d04 0. f0 … d10 d11 d12 d13 d14 0. f1 … d20 d21 d22 d23 d24 0. f2 … d30 d31 d32 d33 d34 0. f3 … d40 d41 d42 d43 d44 0. f4 … … … … … … … … Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as:
… 0 1 2 3 4 … d01 d02 d03 d04 0. f0 … d10 d12 d13 d14 0. f1 … d20 d21 d23 d24 0. f2 … d30 d31 d32 d34 0. f3 … d40 d41 d42 d43 0. f4 … … … … … … … Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: Consider the following number: d00 d11 d22 d33 d44 …
… 0 1 2 3 4 … d00 d01 d02 d03 d04 0. f0 … d10 d11 d12 d13 d14 0. f1 … d20 d21 d22 d23 d24 0. f2 … d30 d31 d32 d33 d34 0. f3 … d40 d41 d42 d43 d44 0. f4 … … … … … … … … 0. h0 h1 h2 h3 h4 v=fk … … … … … … … Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: Consider the following number: …
… 0 1 2 3 4 … d00 d01 d02 d03 d04 0. f0 … d10 d11 d12 d13 d14 0. f1 … d20 d21 d22 d23 d24 0. f2 … d30 d31 d32 d33 d34 0. f3 … d40 d41 d42 d43 d44 0. f4 … … … … … … … … … … … … … … … Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: Consider the following number: … 0. h0 h1 h2 h3 h4 v=fk
… 0 1 2 3 4 … d00 d01 d02 d03 d04 0. f0 … d10 d11 d12 d13 d14 0. f1 … d20 d21 d22 d23 d24 0. f2 … d30 d31 d32 d33 d34 0. f3 … d40 d41 d42 d43 d44 0. f4 … … … … … … … … … … … … … … … Prove (0,1)R is uncountable Assume that (0, 1) is countable. Suppose that it is counted as: Consider the following number: … 0. h0 h1 h2 h3 h4 v=fk
A Semidecidability 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. True False or Never Halt
Theorem 1 Ais enumerable iff A is semidecidable. “” Pf) Ais enumerable g: N* such that g(N)=A. Hence, given any A, we generate strings . . . . . . . . g(1)=1 g(0)=0 Then, we will finally reach g(k) = k = . This allows us to concludes that A.
We have Want Theorem 1 Ais 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
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 We have Want Theorem 1 Ais enumerable iff A is semidecidable. “” Pf) Numbering the following black cells Preliminaries
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 7 3 4 5 6 0 1 2 8 9 10 Enumerable We have Want Theorem 1 Ais enumerable iff A is semidecidable. “” Pf) Numbering the following black cells Preliminaries 6 = {0, 1} 0 * = {, 0, 1, 00, 01, 10, 11, 000, …} 1 5 2 3 4 7
We have Want Theorem 1 Ais 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):
- 0 n1 0 1 2 3 4 5 6 7 8 9 1 2 3 n Steps 4 5 6 7 8 9 10 We have Want Theorem 1 Ais 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): Terminating Record
- 0 n1 0 1 2 3 4 5 6 7 8 9 1 2 3 n Steps 4 5 6 7 8 9 10 We have Want Theorem 1 Ais 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): 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 Ais enumerable iff A is a domain of some computable functions. Pf) Exercise
Theorem 2 Ais enumerable iff A is a domain of some computable functions. How about if A is not enumerable?
Discussion Enumeration Program Computability (Some reformation may be required) Enumeration Membership Determination (Semidecidability)
Decidable Set A * is decidable if there exists an computable function, say, D such that
Ais decidable iff and are enumerable. Ais decidable iff and are semidecidable. Theorem 3
Ais decidable iff and are 0 1 2 3 4 . . . D: . . . t f t f t . . . g(0) g(1) g(2) enumerable. semidecidable. Theorem 3 Pf) “” • 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: Show that A is enumerable as follows: g: Ais enumerable.
Ais decidable iff and are Show that is enumerable as follows: 0 1 2 3 4 . . . D: . . . t f f t t is enumerable. . . . h(0) h(1) enumerable. semidecidable. Theorem 3 Pf) “” • 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: h:
Ais decidable iff and are enumerable. 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 Enumeration: (Semidecidability) Decidability: To deal with the existence of algorithm (program) to solve problems. Solvability: 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 1and program 2equivalent?” Any Algorithm?
string to represent 1 string to represent 2 Solvable? Computable? Example Problem (PE: Program Equivalence): PE q = “Are program 1and program 2equivalent?” Decidable?
string to represent 1 string to represent 2 Solvable? Computable? Problem Reformulation Example Problem (PE: Program Equivalence): PE q = “Are program 1and program 2equivalent?” Decidable? Problem PE is solvable iff A is decidable (recursive).
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 Example: Turing Machine Version
Problem and Complement Problem Example: Register Machine Version
P is solvable iff and are semisolvable. Theorem 4 Pf) “” algorithm P such that P is solvable 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 ?
P is solvable iff and are semisolvable. ’: START q false true P TRUE HALT Theorem 4 Pf) “” algorithm P such that P is solvable 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 It can be
P is solvable iff and are semisolvable. To show that is semisolvable, we need to find a algorithm ” such that ”: START q true false P TRUE HALT Theorem 4 Pf) “” algorithm P such that P is solvable if q is true, it answers ‘yes’. if q is false, it answers ‘no’. It can be
P is solvable iff and are semisolvable. Theorem 4 Pf) “” To run ’ and ” alternatively, if ’ answers ‘yes’, then ‘yes’; if ” answers ‘yes’, then ‘no’.
P is solvable iff and are semisolvable. Corollary P is semisolvable but not solvable is totally unsolvable.
More simple, The Halting Problem • Register Machine Version • Turing Machine Version
Head S1 S2 … Sk1 Sk Sk+1 … Sn1 Sn Blank Tape Blank Tape START HALT Theorem 5 The HP (halting problem) is not solvable. 會停嗎? We will prove a simpler version.
Head S1 S2 … Sk1 Sk Sk+1 … Sn1 Sn Blank Tape Blank Tape START HALT Theorem 5 The HP (halting problem) is not solvable. 會停嗎?