CS 637: Mathematics-II

Lecture 6: What is Turing Computable?

The Hierarchy of Computational Power

Not all computational models are created equal. As we relax restrictions on memory and access, the class of languages recognized grows larger.

Turing Recognizable (RE) Decidable (Recursive) Context-Free (PDA) Regular (DFA)

Regular (DFA/NFA)

Memory: Finite states only.

Example: \( L = \{ w \in \{0,1\}^* \mid w \text{ has even 0s} \} \)

Limit: Cannot count arbitrarily high.

Context-Free (PDA)

Memory: Infinite Stack (LIFO).

Example: \( L = \{ 0^n 1^n \mid n \ge 0 \} \)

Limit: Can only compare two dependent parts.

Turing Machine

Memory: Infinite Tape (Random Access).

Example: \( L = \{ 0^n 1^n 0^n \mid n \ge 0 \} \)

Power: Can solve anything algorithmically solvable.

Multitape Turing Machines

A Multitape TM has \(k\) tapes, each with an independent head. \[ \delta: Q \times \Gamma^k \to Q \times \Gamma^k \times \{L, R, S\}^k \] This allows specific operations (like copying strings) to be done in \(O(n)\) time, whereas a single tape might take \(O(n^2)\).
Example: Checking if a string is a palindrome \(w = w^R\).
  1. Single Tape: Zig-zag back and forth matching first and last chars. \(O(n^2)\).
  2. 2-Tape: Copy input to Tape 2. Move Tape 1 head to start, Tape 2 head to end. Move heads towards each other comparing symbols. \(O(n)\).

Equivalence Proofs

To show two models are equivalent, we must show that they can simulate each other.

1. Multitape \(\equiv\) Single Tape

We can flatten \(k\) tapes onto a single tape by using delimiters (\#) and marking virtual head positions with dotted symbols.

Logical View (2 Tapes): Tape 1: [a][b][c]... Tape 2: [1][0][1]... Physical View (1 Tape): # a b c # 1 0 1 # Head 1 Head 2

2. Doubly-Infinite Tape \(\equiv\) Semi-Infinite Tape

A standard TM has a left boundary. A doubly-infinite TM does not. We simulate the doubly-infinite one by "folding" it at the origin.

The Fold Trick: Map position \(i\) of the infinite tape to the semi-infinite tape:
  • If \(i \ge 0\), map to \(2i\) (Even cells).
  • If \(i < 0\), map to \(2(-i) - 1\) (Odd cells).

Interactive Simulation: Binary Adder

This 3-Tape machine adds two binary numbers. Input is placed on Tape 1 (e.g., "101+11").

Logs will appear here...
Algorithm:
  1. Scan Tape 1 to copy the first number to Tape 2 (reversed) and second number to Tape 3 (reversed).
  2. Reset heads on Tape 2 and 3.
  3. Perform addition bit-by-bit from left to right (since numbers are reversed), writing sum to Tape 1.
  4. Handle carry.
  5. (In a real TM, we would reverse Tape 1 again to get final result, simplified here).

Halting vs. Acceptance

This distinction is the foundation of Computability Theory.

Turing-Recognizable (RE)

A language \(L\) is RE if there exists a TM \(M\) such that:

  • If \(w \in L\), \(M\) halts and accepts.
  • If \(w \notin L\), \(M\) either rejects or loops forever.

Turing-Decidable (Recursive)

A language \(L\) is Decidable if there exists a TM \(M\) such that:

  • If \(w \in L\), \(M\) halts and accepts.
  • If \(w \notin L\), \(M\) halts and rejects.

(No infinite looping allowed!)

The Halting Problem: Determining whether an arbitrary TM halts on an arbitrary input is Undecidable. This means the circle of Decidable languages is strictly smaller than the circle of Recognizable languages.

Other Variations of Turing Machines

All of the following are equivalent in power to the standard Single-Tape DTM.

1. Enumerators
A TM with a "printer" attached. Instead of accepting/rejecting inputs, it starts with a blank tape and prints out strings.
Theorem: A language is Turing-Recognizable iff some enumerator enumerates it.
2. Two-Dimensional Tape
The tape is an infinite grid. The head can move L, R, U, D.
Simulation: Map \( \mathbb{Z}^2 \to \mathbb{Z} \) using a spiral mapping (Cantor pairing function).
3. Random Access Memory (RAM)
Similar to modern computers with registers and memory addresses.
Equivalence: A TM can simulate RAM by using one tape for memory addresses and another for values. It's slower (polynomial slowdown), but computes the same functions.

The Universal Turing Machine (UTM)

A standard TM is hardwired to do one task. A UTM is a programmable machine.

ConceptSimulation
A UTM \(U\) takes as input the description of another machine \(M\) and an input string \(w\). \[ \text{Input: } \langle M, w \rangle \] \(U\) simulates the execution of \(M\) on \(w\).
Significance: This is the theoretical basis for modern "Stored-Program Computers" (Von Neumann Architecture). Your laptop is essentially a physical realization of a Universal Turing Machine.

Encoding: We encode the states, alphabet, and transition function of \(M\) into a string (e.g., binary). The UTM reads this description on one tape and the contents of \(M\)'s simulated tape on another.

The Church-Turing Thesis

"Everything that is intuitively computable can be computed by a Turing Machine."


This is a hypothesis, not a theorem. It equates the informal notion of an "Algorithm" with the formal mathematical definition of a Turing Machine.

Why do we believe it?

  • Many different models were proposed in the 1930s (Lambda Calculus, Recursive Functions, Post Systems).
  • All were proven to be mathematically equivalent to TMs.
  • No one has ever found a physically realizable computation method that is more powerful than a TM (Quantum computers are faster, but not "more powerful" in terms of computability).

Nondeterministic Turing Machines (NDTM)

DefTransition Function Difference

Deterministic (DTM): \(\delta: Q \times \Gamma \to Q \times \Gamma \times \{L, R\}\)

Nondeterministic (NDTM): \(\delta: Q \times \Gamma \to \mathcal{P}(Q \times \Gamma \times \{L, R\})\)

An NDTM accepts input \(w\) if at least one branch of the computation tree leads to \(q_{accept}\).

Theorem: Every Nondeterministic Turing Machine has an equivalent Deterministic Turing Machine.

Simulation Strategy (Proof Sketch)

We use a DTM with 3 tapes to simulate the NDTM using Breadth-First Search (BFS) on the computation tree.

Start Acc BFS ensures we find the green node eventually.
  • Tape 1: Holds the original input \(w\) (read-only).
  • Tape 2: Simulation tape (scratchpad).
  • Tape 3: Address tape. Stores a sequence (e.g., 1-2-3-1) telling the NDTM which choice to make at each step.
🏠