Title: Lecture 4: Unsolvable Problems
1Lecture 4 Unsolvable Problems
??????? ?????????
2Content
- Enumerable and Decidable Sets
- Algorithm Solvability
- Problem Reduction
- Diagonalization Method
3Lecture 4 Unsolvable Problems
- Enumerable and Decidable Sets
??????? ?????????
4Set 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.
5The Generation Process
Enumerable (Generable)
A
Generate
6The Enumeration Process
Enumerable (Generable)
A
Enumerate
?
7The Enumeration Process
Enumerable (Generable)
Is such a process always terminable?
A
Enumerate
?
8The Enumeration Process
Enumerable (Generable)
A
Enumerate
9The Labeling Process
Enumerable (Generable)
A
Labeling
2
10Exercises
- 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?
11The Countability of Real Number
Is R countable?
Is (0,1)?R countable?
12Prove (0,1)?R is uncountable
Assume that (0, 1) is countable.
Suppose that it is counted as
13Prove (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
14Prove (0,1)?R is uncountable
Assume that (0, 1) is countable.
Suppose that it is counted as
Consider the following number
15Prove (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
vfk
16Prove (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
vfk
17Semidecidability
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
18Theorem 1
A is enumerable iff A is semidecidable.
?
Pf)
A is 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.
19Theorem 1
We have
Want
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
20Theorem 1
We have
Want
A is enumerable iff A is semidecidable.
?
Pf)
Numbering the following black cells
Preliminaries
21Theorem 1
We have
Want
A is enumerable iff A is semidecidable.
?
Pf)
Numbering the following black cells
Preliminaries
6
? 0, 1
0
1
5
? ?, 0, 1, 00, 01, 10, 11, 000,
2
3
4
7
22Theorem 1
We have
Want
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)
23Theorem 1
We have
Want
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)
Terminating Record
24Theorem 1
We have
Want
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)
Step 4. Let m terminating computations.
Step 5. if m lt k 1 n n 1 goto Step
2 else return the kth string.
k
25Theorem 2
A is enumerable iff A is a domain of some
computable functions.
Pf)
Exercise
26Theorem 2
A is enumerable iff A is a domain of some
computable functions.
How about if A is not enumerable?
27Discussion
Program Computability
Enumeration
(Some reformation may be required)
Enumeration
Membership Determination
(Semidecidability)
28Complement Set
29Decidable Set
A ? ? is decidable if there exists an computable
function, say, D such that
30Theorem 3
31Theorem 3
enumerable.
semidecidable.
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
g
A is enumerable.
32Theorem 3
enumerable.
semidecidable.
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
33Theorem 3
enumerable.
semidecidable.
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.
34Lecture 4 Unsolvable Problems
??????? ?????????
35Enumeration, 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.
36Example
Problem (PE Program Equivalence)
?PE
q Are program ?1 and program ?2 equivalent?
Any Algorithm?
37Example
Solvable? Computable?
Problem (PE Program Equivalence)
?PE
q Are program ?1 and program ?2 equivalent?
Decidable?
38Example
Solvable? Computable?
Problem Reformulation
Problem (PE Program Equivalence)
?PE
q Are program ?1 and program ?2 equivalent?
Decidable?
Problem PE is solvable iff A is decidable
(recursive).
39Definitions
- 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.
40Problem and Complement Problem
41Problem and Complement Problem
Example
Turing Machine Version
42Problem and Complement Problem
Example
Register Machine Version
43Theorem 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
?
44Theorem 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
45Theorem 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
46Theorem 4
Pf)
?
To run ? and ? alternatively,
if ? answers yes, then yes
if ? answers yes, then no.
47Corollary
P is semisolvable but not solvable
is totally unsolvable.
48The Halting Problem
More simple,
- Register Machine Version
- Turing Machine Version
49Theorem 5
?
The HP (halting problem) is not solvable.
????
We will prove a simpler version.
50Theorem 5
?
The HP (halting problem) is not solvable.
????
51Theorem 5
The HP (halting problem) is not solvable.
Pf)
Assume that HP is solvable.
?algorithm, given ? and lt?, 1gt, can tell
whether ? will halt on lt?, 1gt.
Define
We can have an algorithm, say, ?decide to decide
the elements of A.
That is,
52Theorem 5
The HP (halting problem) is not solvable.
Construct ?strange by making use of ?decide
Pf)
What are done by ?strange?
53Theorem 5
The HP (halting problem) is not solvable.
Construct ?strange by making use of ?decide
Pf)
START
Duplicate ? as ? _at_?
iff
?decide
true
false
?
HALT
54Theorem 5
The input to ?strange is a programs 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 ? _at_?
iff
?decide
true
false
?
HALT
55Theorem 5
The HP (halting problem) is not solvable.
Pf)
Assume that HP is solvable.
. . . . . . . . . . . . . . . .
iff
iff
56Theorem 5
The HP (halting problem) is not solvable.
Pf)
Assume that HP is solvable.
. . . . . . . . . . . . . . . .
iff
iff
57Theorem 6
The HP (halting problem) is not solvable.
The HP (halting problem) is semisolvable.
Pf)
Trivial (Run it)
58The Non-Halting Problem (NHP)
- Register Machine Version
- Turing Machine Version
59Theorem 7
The NHP is not semisolvable.
The NHP is totally unsolvable.
60Lecture 4 Unsolvable Problems
??????? ?????????
61Is a Problem Solvable?
- Methods to identify the problems solvability
- Problem Reduction
- Diagonalization method
- Rices Theorem
62Problem 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.
63Problem Reduction
Conceptually, P is larger.
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.
64Discussion
r
q is true iff q is true.
semisolvable
How about P?
If P is
solvable
65Discussion
r
q is true iff q is true.
semisolvable
semisolvable
If P is
P is
solvable
solvable
66Discussion
r
q is true iff q is true.
How about P?
semisolvable
If P is
solvable
67Discussion
r
q is true iff q is true.
semisolvable
If P is
P is ?????????
solvable
68Discussion
r
q is true iff q is true.
not solvable
How about P?
If P is
totally unsolvable
69Discussion
r
q is true iff q is true.
not solvable
If P is
P is ????????
totally unsolvable
70Discussion
r
q is true iff q is true.
not solvable
How about P?
If P is
totally unsolvable
71Discussion
r
q is true iff q is true.
not solvable
not solvable
If P is
P is
totally unsolvable
totally unsolvable
72Discussion
r
73Theorem 8
The halting-problems for TM(?), R, SR, SR2, are
semisolvable but not solvable.
r
74Theorem 9
The problem of TM equivalence (PE) is totally
unsolvable.
Any Algorithm?
75Theorem 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?
76Theorem 9
The problem of TM equivalence (PE) is totally
unsolvable.
Pf)
Fact NHP is totally unsolvable.
Input lt?, kgt?
?
77Theorem 9
The problem of TM equivalence (PE) is totally
unsolvable.
Pf)
Fact NHP is totally unsolvable.
Input lt?, kgt?
?
78Lecture 4 Unsolvable Problems
??????? ?????????
79Example
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
Can you write such a program?
80Example
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
81Example
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
82Theorem 10
totally unsolvable ? not semisolvable
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
83Theorem 10
totally unsolvable ? not semisolvable
The total function problem is totally unsolvable.
Pf)
- Assume it is semisolvable.
. . . . . . . . . . . . . . . . . . . . .
84Theorem 10
totally unsolvable ? not semisolvable
The total function problem is totally unsolvable.
Pf)
- Assume it is semisolvable.
. . . . . . . . . . . . . . . . . . . . .
85Theorem 10
totally unsolvable ? not semisolvable
The total function problem is totally unsolvable.
Pf)
- Assume it is semisolvable.
. . . . . . . . . . . . . . . . . . . . .
86Theorem 11
There is a total function which is not the
associate function of any count program.
87Exercises
- 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.
88Exercises
- 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.
89Exercises
- Define
- Show that MEMBER is not solvable.