Universal Turing Machine

Context: FIT2014_MOC · one Turing machine that runs all the others, by reading them as data via Encoding Turing Machines (Code Words) · the theoretical ancestor of the stored-program computer

Quick Revision

  • 🎯 Objective: a single fixed TM taking \langle M\rangle\,\texttt{\},xMxMx$.
  • ⚠️ Key Constraint: has a finite state set but must simulate machines with arbitrarily many states — so the simulated state is held on the tape, and only the current letter is carried in ‘s own states.

📝 Definition and input format

A Universal Turing Machine is a Turing Machine that takes as input (i) an encoding of some Turing Machine and (ii) a string to be used as input to , and simulates the execution of on .

  • The \texttt{\}$ ➔ marks the end of the TM encoding and the start of its input; without it the head cannot tell program from data on a single tape.
  • Worked input ➔ for with , , and :
    • TM: abaaabaaaabababababbaaabaabaaaab
    • Data: bbbaa
  • Both regions are re-read constantly shuttles between them once per simulated step, which is where its slowdown comes from.

⚙️ The simulation algorithm

  1. Move right to the first letter of the encoded TM’s input. Read it, mark it so the position can be found again (, ), and remember it in ‘s choice of state.
  2. Move left to the first instruction of .
  3. Scan the instructions for the one matching (current simulated state, remembered letter). Then:
    • If its To-state is the Accept state : read off what to write and which way to move, remember them in ‘s state, move right to the marked position, write the required letter, move in the required direction, and Accept.
    • Else: read off what to write and the direction, remember them, move right to the marked position, write the letter and move; then read and mark the new current letter, remember it, and move left to locate the next instruction.
  • What lives where ➔ the simulated state number is located positionally within (which instruction block is standing in); the simulated tape is the data region; the one remembered letter plus the pending write/direction are all keeps in its own finite control.
  • Why marking is essential leaves the data region on every step; is the bookmark that lets it return to the exact simulated head position.

⏱️ Cost of simulation

🧭 Why UTMs matter

  • One machine simulating another ➔ the first formal model of interpretation: a program is an input, not a wiring diagram.
  • Stored-program computer ➔ program and data share one memory, exactly as and share one tape.
  • von Neumann architecture ➔ the engineering realisation of that idea; the UTM is its mathematical precursor.
  • Existence, not just definition exists because the decoding pass of Encoding Turing Machines (Code Words) is a finite, mechanical, left-to-right procedure, and by the Church–Turing thesis any such procedure is itself implementable as a TM.

⚠️ Common Mistakes

  • 💡 is one fixed machine ➔ it is not “a machine per “. Universality means a single finite program handles all encodings, which is the whole claim.
  • 💡 The simulated state is not a state of ‘s finite control cannot hold an unbounded state number; it holds only the current letter and the pending write/direction, and finds the state positionally in the encoding.
  • 💡 Don’t skip the \texttt{\}$ ➔ program and data must be separable on one tape; a missing separator is a common lost mark when asked to lay out the UTM’s input.
  • 💡 Simulation costs time, not power is slower by a factor , but accepts exactly the strings accepts, loops exactly where loops.

🧠 Active Recall