1 Computing Functions with Turing Machines
2 A function Domain Result Region has:
3 Integer Domain: Unary: Binary: Decimal: We prefer Unary representation: Easier to manipulate
4 A function may have many parameters: Example: Addition function are integers
5 Definition: A function is computable if there is a Turing Machine such that: Initial Configuration Final configuration Domain final state
6 Initial Configuration Final Configuration Domain A function is computable if there is a Turing Machine such that: In other words:
7 Example The function is computable Turing Machine: Input string: unary Output string:unary are integers
8 Start Finish final state
9 Turing machine for function
10 Execution Example: Time 0 Final Result (2)
11 Time 0Time 1
12 Time 2Time 3
13 Time 4Time 5
14 Time 6Time 7
15 Time 8Time 9
16 Time 10Time 11
17 Time 12 HALT & accept
18 Another Example The function is computable Turing Machine: Input string: unary Output string:unary is integer
19 Start Finish final state
20 Turing Machine Pseudocode for 1. Replace every 1 with $ Repeat: 2. Find rightmost $, replace it with 1 3. Go to right end, insert 1 Until no more $ remain
21 Turing Machine for
22 Example Start Finish
23 Another Example The function is computable if
24 Turing Machine for if Input: Output: or
25 Turing Machine Pseudocode: Match a 1 from with a 1 from 1. Repeat Until all or has been matched 2. If a 1 from is not matched erase tape, write 1 else erase tape, write 0
26 Combining Turing Machines
27 Block Diagram Turing Machine inputoutput
28 Example: if Comparer Adder Eraser
29 Turing ’ s Thesis
30 Do Turing machines have the same power with a digital computer?
31 Do Turing machines have the same power with a digital computer? Intuitive answer: Yes There is no formal answer
32 Turing ’ s thesis: Any computation carried out by mechanical means can be performed by Turing Machine (1930)
33 Computer Science Law: A computation is mechanical if and only if it can be performed by a Turing Machine There is no known model of computation more powerful than Turing Machines
34 Definition of Algorithm: An algorithm for function is a Turing Machine which computes
35 When we say: There exists an algorithm Algorithms are Turing Machines We mean: There exists a Turing Machine