A Turing Machine (TM) is a theoretical model of computation used to define what can be computed.
It consists of:
A Turing Machine is defined as:
M = (Q, Σ, δ, Γ, q0, B, F)
Where:
Q → finite set of statesΣ → input alphabetδ → transition functionΓ → tape alphabet (Σ ⊆ Γ)q0 → start stateB → blank symbolF → set of final (accepting) statesδ(q, a) = (p, b, D)
Meaning:
qapbDWhere:
D = L (left), R (right), S (stay)Example:
q0,a → q1,X,R
q1,a → q1,a,R
Meaning:
q0, reading a → write X, move right, go to q1q1, reading a → read a, move rightSame rules in table form:
| Current State | a | B |
|---|---|---|
| q0 | (q0,X,R) | Halt |
| q1 | (q1,a,R) | Halt |
L = { 0ⁿ | n ≥ 1 }
Goal: Accept strings with only a
a with Xq0,0 → q1,0,R
q1,0 → q1,0,R
q1,B → qf,B,R
| State | 0 | B |
|---|---|---|
| q0 | (q1,0,R) | Halt |
| q1 | (q1,0,R) | (qf,B,R) |
| qf | Halt | Halt |
000B
(B = blank)
q0000B
q0000BBq100BBq10BBq1BBqfBTM works by marking symbols
Uses back-and-forth scanning
Always track:
TM = most powerful computational model
Works using read → write → move
Problems solved via marking + scanning
Always show: