4.6.14Theory of Computation

Variants — multi-tape TM, non-deterministic TM, all equivalent

2,333 words11 min readdifficulty · medium

WHY do we care about variants?

  • WHAT changes between variants: number of tapes, number of heads, direction of tape, whether transitions are unique (deterministic) or branching (non-deterministic).
  • WHY it matters: if a tiny tweak gave new power, "computable" would be an arbitrary, fragile notion. Instead every reasonable tweak is equivalent ⇒ the boundary of computability is a real, model-independent thing.
  • HOW we prove equivalence: build a simulator. To show model BB is no stronger than model AA, write an AA-machine that, given BB's description, reproduces every step of BB. Equivalence = simulation in both directions.

Variant 1 — The Multi-tape TM

Theorem: every multi-tape TM has an equivalent single-tape TM

Figure — Variants — multi-tape TM, non-deterministic TM, all equivalent

Variant 2 — The Non-deterministic TM (NTM)

Theorem: every NTM has an equivalent deterministic TM (DTM)


Why all of these collapse to one model


Recall Feynman: explain it to a 12-year-old

Imagine a kid solving a maze with one notebook page and a pencil. Now give a richer kid three notebook pages, or let them magically split into copies that each try a different turn. The rich kids finish faster. But here's the cool part: the one-page kid can copy what the rich kids do — draw three little boxes on the one page (pretend pages), or try every path one after another, slowly but surely. So in the end, any maze the rich kids can solve, the one-page kid can also solve — just slower. Same brain power, different speed. That's why all Turing machines, fancy or plain, can solve exactly the same problems.


Active-recall flashcards

What is the transition function type of a kk-tape TM?
δ:Q×ΓkQ×Γk×{L,R}k\delta:Q\times\Gamma^k \to Q\times\Gamma^k\times\{L,R\}^k — reads kk symbols at once, writes kk, moves all kk heads independently.
How does a single tape simulate kk tapes?
Store the kk tape contents side-by-side separated by #, mark each virtual head with a dotted symbol; one sweep reads all heads, a second sweep writes updates and moves dots, shifting right to grow a virtual tape.
What is the time slowdown of multi-tape → single-tape simulation?
Quadratic: O(t(n)2)O(t(n)^2), because used tape is O(t(n))O(t(n)) long and each step takes ~2 full sweeps.
What is the acceptance rule for a non-deterministic TM?
Accept ww iff at least one branch of the computation tree reaches an accept state.
Why must the NTM→DTM simulation use BFS, not DFS?
DFS can fall into an infinite non-accepting branch and never explore a nearby accepting one; BFS explores all depth-dd nodes first, guaranteeing any finite accepting branch is found.
What does the 3rd tape store in the NTM→DTM simulation?
The branch "address" — a string over {1..b}\{1..b\} telling which choice to take at each step; we iterate these in shortest-first (BFS) order.
What is the time cost of NTM→DTM simulation and why?
2O(t(n))2^{O(t(n))}, because the computation tree has up to bt(n)b^{t(n)} nodes and the DTM may visit them all.
Does non-determinism add computational power?
No — it recognizes exactly the same languages as deterministic TMs. It may change efficiency, never computability.
What does "robustness" of the TM model mean?
Reasonable changes to the definition (tapes, non-determinism, two-way tape) do not change the class of decidable/recognizable languages.
Which famous thesis is supported by all variants being equivalent?
The Church–Turing thesis: anything effectively computable is computable by a single-tape deterministic TM.

Connections

Concept Map

is evidence for

proven via

imitates step by step

adds k tapes and heads

adds branching / guessing

simulated by

simulated by

but never gains

defines

stays fixed shows

Church-Turing thesis

Robustness of TM model

Simulation technique

Single-tape deterministic TM

Multi-tape TM

Non-deterministic TM

Runs faster / easier to program

Same computable class

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, Turing machine ka basic version ek single tape pe chalta hai. Ab sawaal ye hai: agar hum machine ko aur "powerful" bana dein — jaise multiple tapes de dein, ya use guess karne ki magical power de dein (non-deterministic) — to kya wo aise problems solve kar legi jo basic wali nahi kar sakti? Jawab hai: NAHI. Speed badal sakti hai, lekin kya solve ho sakta hai wo same rehta hai. Isko hum simulation se prove karte hain.

Multi-tape ka case: socho 3 tapes hain. Hum un teeno ko ek hi tape pe side-by-side rakh dete hain, beech mein # separator daal ke, aur har virtual head ko ek "dotted" symbol se mark kar dete hain. Ek step simulate karne ke liye single tape do baar scan karta hai — pehle saare heads padhne ke liye, phir naye symbols likhne aur dots ko move karne ke liye. Cost thoda badhta hai (O(t(n)2)O(t(n)^2), yaani quadratic), par power bilkul same.

Non-deterministic TM ek tree ki tarah branch karti hai — har step pe kai choices. Accept tab hota hai jab koi ek bhi branch accept kar de. Deterministic machine isko BFS (breadth-first search) se imitate karti hai: ek 3rd tape pe branch ka "address" likh ke har possible path try karti hai, chhoti depth se shuru karke. DFS isliye nahi karte kyunki ek galat branch infinite chal sakti hai aur machine wahin atak jaati. Cost yahan exponential ho jaata hai (2O(t(n))2^{O(t(n))}) — aur yahi P vs NP question ka dil hai!

Bottom line: tapes badhao ya guesses badhao, reach same rehti hai, sirf ghadi (time) complain karti hai. Yahi robustness Church–Turing thesis ka proof hai — "computable" ek solid, model-independent cheez hai.

Go deeper — visual, from zero

Test yourself — Theory of Computation

Connections