Unit V: Turing Machines

Unit V: Turing Machines & Recursive Function Theory

Complete Exam Preparation – 100% Coverage with Examples & Proof Ideas


1. Turing Machine – Formal Definition (7-tuple)

M = (Q, Σ, Γ, δ, q₀, B, F)

  • Q → finite set of states
  • Σ → input alphabet (does not contain B)
  • Γ → tape alphabet (Σ ⊆ Γ, contains B = blank)
  • δ: Q × Γ → Q × Γ × {L, R} → transition function
  • q₀ → start state
  • B → blank symbol
  • F ⊆ Q → accepting (final) states

2. Instantaneous Description (ID)

Represented as: X₁X₂…Xᵢ₋₁ q Xᵢ Xᵢ₊₁…Xₙ
q is current state, head is on Xᵢ

3. Language Accepted by TM

  • Acceptance by Final State: Enter any state in F
  • Acceptance by Halting: Reach a state where δ is undefined
Both definitions are equivalent in power → recognize Recursively Enumerable (RE) languages

4. Techniques for TM Construction (Most Asked)

TM for { aⁿ bⁿ cⁿ | n ≥ 0 }
1. Match first a with first b → replace with X,Y
2. Go back, match remaining a with next b
3. Repeat until all matched
4. Then match remaining b with c
→ Requires multiple passes → only TM can do this!
TM for { ww | w ∈ {a,b}* } (copying)
1. Remember first symbol
2. Mark it, go to end
3. Write same symbol at end
4. Repeat until blank
→ Classic 10–12 marks question

5. Variants of Turing Machines (All Equally Powerful)

VariantPower
Multi-tape TMSame as single tape
Non-deterministic TMSame as deterministic
TM with stay-put (no move)Same
Two-way infinite tapeSame
Multi-dimensional tapeSame

6. Turing Machine as Computer of Functions

TM can compute any partial recursive function
Input: number n in unary → Output: f(n)

7. Universal Turing Machine (UTM)

There exists a TM U such that:
Given encoding ⟨M⟩ of any TM M and input w,
U simulates M on w and behaves exactly like M
UTM = Stored-program computer → Foundation of modern computers

8. Linear Bounded Automata (LBA)

TM with tape restricted to input length + end markers

L(LBA) = Context-Sensitive Languages (Type-1)

9. Church-Turing Thesis (Most Important Statement)

Church-Turing Thesis:
Any function that can be computed by an algorithm can be computed by a Turing Machine.

Not provable, but universally accepted

10. Recursive and Recursively Enumerable Languages

TypeAccepted ByDecidable?
Recursive (R)TM that always haltsYes (always Yes/No answer)
Recursively Enumerable (RE)General TMMay loop on No
R ⊂ RE (proper subset)

11. The Halting Problem (Undecidability)

HALT = { ⟨M, w⟩ | TM M halts on input w } is undecidable

Proof by contradiction (diagonalization):
Assume H exists → construct H' that does opposite → paradox

12. Post’s Correspondence Problem (PCP)

PCP is undecidable → used to prove many problems undecidable

Instance: Two lists A = [a₁,…,aₙ], B = [b₁,…,bₙ]
Question: Is there sequence i₁…iₖ such that aᵢ₁…aᵢₖ = bᵢ₁…bᵢₖ ?

13. Introduction to Recursive Function Theory

  • Primitive Recursive Functions: zero, successor, projection, composition, primitive recursion
  • μ-recursive Functions: add unbounded minimization → total Turing computable
  • Ackermann function → grows faster than primitive recursive

14. Summary Table (Quick Revision)

MachineLanguage ClassDecidable?
DFARegularYes
PDAContext-FreeMembership yes, others mostly no
LBAContext-Sensitive
TM (halting)RecursiveYes
TM (general)Recursively EnumerableMay loop

Most Important Exam Questions – Unit V (15–20 Marks Guaranteed)

  1. Design TM for {aⁿbⁿcⁿ}, {ww}, palindrome, addition, etc. (12–15 marks)
  2. Prove Halting Problem is undecidable (full proof)
  3. Explain Universal TM with diagram
  4. Prove PCP is undecidable (outline)
  5. Difference between Recursive and RE languages
  6. Show that if L and L̅ both RE → L is recursive
  7. Church-Turing Thesis and its significance
  8. Prove equivalence of multi-tape and single-tape TM

Quick One-Liners for Last Minute

  • TM = Most powerful model
  • Halting Problem = First undecidable problem
  • UTM = Theoretical computer
  • Two stacks = TM power
  • Recursive = always halts
  • RE = may loop on rejection
  • Church-Turing = Algorithm = TM-computable