equivalence of tms and multitape tmsknowak/cs525_winter_2016_e/cs525_jo… · multitape turing...

13
Equivalence of TMs and Multitape TMs Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

Upload: others

Post on 30-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Equivalence of TMs and Multitape TMs

Theorem 3.13 and Corollary 3.15

By:

Joseph Lauman

Page 2: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Turing Machines

• First proposed by Alan Turing in 1936

• Similar to finite automaton, but with an unlimited and unrestricted memory

• Uses an infinite tape as its unlimited memory

• Has a tape head that can read and write symbols and move around on the tape

• Initially contains only the input string and is blank everywhere else

• If the machine needs to store information, it writes it on the tape

• To read, it can move its head back over it

Page 3: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Turing Machines

• It continues computing until it decides to produce an output

• The output’s accept and reject are obtained by entering designated accepting and rejecting states

• If it doesn’t enter a state, it will go on forever

Page 4: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Definition of a Turing Machine

• (Q, Σ, Γ, δ, q0, qaccept, qreject)

• Q, Σ, Γ are all finite sets

• Q is the set of states

• Σ is the input alphabet not containing the blank symbol

• Γ is the tape alphabet

• δ: Q x Γ Q x Γ x {L, R} is the transition function

• q0 is a subset of Q and is the start state

• qaccept is a subset of Q and is the accept state

• qreject is a subset of Q and is the reject state, where qreject != qaccept

Page 5: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Multitape Turing Machines

• Like a Turing machine, but with several tapes

• Each tape has its own head for reading and writing

• Each tape head moves independently of the other heads

• Initially, the input appears on tape 1 and the rest start out blank

• The transition function is changed to allow for reading, writing, and moving the heads on some or all of the tapes simultaneously

Page 6: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Definition of a Multitape Turing Machine

• (Q, Σ, Γ, δ, q0, qaccept, qreject)

• Q, Σ, Γ are all finite sets

• Q is the set of states

• Σ is the input alphabet not containing the blank symbol

• Γ is the tape alphabet

• δ: Q x Γk Q x Γk x {L, R, S}k is the transition function where k is the

number of tapes

• q0 is a subset of Q and is the start state

• qaccept is a subset of Q and is the accept state

• qreject is a subset of Q and is the reject state, where qreject != qaccept

Page 7: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Theorem 3.13

• Every multitape Turing machine has an equivalent single-tape Turing machine

• Convert a multitape Turing machine M to an equivalent single-tape Turing machine S.• The key idea is to show how to simulate M with S

Page 8: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Theorem 3.13

• Say that M has K tapes.

• Then S simulates the effect of k tapes by storing their information on its single tape

• Uses # as a delimiter to separate the contents of the different tapes

• S must also keep track of the locations of the heads.• Does this by writing a tape symbol with a dot above it to mark the place

where the head on that tape would be

• The dotted tape symbols are new symbols that are added to the tape alphabet

• Treat them as virtual tapes and heads

Page 9: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head
Page 10: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Theorem 3.13

• Representing three tapes with one

• S = On input w = w1 … wn:

• First S puts its tape into the format that represents all k tapes of M• The formatted tape contains #w1

*w2…wn #_*#_*#...#

• To simulate a single move, S scans its tape from the first #, which marks the left-hand end, to the (k+1)st #, which marks the right-hand end, in order to determine the symbols under the virtual heads.

• Then S makes a second pass to update the tapes according to the way that M’s transition function dictates.

Page 11: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Theorem 3.13

• If at any point S moves one of the virtual heads to the right onto a #, this action signifies that M has moved the corresponding head onto the previously unread blank portion of that tape.

• So S writes a blank symbol on this tape cell and shifts the tape contents, from this cell until the rightmost #, one unit to the right.

• Then it continues the simulation as before

Page 12: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Corollary 3.15

• A language is Turing-recognizable if and only if some multitape Turing machine recognizes it

• A Turning-recognizable language is recognized by an ordinary (single-tape) Turing machine, which is a special case of multitape Turing machine.• For k=1

• The rest follows from Theorem 3.13• For k=n, construct a single-tape Turing machine out of a k-tape Turing

machine in the same manner

Page 13: Equivalence of TMs and Multitape TMsknowak/cs525_winter_2016_e/CS525_Jo… · Multitape Turing Machines •Like a Turing machine, but with several tapes •Each tape has its own head

Questions?