Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture Note of 12/29 jinnjy. Outline Decidiability Definition and operations of Turing Machine.

Similar presentations


Presentation on theme: "Lecture Note of 12/29 jinnjy. Outline Decidiability Definition and operations of Turing Machine."— Presentation transcript:

1 Lecture Note of 12/29 jinnjy

2 Outline Decidiability Definition and operations of Turing Machine

3 Decidability A problem is a language L over an alphabet . A problem is decidable if there exists an algorithm to decide whether an arbitrary input w is in L or not. A w Yes No

4 Undecidable Problems Hello-world problem: Determine whether a given C program, with a given input, prints “hello, world” as the first characters that it prints Calls-foo problem: Does program Q, given input y, even call function foo?

5 Hello-world Problem is Undecidable Proof. Assume we have algorithm H that decide this problem: H Input I Yes No Program P

6 Hello-world Problem is Undecidable We build algorithm H 1 from H, it just prints “hello, world” if the program P doesn’t print “hello, world” when its input is I. H1H1 Input I Yes hello, world Program P

7 Hello-world Problem is Undecidable We build algorithm H 2 from H 1, it just uses program P as both inputs P and I. H2H2 Program P Yes hello, world

8 Hello-world Problem is Undecidable Now we consider the situations that H 2 is given H 2 as input. H2H2 Yes (case 1) hello, world (case 2) H2H2

9 Hello-world Problem is Undecidable Case 1: If H 2 is given input H 2 and output Yes, H 2 doesn’t print “hello, world”. But it means that H 2 given H 2 as input prints “hello, world”. H2H2 H2H2 Yes (case 1)

10 Hello-world Problem is Undecidable H2H2 hello, world (case 2) H2H2 Case 2: If H 2 is given input H 2 and prints “hello, world”. But it means that H 2 given H 2 as input doesn’t prints “hello, world” (since H 2 will output Yes).

11 Reduction ( 化簡 or 轉換 ) 一種 mapping 把一個問題的 input 轉換成另一個問 題的 input ,此種 mapping 為 one-to-one ,且兩個 問題的解因為此 mapping 而有關連性。 名稱的由來是因為通常都是把問題的 input 轉換 成有演算法 ( 可能是真的有或是為了製造矛盾而 做的假設 ) 的另一個問題。

12 Reduction ( 化簡 or 轉換 ) Usage: 如果一個問題 A 還沒有演算法,而它有轉換成另外一個 問題 B 的 reduction 方式,且 B 有演算法可解,則我們有 一個現成的演算法 : 1. 用 reduction 方式將問題 A 的 input 轉成問題 B 的格式。 2. 使用 B 的演算法來解這個問題。 3. 根據 reduction 的方式來把得到的解還原成 A 的解。 證明某些問題是 undecidable, recursive, RE, NP, …(blah blah blah)

13 Calls-foo Problem is Undecidable Proof: Assume calls-foo problem is decidable. Use reduction from hello-world problem to calls-foo problem. ( 被證明 undecidable 的問題變 decidable ,矛盾 )

14 Turing Machine BBBBB010010011B q1q1 Unlimited tapeCurrent position of read-write head Current state is q 1 Sketch:

15 Turing Machine Formal definition: 7-tuple(Q, , , ,q 0,B,F) Q: finite set of states  : finite set of input symbols  : finite set of tape symbols, . q 0 : the start state in Q B: blank symbol on the tape, B  but B . F: the set of final states F  Q.

16 Turing Machine  : transition function, we often have  (q,X)=(p,Y,D) if it is defined. q,p are states in Q X, Y are input symbols D denotes the move direction( of read-write head).

17 Recursive and RE A language is recursive language if there is a TM M to accept it and M always halts for all possible input. A language is recursive enumerable if there is a TM M to accept it.

18 Recursive and RE Computer ScienceMathematics decidablerecursive Turing-recognizablerecursive enumerable

19 Church-Turing Thesis “Every algorithmic procedure that can be carried out by computers can be carried out by some Turing machine ” Not a mathematical statement.


Download ppt "Lecture Note of 12/29 jinnjy. Outline Decidiability Definition and operations of Turing Machine."

Similar presentations


Ads by Google