Design and Analysis of Algorithms
. . !"#
2542
http://www.cp.eng.chula.ac.th/faculty/spj
!" ## $%&'(()#*
&$(+!$ ,* "&'(-"*%##++(&
%# .# .$'/(0 1$ /-1 %#%
Undecidable Problems
Introduction
http://www.cp.eng.chula.ac.th/faculty/spj
Outline
Noncomputability / Undecidability Tiling Problem
Word Correspondence Problem Halting Problem
Proving Undecidability
Algorithmic Problems
Tractable problems
admitting efficient algorithms
Intractable problems
admitting no efficient algorithms
Undecidable problems
admitting no algorithms ! ! !
Tiling Problem
Fixed orientation A finite set of Tof tile descriptions
Can any finite area of any size be beatifully covered using only tiles in T ?
-
http://www.cp.eng.chula.ac.th/faculty/spj
Tiling Problem
Fixed orientation A finite set of Tof tile descriptions
Can any finite area of any size be beatifully covered using only tiles in T ?
-
http://www.cp.eng.chula.ac.th/faculty/spj
Tiling Problem
Fixed orientation A finite set of Tof tile descriptions
Can any finite area of any size be beatifully covered using only tiles in T ?
-
http://www.cp.eng.chula.ac.th/faculty/spj
Tiling Problem
Fixed orientation A finite set of Tof tile descriptions
Can any finite area of any size be beatifully covered using only tiles in T ?
/
http://www.cp.eng.chula.ac.th/faculty/spj
Tiling Problem
Tiling problem is undecidable
There is no algorithm (and never will be) for solving the tiling problem !
If one claims
Acan solve the problem, there will be input sets
Tupon which
A
runs forever or terminates with wrong answer
http://www.cp.eng.chula.ac.th/faculty/spj
Word Correspondence
abb a baba bab aba
bbab ab aa a
Two groups of words over some finite alphabets
http://www.cp.eng.chula.ac.th/faculty/spj
Word Correspondence
abb a baba bab aba
bbab ab aa a
aabbabbbabaabbaba
http://www.cp.eng.chula.ac.th/faculty/spj
Word Correspondence
abb a bab
baba aba bbab ab aa a
aabbabbbabaabbaba -
http://www.cp.eng.chula.ac.th/faculty/spj
Unboundedness
!"# undecidable $%& '()*+ !"# ),-."/
0)12 %*#&*0*3'45" 6 7
489:*;2< !"# ),-."/-=*,0)12'45 exponential !"#'45 intractable problem7
Hamiltonian path & Euler path
NP-Complete P
http://www.cp.eng.chula.ac.th/faculty/spj
S
T
Domino Snake
A finite set of Tof tile descriptions
http://www.cp.eng.chula.ac.th/faculty/spj
Domino Snake
A finite set of Tof tile descriptions
Undecidable Decidable
Halting Problem
for i=1 to n for j=1 to n
for k=1 to j sum += 1
A:!
n = 10000000000000000"B0")C;D2E CF loop :)G"H% ?
Halting Problem
while x 1 do if x is even
then x = x/2 else x = 3x+1
A:!
x = 7"B0")C;D2E CF loop :)G"H% ?
7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, ...
http://www.cp.eng.chula.ac.th/faculty/spj
Proving Undecidablity
Q: Does Phalt on X?
YES NO
P(X) P(X) -
P
program X input
http://www.cp.eng.chula.ac.th/faculty/spj
Proving Undecidablity
Q -
P X
Y N
W
W W
S
S( W )
if Q(W,W) = ‘y’
loop forever else
return
234 W(W) 5678 S( W) 9:8 loop 234 W(W) 9:8 loop S ( W) 5678
http://www.cp.eng.chula.ac.th/faculty/spj
Q P X
Y N
W
W W
S
Proving Undecidablity
;64<=>3?@4 S( S) 5678 5=A;9:8 loop ? S
S S
TCF
- S( S) 5678
Q BCD?
loop
http://www.cp.eng.chula.ac.th/faculty/spj
Q P X
Y N
W
W W
S
Proving Undecidablity
;64<=>3?@4 S( S) 5678 5=A;9:8 loop ? S
S S
TCF
S( S) 9:8 loop
Q BCD?
"
http://www.cp.eng.chula.ac.th/faculty/spj
Q P X
Y N
W
W W
S
Proving Undecidablity
Halting problem is undecidable
http://www.cp.eng.chula.ac.th/faculty/spj
Diagonalization Method
6 N Y N Y Y Y ...
5 Y N Y Y Y N ...
4 Y Y Y Y N N ...
3 N N N N N N ...
2 Y Y Y Y N N ...
1 Y Y N N Y N ...
1 2 3 4 5 6 ...
programsall
all inputs
N N Y N N N ...
program S
S
http://www.cp.eng.chula.ac.th/faculty/spj
Computability
Tractable Intractable Undecidable
-
/ /
- /
- in principle in practice