A theory of computation is the branch of computer science and mathematics that explores the fundamental capabilities and limits of computers. It asks “What can be computed?” (computability), “How efficiently?” (complexity), and “How do we model computation?” (formal systems).
---
1. Models of Computation
Finite Automata (FA)
– Abstract machines with a finite set of states.
– Recognize regular languages (e.g., patterns describable by regular expressions).
Pushdown Automata (PDA)
– FA augmented with a stack.
– Recognize context‑free languages (e.g., balanced parentheses, many programming‐language grammars).
Turing Machines (TM)
– An infinite‐tape machine with read/write head.
– Captures the notion of general computation; underlies the Church–Turing thesis (anything “effectively computable” is TM‐computable).
---
2. Formal Languages & Grammars
Regular Languages ↔ Regular expressions, FA
Context‑Free Languages ↔ Context‑free grammars, PDA
Context‑Sensitive Languages ↔ Linear‐bounded automata
Recursively Enumerable & Recursive Languages ↔ TMs that accept or decide
These classes form the Chomsky hierarchy, a nested set of language families with strictly increasing expressive power.
---
3. Computability (Decidability)
A problem is decidable if a TM always halts with “yes”/“no.”
Undecidable problems (e.g., the Halting Problem) have no algorithmic solution.
Reducibility lets us prove undecidability by transforming one problem into another.
---
4. Complexity Theory
Time Complexity: How runtime grows with input size (e.g., O(n), O(n²)).
Space Complexity: How memory usage grows.
Classes:
P: decidable in polynomial time by a deterministic TM.
NP: verifiable (or solvable nondeterministically) in polynomial time.
NP‑Complete: the “hardest” problems in NP; if any NP‑complete problem is in P, then P = NP.
PSPACE, EXP, and beyond.
Trade‑offs: Time vs. space, deterministic vs. nondeterministic.
---
5. Key Theorems & Results
P vs. NP: Open question—are all efficiently verifiable problems efficiently solvable?
Cook–Levin Theorem: SAT is NP‑complete.
Rice’s Theorem: Any nontrivial semantic property of programs is undecidable.
Savitch’s Theorem: Nondeterministic space S can be simulated in deterministic space S².
---
6. Why It Matters
Language Design: Grammars and automata underpin compilers and interpreters.
Algorithm Limits: Knowing which problems are intractable or undecidable guides practical work.
Cryptography: Security often relies on hardness assumptions (e.g., factoring ∉ P).
Verification & Model Checking: Ensures software/hardware correctness using decidable fragments.
By rigorously modeling computation, the theory of computation provides the bedrock for understanding what computers can—and fundamentally cannot—do, shaping everything from programming languages to cryptography and beyond.
A theory of computation is the branch of computer science and mathematics that explores the fundamental capability and th