Presentation is loading. Please wait.

Presentation is loading. Please wait.

Busch Complexity Lectures: Turing Machines

Similar presentations


Presentation on theme: "Busch Complexity Lectures: Turing Machines"— Presentation transcript:

1 Busch Complexity Lectures: Turing Machines
Prof. Busch - LSU

2 The Language Hierarchy
? ? Context-Free Languages Regular Languages Prof. Busch - LSU

3 Context-Free Languages
Languages accepted by Turing Machines Context-Free Languages Regular Languages Prof. Busch - LSU

4 A Turing Machine Tape ...... ...... Read-Write head Control Unit
Prof. Busch - LSU

5 The Tape No boundaries -- infinite length ...... ......
Read-Write head The head moves Left or Right Prof. Busch - LSU

6 The head at each transition (time step): 1. Reads a symbol
...... ...... Read-Write head The head at each transition (time step): 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right Prof. Busch - LSU

7 Example: Time 0 ...... ...... Time 1 ...... ...... 1. Reads 2. Writes
3. Moves Left Prof. Busch - LSU

8 Time 1 ...... ...... Time 2 ...... ...... 1. Reads 2. Writes 3. Moves Right Prof. Busch - LSU

9 The Input String Input string Blank symbol ...... ...... head
Head starts at the leftmost position of the input string Prof. Busch - LSU

10 States & Transitions Write Read Move Left Move Right Prof. Busch - LSU

11 Example: Time 1 ...... ...... current state Prof. Busch - LSU

12 Time 1 ...... ...... Time 2 ...... ...... Prof. Busch - LSU

13 Example: Time 1 ...... ...... Time 2 ...... ...... Prof. Busch - LSU

14 Example: Time 1 ...... ...... Time 2 ...... ...... Prof. Busch - LSU

15 Turing Machines are deterministic
Determinism Turing Machines are deterministic Not Allowed Allowed No lambda transitions allowed Prof. Busch - LSU

16 Partial Transition Function
Example: ...... ...... Allowed: No transition for input symbol Prof. Busch - LSU

17 Halting The machine halts in a state if there is
no transition to follow Prof. Busch - LSU

18 Halting Example 1: ...... ...... No transition from HALT!!!
Prof. Busch - LSU

19 No possible transition from and symbol
Halting Example 2: ...... ...... No possible transition from and symbol HALT!!! Prof. Busch - LSU

20 Accepting States Not Allowed Allowed
Accepting states have no outgoing transitions The machine halts and accepts Prof. Busch - LSU

21 Acceptance If machine halts Accept Input in an accept state string
in a non-accept state or If machine enters an infinite loop Reject Input string Prof. Busch - LSU

22 In order to accept an input string,
Observation: In order to accept an input string, it is not necessary to scan all the symbols in the string Prof. Busch - LSU

23 Turing Machine Example
Input alphabet Accepts the language: Prof. Busch - LSU

24 Time 0 Prof. Busch - LSU

25 Time 1 Prof. Busch - LSU

26 Time 2 Prof. Busch - LSU

27 Time 3 Prof. Busch - LSU

28 Time 4 Halt & Accept Prof. Busch - LSU

29 Rejection Example Time 0 Prof. Busch - LSU

30 No possible Transition
Time 1 No possible Transition Halt & Reject Prof. Busch - LSU

31 A simpler machine for same language
but for input alphabet Accepts the language: Prof. Busch - LSU

32 Not necessary to scan input
Time 0 Halt & Accept Not necessary to scan input Prof. Busch - LSU

33 Infinite Loop Example A Turing machine for language Prof. Busch - LSU

34 Time 0 Prof. Busch - LSU

35 Time 1 Prof. Busch - LSU

36 Time 2 Prof. Busch - LSU

37 Time 2 Time 3 Infinite loop Time 4 Time 5 Prof. Busch - LSU

38 Because of the infinite loop: The accepting state cannot be reached
The machine never halts The input string is rejected Prof. Busch - LSU

39 Another Turing Machine Example
Turing machine for the language Prof. Busch - LSU

40 Basic Idea: Match a’s with b’s: Repeat: replace leftmost a with x
find leftmost b and replace it with y Until there are no more a’s or b’s If there is a remaining a or b reject Prof. Busch - LSU

41 Time 0 Prof. Busch - LSU

42 Time 1 Prof. Busch - LSU

43 Time 2 Prof. Busch - LSU

44 Time 3 Prof. Busch - LSU

45 Time 4 Prof. Busch - LSU

46 Time 5 Prof. Busch - LSU

47 Time 6 Prof. Busch - LSU

48 Time 7 Prof. Busch - LSU

49 Time 8 Prof. Busch - LSU

50 Time 9 Prof. Busch - LSU

51 Time 10 Prof. Busch - LSU

52 Time 11 Prof. Busch - LSU

53 Time 12 Prof. Busch - LSU

54 Time 13 Halt & Accept Prof. Busch - LSU

55 machine for the language
Observation: If we modify the machine for the language we can easily construct a machine for the language Prof. Busch - LSU

56 Formal Definitions for Turing Machines
Prof. Busch - LSU

57 Transition Function Prof. Busch - LSU

58 Transition Function Prof. Busch - LSU

59 Turing Machine: Input Tape alphabet alphabet States Transition Accept
function Accept states Initial state blank Prof. Busch - LSU

60 Configuration Instantaneous description: Prof. Busch - LSU

61 Time 4 Time 5 A Move: (yields in one mode) Prof. Busch - LSU

62 Time 4 Time 5 Time 6 Time 7 A computation Prof. Busch - LSU

63 Equivalent notation: Prof. Busch - LSU

64 Initial configuration:
Input string Prof. Busch - LSU

65 The Accepted Language For any Turing Machine Initial state
Accept state Prof. Busch - LSU

66 Recursively Enumerable
If a language is accepted by a Turing machine then we say that is: Turing Recognizable Other names used: Turing Acceptable Recursively Enumerable Prof. Busch - LSU


Download ppt "Busch Complexity Lectures: Turing Machines"

Similar presentations


Ads by Google