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

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 transition (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 States & Transitions Read Write Move Left Move Right

11 11 Example:...... Time 1 current state

12 12...... Time 1...... Time 2

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

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

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

16 16 Halting The machine halts in a state if there is no transition to follow

17 17 Halting Example 1:...... No transition from HALT!!!

18 18 Halting Example 2:...... No possible transition from and symbol HALT!!!

19 19 Accepting States Allowed Not Allowed Accepting states have no outgoing transitions The machine halts and accepts

20 20 Acceptance Accept Input If machine halts in an accept state Reject Input If machine halts in a non-accept state or If machine enters an infinite loop string

21 21 Turing Machine Example Accepts the language: Input alphabet

22 22 Time 0

23 23 Time 1

24 24 Time 2

25 25 Time 3

26 26 Time 4 Halt & Accept

27 27 Rejection Example Time 0

28 28 Time 1 No possible Transition Halt & Reject

29 29 Another Turing Machine Example Turing machine for the language

30 30 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 Basic Idea:

31 31 Time 0

32 32 Time 1

33 33 Time 2

34 34 Time 3

35 35 Time 4

36 36 Time 5

37 37 Time 6

38 38 Time 7

39 39 Time 8

40 40 Time 9

41 41 Time 10

42 42 Time 11

43 43 Time 12

44 44 Halt & Accept Time 13

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


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

Similar presentations


Ads by Google