Presentation is loading. Please wait.

Presentation is loading. Please wait.

Turing Machines.

Similar presentations


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

1 Turing Machines

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

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

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

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

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

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

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

9 States & Transitions Write Read Move Left Move Right

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

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

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

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

14 Determinism Not Allowed Turing Machines are deterministic Allowed
No lambda transitions allowed

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

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

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

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

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

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

21 Time 0

22 Time 1

23 Time 2

24 Time 3

25 Time 4 Halt & Accept

26 Rejection Example Time 0

27 Time 1 No possible Transition Halt & Reject

28 Infinite Loop Example A Turing machine for language

29 Time 0

30 Time 1

31 Time 2

32 Time 2 Time 3 Infinite loop Time 4 Time 5

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

34 Another Turing Machine Example
Turing machine for the language

35 Time 0

36 Time 1

37 Time 2

38 Time 3

39 Time 4

40 Time 5

41 Time 6

42 Time 7

43 Time 8

44 Time 9

45 Time 10

46 Time 11

47 Time 12

48 Time 13 Halt & Accept

49 Observation: If we modify the machine for the language we can easily construct a machine for the language

50 Formal Definitions for Turing Machines

51 Transition Function

52 Transition Function

53 Turing Machine: Input alphabet Tape alphabet States Transition function Final states Initial state blank

54

55 Assignment (10%) Form a group consist <= 4 members.
Find the implementation/usage/ function/benefit of: FA/NFA Content Free Language/Grammar Pushdown Automata Turing Machine Due date: during next week class


Download ppt "Turing Machines."

Similar presentations


Ads by Google