Presentation is loading. Please wait.

Presentation is loading. Please wait.

Turing Machine.

Similar presentations


Presentation on theme: "Turing Machine."— Presentation transcript:

1 Turing Machine

2 Importance How important Turing machine is?
If you look up google for “林志玲,”

3

4 Importance If you look up google for “Turing machine,”

5 Importance 考慮問題的三境界 1.如何解決問題? Ex. DNA比對 2.能否快速得到答案? Ex.質數判斷,因數分解
3.是否壓根兒就不可解? We call this “Decidable Problem”

6 Decidable Problem Hilbert’s belief:
“Wir mussen wissen, wir werden wissen” “ 我們必須知道,我們終將知道” Every problem in the world can be determined under finite operations.

7 Unfortunately… Church and Turing: Undecidable Problems exist. Example:
Problem: Determine whether the first thing a program prints is “hello, world” Example Main() { printf(“hello world\n”); } Note: Programs may take an unimaginably long time before making any output at all.

8 Problems Computers Cannot Solve
int exp(int I,int n) { int ans = 1,j; for(j = 1;j <= n;j++) ans *= i; return (ans); } main() int n, total = 3,x,y,z; cin >> n; while(1) for(x = 1;x <= total-2;x++) for(y =1;y <= total - x - 1;y++) z = total – x – y; if(exp(x,n) +exp(y,n) == exp(z,n)) cout << “hello world” << endl; total++;

9 Turing Machine--Definition
A Turing machine (TM) is a quadruple M = (K, Σ,δ,s). K is a finite set of states. s ,an element of K, is the initial state. Σ is a finite set of symbols (disjoint from K) δ: K×Σ→K×Σ× {L,R,S} is a transition function. -- L(left), R(right), and S(stay) signify cursor movements.

10 The Halting of a TM A TM M may halt if it enters some special states called “accepted” or “rejected.” Turing-Computable functions are functions that can be expressed as a TM.

11 A TM Schema

12 Turing Machine – Intuitive Description
A Turing machine is similar to a finite state machine but with unlimited and unrestricted memory. It has four additional characteristics: 1.A Turing machine can both write on the tap and read from it. 2.The read-write head can move both to the left and to the right. 3.The tape is infinite. 4.The special states for rejecting and accepting take immediate effect.

13 Turing Machine – An Example

14 Turing Machine – An Example (Conti.)
If the input is “01#01” 01#01NIL State = q0 ->x1#01NIL State = p1 ->x1#01NIL State = p2 ->x1#x1NIL State = q1 ->x1#x1NIL State = q2 ->x1#x1NIL State = q0 ->xx#x1NIL State = r1 ->xx#x1NIL State = r2 ->xx#x1NIL State = r2 ->xx#xxNIL State = r2 ->xx#xxNIL State = q1 ->xx#xxNIL State = q2 ->xx#xxNIL State = q0 ->xx#xxNIL State = q3 ->Accept!!

15 Church-Turing Thesis What is computable is Turing-computable; Turing Machines are algorithms. No “intuitively computable” problems have been shown not to be Turing-computable yet.

16 Countable/Uncountable
A set S is countable if either |S| is finite or there exist a function f:S←→N Countable : N, Z, Q Uncountable : R

17 Final Results TM’s are countable.
Problems in the world are uncountable. (Since the number of all possible “sentence” is equal to N, the number of problems is equal to 2N) Hence, most of the problems in the world are undecidable.

18 References “希爾伯特的23個數學問題”—天下文化出版 “謎樣的計算機科學之父 ” —科學月刊第三十卷第十一期
Class notes of “Computing Theory” by 呂育道 Class notes of “Theory of Computation” by顏嗣鈞 特別感謝—助教的投影片提供


Download ppt "Turing Machine."

Similar presentations


Ads by Google