<- previous    index     next ->

Lecture 26 Turing Machine Model


 M = ( Q, Sigma, Gamma, delta, q0, B,  F)

 Q = finite set of states including q0
 Sigma = finite set of input symbols not including B
 Gamma = finite set of tape symbols including Sigma and B
 delta = transitions mapping  Q x Gamma to Q x Gamma x {L,R}
 q0    = initial state
 B     = blank tape symbol, initially on all tape not used for input
 F     = set of final states

 +-------------------------+-----------------  
 | input string            |BBBBB ...  accepts Recursively Enumerable Languages
 +-------------------------+----------------- 
    ^ read and write, move left and right
    |
    |  +-----+
    |  |     |--> accept
    +--+ FSM |
       |     |--> reject
       +-----+


 +-------------------------+-----------------  
 | input and output string |BBBBB ...  computes partial recursive functions
 +-------------------------+----------------- 
    ^ read and write, move left and right
    |
    |  +-----+
    |  |     |
    +--+ FSM |--> done  (a delta [q,a]->[empty], but may never happen )
       |     |
       +-----+

  delta is a table or list of the form:
  [qi, ai] -> [qj, aj, L]   or  [qi, ai] -> [qj, aj, R]

  qi is the present state
  ai is the symbol under the read/write head

  qj is the next state
  aj is written to the tape at the present position
  L  is move the read/write head left one position after the write
  R  is move the read/write head right one position after the write


  It is generally a pain to "program" a Turing machine. You have to
  convert the algorithm into the list of delta transitions. The fallback
  is to describe in English the steps that should be performed.  The
  amount of detail needed depends on the reader of the algorithm
  accepting that there is an obvious way for the Turing machine to
  perform your steps.

  There are a lot of possible Turing machines and a useful technique
  is to code Turing machines as binary integers. A trivial coding is
  to use the 8 bit ASCII for each character in the written description
  of a Turing machine concatenated into one long bit stream.
  Having encoded a specific Turing machine as a binary integer, we
  can talk about  TMi  as the Turing machine encoded as the number "i".

  It turns out that the set of all Turing machines is countable and
  enumerable.

  Now we can construct a Universal Turing Machine, UTM, that takes
  an encoded Turing machine on its input tape followed by normal
  Turing machine input data on that same input tape. The Universal Turing
  Machine first reads the description of the Turing machine on the
  input tape and uses this description to simulate the Turing machines
  actions on the following input data. Of course a UTM is a TM and can
  thus be encoded as a binary integer, so a UTM can read a UTM from
  the input tape, read a TM from the input tape, then read the input
  data from the input tape and proceed to simulate the UTM that is
  simulating the TM.  Etc. Etc. Etc.

  In the next lecture we will make use of the fact that a UTM can be
  represented as an integer and can thus also be the input data on
  the input tape.
    <- previous    index     next ->

Other links

Go to top