Professional Documents
Culture Documents
Un Decid Ability
Un Decid Ability
Un Decid Ability
(Recursive)
TMs that always halt,
halt no matter accepting or nonaccepting DECIDABLE PROBLEMS
(Recursively enumerable)
TMs that are guaranteed to halt only on acceptance.
acceptance If
non-accepting, it may or may not halt (i.e., could loop
forever).
Undecidability:
Regular
(DFA)
Contextfree
(PDA)
Decidable problems
Con
ntext
sen
nsitive
Non-RE Languages
(all other languages for which
no TMs can be built)
Recursively
Enum
merable (R
RE)
LBA
Recurs
sive
No TMs exist
Undecidable problems
3
M
reject
M
4
M
accept
accept
w
reject
accept
accept
reject
M
w
accept
accept
accept
accept ?
M
?
reject
Recursive Langs
g are closed
under Union
Let Mu = TM for L1 U L2
Mu construction:
1.
Make 2-tapes
2 tapes and
copy input w on both
tapes
2.
Simulate M1 on tape 1
3.
Simulate M2 on tape 2
4.
If either M1 or M2
accepts,
t then
th Mu
accepts
5.
Otherwise, Mu rejects.
Mu
M1
accept
reject
OR
w
M2
accept
reject
Recursive Langs
g are closed
under Intersection
Let Mn = TM for L1 L2
Mn construction:
1.
Make 2-tapes
2 tapes and
copy input w on both
tapes
2.
Simulate M1 on tape 1
3.
Simulate M2 on tape 2
4.
If M1 AND M2 accepts,
th Mn accepts
then
t
5.
Otherwise, Mn rejects.
Mn
M1
accept
reject
AND
AND
w
M2
accept
reject
Concatenation
Kleene closure (star operator)
Homomorphism, and inverse homomorphism
Union, intersection, concatenation, Kleene closure
complementation
10
12
Contextfree
(PDA)
Recurs
sive
Regular
(DFA)
Con
ntext
sen
nsitive
Recursively
Enum
merable (R
RE)
Non-RE Languages
13
Machine
M
14
An algorithm for H:
Implies:
p
H is in RE
Simulate M on w
accept,
if M accepts w
reject,
H(<M,w>) =
Question:
A Claim
By contradiction,
contradiction let us assume H exists
accept
t
<M,w>
reject
16
HP Proof (step 1)
Let us construct a new TM D using H as a
subroutine:
On input <M>:
1.
2
2.
D
accept
<M>
reject
reject
accept
reject
reject
17
HP Proof (step 2)
reject,
if M accepts <M>
D (<M>) =
Now, what happens if D is input to itself?
accept,
reject
reject,
if D accepts <D>
D (<D>) =
A contradiction!!!
18
19
Contextfree
(PDA)
Recurs
sive
Regular
(DFA)
Con
ntext
sen
nsitive
Recursively
Enum
merable (R
RE)
21
A Language
g g about TMs &
acceptance
2.
3
3.
22
Any
y TM M can also be binaryy
coded
M = { Q, {0,1}, , , q0,B,F }
24
Ld = { wi | wi L(Mi) }
j
(TMs)
i
..
25
1.
2.
27
Non-RE
Non
RE languages
How come there are languages here?
(e.g., diagonalization language)
Recursively
Enum
merable (R
RE)
Contextfree
(PDA)
Recurs
sive
Regular
(DFA)
Con
ntext
sen
nsitive
Non-RE Languages
28
One Explanation
There are more languages than TMs
Q) Which is bigger?
A) Both
B th sets
t are off the
th same size
i
Countably infinite
Proof: Show by
y one-to-one, onto set correspondence
p
from
N ==> E
n
f(n)
i.e,
e, for
o e
every
eye
element
e e t in N,,
there is a unique element in E,
and vice versa.
1
2
3
.
.
2
4
6
.
.
31
Example #2
1/2
1/3
1/4
1/5
2/1
2/2
2/3
2/4
2/5
3/5
4/5
3/1
3/2
3/3
3/4
4/1
4/2
4/3
4/4
5/1
5/2
.
.
32
Uncountable sets
Example:
Let R be the set of all real numbers
Claim: R is uncountable
n
1
2
3
4
.
.
.
f(n)
3.14159
5.55555
0.12345
0.51430
33
34
35
Languages
g g that we know
about
Lu = { <M,w>
<M w> | M accepts w }
Result: Lu is in RE but not recursive
Diagonalization language
Lne = { M | L(M) }
Lne is RE
Proof: (build a TM for Lne using UTM)
Non-deterministic Simulator for Lne
accept
t
accept
accept
UTM
G
Guess
w
37
<M,w>
Trans
sformation
functtion
Lu
accept
t
Lne
accept
accept
Mne
38
Reducability
To prove: Problem P1 is undecidable
Given/known: Problem P2 is undecidable
Reduction idea:
Reduce P2 to P1:
1.
2.
3.
4.
Therefore, P2 is decidable
A contradiction
Therefore, P1 has to be undecidable
39
Reduce P2 to P1:
P2
instance
Construct
P1
instance
D id
Decide
yes
no
Conclusion: If we could solve P1, then we can solve P2 as well
40
Summary
Problems vs. languages
Decidability
Undecidability
Recursive
Recursively
R
i l E
Enumerable
bl
Not RE
Examples of languages