Turing Machine
(TM)
Why Do We Need TM?
To Recognize More Powerful Languages
There are some languages (e.g., L = { aⁿbⁿcⁿ | n ≥ 1 }) that:
Cannot be recognized by Finite Automata (no memory)
Cannot be recognized by Pushdown Automata (single stack is not enough)
But a Turing Machine can recognize them.
Turing Machine (TM)
“A Turing Machine is a mathematical model of computation that can simulate
any algorithm. It is like a PDA, but with unlimited memory (a tape) and more
control over movement and rewriting.”
Formal Definition of TM
A Turing Machine (TM) is defined as a 7-tuple:
M=(Q ,Σ ,Γ, δ, q₀, B, F) where:
Q: Finite set of states
Σ: Input alphabet
Γ: is symbols allowed on tape
δ: Transition function
◦ δ: Q × Γ → Q × Γ × (L, R )
q₀: Start state, where q₀ ∈
Q
B: Blank Symbol
F: Set of accepting states, F⊆Q
Examples of Languages
Recognized by TM
Example 1: Language L = { aⁿbⁿ | n ≥ 1 }
Example 2: Language L = {aⁿ bn cn| n ≥ 1 }
Example 3: L = { w ∈ {a, b}* | wcw}
Example 4: L = { w ∈ {a, b}* | wcwR for odd palindrome}
Example 5: Language L = Equal Number of a’s and b’s
Examples of Languages
Recognized by TM
Example 6: Language: aⁿ (where n ≥ 1)
Example 7: Language L = {a2n+1 | n ≥ 0 }
Example 8: Language exactly ab
Example 9: ab (a+b)*