Theory of Computation Tutorial
Finite automata, regular expressions, context-free grammars, pushdown automata, Turing machines and decidability.
Theory of Computation (TOC) studies what problems can be solved by a computer, and how efficiently, using abstract mathematical models of computation called automata.
Basic Terminology
| Term | Definition | Example |
|---|---|---|
| Alphabet (Σ) | A finite, non-empty set of symbols | Σ = {0, 1} |
| String | A finite sequence of symbols from Σ | 0110 |
| Length |w| | Number of symbols in w | |0110| = 4 |
| Empty string (ε) | The string of length 0 | |ε| = 0 |
| Σ* | All strings over Σ, including ε (Kleene closure) | {ε, 0, 1, 00, 01, …} |
| Σ⁺ | Σ* − {ε} (positive closure) | {0, 1, 00, …} |
| Language | Any subset of Σ* | L = {w | w ends in 01} |
Chomsky Hierarchy
| Type | Grammar | Language | Machine | Production form |
|---|---|---|---|---|
| 3 | Regular | Regular | Finite automaton | A → aB | a |
| 2 | Context-free | CFL | Pushdown automaton | A → γ |
| 1 | Context-sensitive | CSL | Linear bounded automaton | αAβ → αγβ, |γ| ≥ 1 |
| 0 | Unrestricted | Recursively enumerable | Turing machine | α → β |
Regular ⊂ Context-free ⊂ Context-sensitive ⊂ Recursive ⊂ Recursively enumerable
Track your progress through the Theory of Computation course