Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?

Similar presentations


Presentation on theme: "1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?"— Presentation transcript:

1 1 Turing Machines

2 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?

3 3 Regular Languages Context-Free Languages Languages accepted by Turing Machines

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

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

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

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

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

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

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

11 11 States & Transitions Read Write Move Left Move Right

12 12 Example:...... Time 1 current state

13 13...... Time 1...... Time 2

14 14...... Time 1...... Time 2 Example:

15 15...... Time 1...... Time 2 Example:

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

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

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

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

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

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

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

23 23 Time 0

24 24 Time 1

25 25 Time 2

26 26 Time 3

27 27 Time 4 Halt & Accept

28 28 Rejection Example Time 0

29 29 Time 1 No possible Transition Halt & Reject

30 30 Infinite Loop Example A Turing machine for language

31 31 Time 0

32 32 Time 1

33 33 Time 2

34 34 Time 2 Time 3 Time 4 Time 5 Infinite loop

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

36 36 Formal Definitions for Turing Machines

37 37 Transition Function

38 38 Transition Function

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

40 40 Configuration Instantaneous description:

41 41 Time 4Time 5 A Move:

42 42 Time 4Time 5 Time 6Time 7

43 43 Equivalent notation:

44 44 Initial configuration: Input string

45 45 The Accepted Language For any Turing Machine Initial stateFinal state

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


Download ppt "1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?"

Similar presentations


Ads by Google