Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Turing Machines. 2 A Turing Machine...... Tape Read-Write head Control Unit.

Similar presentations


Presentation on theme: "1 Turing Machines. 2 A Turing Machine...... Tape Read-Write head Control Unit."— Presentation transcript:

1 1 Turing Machines

2 2 A Turing Machine...... Tape Read-Write head Control Unit

3 3 The Tape...... Read-Write head No boundaries -- infinite length The head moves Left or Right

4 4...... Read-Write head The head at each time step: 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right

5 5...... Example: Time 0...... Time 1 1. Reads 2. Writes 3. Moves Left

6 6...... Time 1...... Time 2 1. Reads 2. Writes 3. Moves Right

7 7 The Input String...... Blank symbol head Head starts at the leftmost position of the input string Input string

8 8...... Blank symbol head Input string Remark: the input string is never empty

9 9 States & Transitions Read Write Move Left Move Right

10 10 Example:...... Time 1 current state

11 11...... Time 1...... Time 2

12 12...... Time 1...... Time 2 Example:

13 13...... Time 1...... Time 2 Example:

14 14 Determinism Allowed Not Allowed Turing Machines are (for now) deterministic

15 15 Partial Transition Function...... Example: No transition for input symbol Allowed:

16 16 Halting The machine halts if there are no possible transitions to follow

17 17 Example:...... No possible transition HALT!!!

18 18 Final (accepting) States Allowed Not Allowed Final states have no outgoing transitions In a final state the machine halts

19 19 Acceptance Accept Input If machine halts in a final state Reject Input If machine halts in a non-final state or If machine enters an infinite loop

20 20 Turing Machine Example A Turing machine that accepts the language:

21 21 Time 0

22 22 Time 1

23 23 Time 2

24 24 Time 3

25 25 Time 4 Halt & Accept

26 26 Rejection Example Time 0

27 27 Time 1 No possible Transition Halt & Reject

28 28 Infinite Loop Example A Turing machine for the language that includes all strings a n with n>0 or strings that start with b.

29 29 Time 0

30 30 Time 1

31 31 Time 2

32 32 Time 2 Time 3 Time 4 Time 5 Infinite loop

33 33 Because of the infinite loop: The final state cannot be reached The machine never halts The input is not accepted

34 34 Standard Turing Machine Deterministic Infinite tape in both directions Tape is the input/output file The machine we described is the standard:

35 35 Turing’s Thesis

36 36 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)

37 37 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

38 38 When we say: There exists an algorithm Algorithms are Turing Machines We mean: There exists a Turing Machine that executes the algorithm

39 39 Variations of the Turing Machine

40 40 Read-Write Head Control Unit Deterministic The Standard Model Infinite Tape (Left or Right)

41 41 We want to prove: Each Class has the same power with the Standard Model The variations form different Turing Machine Classes

42 42 Same Power of two classes means: Both classes of Turing machines accept the same languages

43 43 Same Power of two classes means: For any machine of first class there is a machine of second class such that: And vice-versa

44 44 Multitape Turing Machines Control unit Tape 1Tape 2 Input

45 45 Time 1 Time 2 Tape 1Tape 2

46 46 Multitape machines simulate Standard Machines: Use just one tape We can also prove that standard machines simulate Multitape machines.

47 47 Same power doesn’t imply same speed: Language Acceptance Time Standard machine Two-tape machine

48 48 Standard machine: Go back and forth times Two-tape machine: Copy to tape 2 Leave on tape 1 Compare tape 1 and tape 2 ( steps)

49 49 NonDeterministic Turing Machines Non Deterministic Choice

50 50 Time 0 Time 1 Choice 1 Choice 2

51 51 NonDeterministic Machines simulate Standard (deterministic) Machines: Every deterministic machine is also a nondeterministic machine

52 52 Deterministic machines simulate NonDeterministic machines: Keeps track of all possible computations Deterministic machine:

53 53 Non-Deterministic Choices Computation 1

54 54 Non-Deterministic Choices Computation 2

55 55 Remark: The simulation in the Deterministic machine takes time exponential time compared to the NonDeterministic machine

56 56 A Universal Turing Machine

57 57 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable

58 58 Solution: Universal Turing Machine Reprogrammable machine Simulates any other Turing Machine Attributes:

59 59 Universal Turing Machine simulates any other Turing Machine Input of Universal Turing Machine: Description of transitions of Initial tape contents of

60 60 Universal Turing Machine Description of Tape Contents of State of Three tapes Tape 2 Tape 3 Tape 1

61 61 We describe Turing machine as a string of symbols: We encode as a string of symbols Description of Tape 1

62 62 Alphabet Encoding Symbols: Encoding:

63 63 State Encoding States: Encoding: Head Move Encoding Move: Encoding:

64 64 Transition Encoding Transition: Encoding: separator

65 65 Machine Encoding Transitions: Encoding: separator

66 66 Tape 1 contents of Universal Turing Machine: encoding of the simulated machine as a binary string of 0’s and 1’s

67 67 A Turing Machine is described with a binary string of 0’s and 1’s The set of Turing machines forms a language: each string of the language is the binary encoding of a Turing Machine Therefore:

68 68 Language of Turing Machines L = { 010100101, 00100100101111, 111010011110010101, …… } (Turing Machine 1) (Turing Machine 2) ……


Download ppt "1 Turing Machines. 2 A Turing Machine...... Tape Read-Write head Control Unit."

Similar presentations


Ads by Google