• Tidak ada hasil yang ditemukan

Design and Analysis of Algorithms

N/A
N/A
Protected

Academic year: 2024

Membagikan "Design and Analysis of Algorithms"

Copied!
5
0
0

Teks penuh

(1)

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 ?

-

(2)

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

A

can solve the problem, there will be input sets

T

upon 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

(3)

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

(4)

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

(5)

http://www.cp.eng.chula.ac.th/faculty/spj

Computability

Tractable Intractable Undecidable

-

/ /

- /

- in principle in practice

Referensi

Dokumen terkait

Sometimes only few processors can be used to generate all m-permutations of n items. A surpris- ingly simple parallel algorithm can be developed for this situation. The algorithm

38 Kvco/S Hzfilter Icp/2π 1/N Phase Detector Charge Pump Filter VCO DIVIDER DIVIDER NOISE REF NOISE CLOCK REF PD+CP NOISE FILTER NOISE VCO NOISE PHASE OUT Fig-5.1 Jitter is

Consider the following slightly modified algorithm: GreedySortMakespan - Consider jobs in decreasing order of duration - While all jobs are not assigned - Assign the next job as per

Greedy Algorithms: Example  Consider items in decreasing order of the cost per unit volume value..  Let G1,…,Gn be the volume of items in the sack chosen by

Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers

Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers with solutions etc.. Visit https://www.tutorialsduniya.com for Notes, books, programs, question papers

Sri Chandrasekharendra Saraswathi Viswa Mahavidyalaya Department of Computer Science and Engineering Page 64 of 162 Syllabus B.E[CSE] Full Time L T P C 3 2 0 3 CS4T4 - DESIGN AND

Week No Catalog Topics Plan Weekly Coverage 1 Ch1: Introduction to algorithms 1p-41p Formal definition and characterization of algorithms, major problem areas, data structures