Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 4: Unsolvable Problems

Similar presentations


Presentation on theme: "Lecture 4: Unsolvable Problems"— Presentation transcript:

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

2 Content Enumerable and Decidable Sets Algorithm Solvability
Problem Reduction Diagonalization Method

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

4 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}.

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

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

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

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

9 Enumerable (Generable) The Labeling Process A = Labeling = = 2

10 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’?

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

12 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

13 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

14 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

15 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

16 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

17 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

18 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.

19 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

20 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

21 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

22 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):

23 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

24 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

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

26 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?

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

28 Complement Set

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

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

31 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) . . .

32 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)

33 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.

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

35 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.

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

37 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

38 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

39 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.

40 Problem and Complement Problem

41 Problem and Complement Problem
Example: Turing Machine Version

42 Problem and Complement Problem
Example: Register Machine Version

43 ? 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 ?

44 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

45 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

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

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

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

49  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.

50  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 會停嗎?

51 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,

52 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?

53 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

54 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

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

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

57 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)

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

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

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

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

62 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’.

63 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’.

64 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

65 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

66 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

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

68 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

69 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

70 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

71 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

72 Discussion r:

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

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

75 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?

76 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

77 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

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

79 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?

80 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

81 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

82 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,

83 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.

84 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.

85 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.

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

87 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.

88 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.

89 Exercises Define Show that MEMBER is not solvable.


Download ppt "Lecture 4: Unsolvable Problems"

Similar presentations


Ads by Google