Theory of Computation & Computer Graphics β Turing Machine, NEC licence examination syllabus (Nepal Engineering Council).
TM with Multiple Tapes
Several tapes with independent heads β no extra power, but a genuine and quantifiable gain in speed.
π Where this lives: Multi-tape machines are the model behind almost every complexity result you will meet. When a textbook says an algorithm runs in O(n log n), the implicit machine is multi-tape β because on a single tape even simple tasks acquire an artificial quadratic penalty from head travel. The choice of machine model changes the exponent, which is why complexity theory fixes a model before stating any bound. Search "multitape Turing machine complexity model random access".
ββ OTHER USES OF EXTRA TAPES βββββββββββββββββββββββββββββββ
1. A WORK TAPE separate from the input, so the input is never
destroyed and can be re-read.
2. AN OUTPUT TAPE, written left to right and never re-read β
the standard arrangement for a transducer.
3. A COUNTER TAPE holding a number in binary, incremented as
the machine works.
4. A STACK, simulated on its own tape.
5. SORTING AND MERGING, where several sequences are traversed
at once.
THE PATTERN: EXTRA TAPES REPLACE HEAD TRAVEL WITH PARALLEL
ACCESS. Anything requiring the machine to compare or combine
data at distant positions becomes dramatically cheaper.
ββ THE STANDARD COMPLEXITY MODEL βββββββββββββββββββββββββββ
Complexity theory conventionally uses a machine with:
Β· a READ-ONLY input tape
Β· one or more READ-WRITE work tapes
Β· a WRITE-ONLY output tape
THE READ-ONLY INPUT TAPE IS ESSENTIAL FOR SPACE COMPLEXITY:
if the input counted as workspace, no computation could ever
use less than n space, and the sublinear space classes such as
L (logarithmic space) would be empty.
THIS IS WHY THE MODEL IS SPECIFIED SO CAREFULLY IN THE LATER
COMPLEXITY TOPICS β the definitions depend on it.
ββ THE INVARIANCE THESIS βββββββββββββββββββββββββββββββββββ
A refinement of the Church-Turing thesis that governs
complexity theory:
ALL REASONABLE SEQUENTIAL MODELS OF COMPUTATION SIMULATE
ONE ANOTHER WITH AT MOST POLYNOMIAL OVERHEAD.
Β· k-tape TM β 1-tape TM: quadratic
Β· RAM β TM: polynomial
Β· TM β RAM: polynomial
Β· every real computer β TM: polynomial
THIS IS WHY THE CLASS **P** IS ROBUST. "Solvable in polynomial
time" means the same thing on a Turing machine, a RAM, a
laptop or a supercomputer, because polynomial overhead
composed with a polynomial bound is still polynomial.
IT IS ALSO WHY COMPLEXITY THEORISTS ARE RELAXED ABOUT THE
EXACT MACHINE MODEL WHEN DISCUSSING P AND NP, AND VERY
PRECISE ABOUT IT WHEN DISCUSSING LINEAR OR SUBLINEAR
BOUNDS β where a quadratic simulation cost would swamp the
result being stated.
THE ONE MODEL THAT MAY BREAK THE THESIS IS THE QUANTUM
COMPUTER, which is believed β though not proved β to solve
some problems with more than polynomial speedup over classical
machines. IT DOES NOT CHANGE WHAT IS COMPUTABLE, only how
fast; a quantum computer computes exactly the same functions
as a Turing machine.
ββ THE VARIANTS SUMMARISED βββββββββββββββββββββββββββββββββ
VARIANT POWER TIME COST OF SIMULATION
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
multiple TRACKS same NONE
two-way infinite tape same none
stay-put option same none
larger alphabet same constant factor
MULTIPLE TAPES same QUADRATIC
multiple heads same polynomial
two-dimensional tape same polynomial
NON-DETERMINISM same EXPONENTIAL (believed
necessary)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
EVERY ROW SAYS "SAME POWER". The column that varies is TIME,
and that separation between COMPUTABILITY and COMPLEXITY is
the boundary between the first half of this section and the
second.
Every variant in this section has the same power; the column that varies is time. That separation β computability unchanged, complexity changed β is exactly the boundary between the first half of this section and the second.
π Go further: The read-only input tape in the standard complexity model is not a technicality. If the input counted as workspace, no computation could ever use less than n cells of space, and the sublinear space classes would be empty β including L, the class of problems solvable in logarithmic space, which contains genuinely useful algorithms like graph connectivity in undirected graphs. Separating "the data you were given" from "the scratch paper you may use" is what makes it meaningful to say an algorithm uses only O(log n) memory while reading a much larger input, which is precisely the situation of a streaming algorithm processing a data feed it cannot store. Search "logspace read-only input tape sublinear space complexity".