Chapter 19: Turing Machines

Topics
Introduction
Definition of Turing Machine
Turing machine transition diagrams
A TM that accepts anbn

 

Introduction
Definition of Turing machine

1. An finite alphabet S and a blank symbol D (not in S )
2. A tape, with cells 1, 2, …

3. A tape head (initially positioned at cell 1) which can: Notes:
  • machine crashes if head moves to the left of cell 1
  • writing a blank is called erasing
  • 4. An alphabet G of symbols that the tape head can write 5. A finite set of states, including 6. A set of program rules, which are quintuples of the form:
    (state, read-letter, write-letter, direction, new-state)
    A Turing machine is deterministic: The machine accepts its input if it enters a halt state.
     

    Turing machine transition diagrams
     
    We will depict our machines as transition diagrams, e.g.:

    Interpretation:

    What language does this TM accept?

    Is there a simpler one that accepts the same language?


    A TM that accepts anbn

    This machine is found on p. 439 of our text, Introduction to Computer Theory (2nd Edition), by Daniel Cohen, John Wiley & Sons, 1997.

    Let’s see what happens with input aabb:
     
    S tape comment
    1 aabb "eliminate" (by writing over) the leftmost a
    2 Aabb look for matching b
    2 Aabb found it 
    3 AaBb eliminate it; move left to look for leftmost a 
    4 AaBb found rightmost A; leftmost a is just to right
    1 AaBb this is the leftmost a; eliminate it
    2 AABb look for matching b
    2 AABb found it; eliminate it
    3 AABB move left to look for another a
    3 AABB none found 
    5 AABB make sure nothing to the right of last B
    5 AABB  
    5 AABBD nothing there; HALT (accept)
    Hosted by www.Geocities.ws

    1