Outline
- Equivalence classes of automata
- Stay-put Turing Machine
- In-Class Exercises
- Semi-Infinite Tape Machines
- Offline Turing Machines
- k-tape Machines
- Time Complexity
Equivalence classes of automata
- On Monday, we introduced the Church-Turing Thesis which roughly says that if a language is computable
by a process that has some hope of being implementable in the real world then it can be simulated by a Turing Machine.
- To make this statement meaningful, we need to first say what it means for two computational models to be of equivalent strength.
- Independent of the status of the Church-Turing Thesis, being able to compare the strengths and weaknesses of different computational models is helpful in many real-word situations. For instance, in the design and implementation of new programming languages.
- Given two machine models `F` and `F'` we say they are equivalent if for each `M \in F` there is an `M' in F'` such that `L(M) = L(M')` and vice-versa.
- We are interested in what models are equivalent to TMs, especially if the model appears stronger at first.
Stay put machines
- Suppose rather than having a transition function `delta : Q times Gamma -> Q times Gamma times {L,R}` we instead have: `delta : Q times Gamma -> Q times Gamma times {L,R,S}` where `S` denotes stay put.
- It is obvious that machines with this extra stay put ability can simulate machines that don't have it.
- On the other hand, given a transition: `delta(q,a) ->(r, b, S)`, we could simulate it by having
transitions:
`delta (q, a) ->(r', b, R)`
`delta ( r', c) ->(r, c, L)`
where `r'` is a new state and where we have the second kind of transition for each symbol `c`.
- Hence, stay-put machines are equivalent to usual TMs.
In-Class Exercise
- Suppose we restrict our attention to Turing Machines that have only {0,1} as their input alphabet and {0,1, `\square`} at their tape alphabet.
- In what sense can such a machine simulate a machine with a larger input or tape alphabet? (Suggest a method).
- In terms of speed, how much of a slowdown is such a simulation?
- Post your solution to the Apr 15 In-Class Exercise Thread.
Semi-infinite tape
- Suppose rather than having a two way infinite tape we instead have a tape which is infinite only to the right and where the machine starts off on the left hand square of the input.
- If the machine ever tries to move off to the left hand side of the tape it just stays on that left hand square.
- This can be simulated by a stay-put TM (and hence, by the last slide, a usual TM) by having our machine as follows:
- For each tape symbol `a` we have a new symbol `\ul{a}`. Here `\ul{a}` will be used to mean we are on the left hand side of the tape reading an `a`.
- The first move of our machine replaces whatever symbol `a` it was reading with `\ul{a}`.
- Thereafter, our machine acts like a usual TM. For each transition which moves right `delta(q,a)->(r,b,R)` we also add a transition `delta(q, \ul{a}) -> (r, \ul{b}, R)`.
- For each transition that moves left `delta (q,a) ->(r, b, L)`, we add `delta( q, \ul{a})->(r, \ul{b}, S)`.
Semi-infinite tape machines can simulate usual TMs.
- The idea is to increase the tape alphabet `Gamma`. Let `Gamma'` be `Gamma cup {\ul{a} | a in Gamma}`, and let the new alphabet be `Gamma cup ( Gamma' times Gamma')`. This is still finite.
- The simulator acts by first replacing the input `w_1, ldots, w_n` with `(\square, \ul{w_1}),
(\square, w_2) ldots (\square, w_n)`.
- Now we have for each original transition a transition which acts on the left hand side of a symbol.
- Similarly, we have for each original transition a transition which acts on the right hand side of a symbol.
- For each state in the original machine, we have two states corresponding to whether we are acting on the left or right hand coordinate.
- We also have transitions which when we move left in a position with an underscore in the right coordinate we "move" onto the left hand coordinate. I.e., we can start affecting it. Then for transitions in the original machine to the left again we would have transitions which move left on the left hand coordinate and vice versa. The right hand cordinate thus, behaves as the squares in the original machine to the
right of the first square of the input.
- To make things complete, we need also some transitions to handle if we move off the right hand side of the squares seen so far onto a square labelled with just `\square` to convert this to `(\square, \square)`.
Off-line Turing Machines
- Offline Turing Machines are a TM variant defined in Stearns, Hartmanis, Lewis (1965). An offline TMs have two tapes:
- They have an input tape which is read only on which the input is originally written.
- They have a work tape which is initially blank but which is read write.
- Offline machines can simulate usual machines by first copying the input tape to the work tape and then doing all further work on the work tape like a usual TM.
- Offline Turing Machine's are often used to model computations that take less than linear space. When measuring how much space is used, we count only the read-write tape, not the read only input tape.
- Let's show an offline TM can be simulated by a usual TM.
- The basic idea is to introduce a new symbol `#` to denote the stop and end of tape configuration. We also introduce underscore versions of each tape symbol.
- If the input to the offline machine is `w_1 ldots w_n`, our simulator first converts it to the single string `# \ul{w_1}w_2 ldots w_n#\ul{\square}#`. Between the first two `#`'s represents the contents of the input tape, between the second two represents the contents of the work tape that we might have affected (initially, only the square we start at). The underscores indicate which square is being read.
- To simulate one step of the offline TM we scan our tape left to right to determine which symbols are under the tape head. Then we scan right to left to update the tapes according to the offline tape's transition.