Computability Theory Introduction
Introduction to the Theory of Computing
This course explores the fundamental capabilities and limitations of computers and algorithms. It is divided into two halves.
Course Overview
Computability theory asks what can be computed in principle using an algorithm. This field was largely completed by the 1950s after its major questions were answered. Examples of uncomputable problems include:
Automatically verifying whether a program meets its specification.
Determining whether an arbitrary mathematical statement is true or false.
Complexity theory shifts focus to what can be computed in practice—that is, within a reasonable amount of time. A central open problem is whether large numbers can be factored quickly, connected to the famous P versus NP problem. The course also examines other measures of complexity such as time and memory (space), and introduces models like probabilistic and interactive computation.
Prerequisites and Expectations
This is a moderate-to-advanced mathematics class. Students are expected to have substantial prior experience with mathematical theorems and proofs. The course begins slowly but ramps up quickly. Homework and exams require producing proofs, so comfort with proof-writing is essential.
The Role of Theory in Computer Science
Theoretical computer science aims to deepen our understanding of computation. Many fundamental questions remain unanswered—for example, how the brain computes, or why creative tasks are so difficult for machines. Understanding the power and limits of computation is a deep and ongoing challenge, and the elegant theory covered in this course has already paid off in applications and will likely continue to do so.
Models of Computation
Real-world computers are too complex to study mathematically. Instead, we use abstract models that capture essential features. The first and simplest model is the finite automaton.
Finite Automata (Informal)
A finite automaton is a machine with a small, limited amount of memory. It processes an input string one symbol at a time and either accepts or rejects the string.
A state diagram represents the automaton:
States are circles (e.g., q1,q2,q3).
Transitions are arrows between states, labeled with input symbols.
One state is the start state (arrow coming from nowhere).
Accepting states are double circles.
Example M1: The automaton below accepts strings that contain the substring 11.
(start) → q1 --0--> q1
q1 --1--> q2
q2 --0--> q1
q2 --1--> q3
q3 --0,1--> q3Processing the string 01101:
Start at q1.
Read
0→ stay at q1.Read
1→ go to q2.Read
1→ go to q3.Read
0→ stay at q3 (since q3 loops on both symbols).Read
1→ stay at q3.End in q3 (accept state) → accept.
Processing 00101 ends in q2 (not accepting) → reject.
The language of a machine M is the set of all strings it accepts, denoted L(M). For M1, L(M1)={strings containing 11}.
Formal Definition of a Finite Automaton
A finite automaton is a 5-tuple (Q,Σ,δ,q0,F):
Q: a finite set of states.
Σ: a finite set of alphabet symbols.
δ: the transition function δ:Q×Σ→Q that maps a state and an input symbol to a next state. Represented by a table or diagram.
q0∈Q: the start state.
F⊆Q: the set of accept states.
Example (M1 formalized):
Q={q1,q2,q3}
Σ={0,1}
δ:
State
0
1
q1
q1
q2
q2
q1
q3
q3
q3
q3
q0=q1
F={q3}
Strings and Languages
A string is a finite sequence of symbols from the alphabet (Σ). (Infinite strings are not considered in this course.)
A language is a set of strings.
The empty string ε is the string of length 0.
The empty language ∅ is the set containing no strings. These are different objects.
Formal Definition of Acceptance
Let w=w1w2…wn be an input string. A finite automaton M=(Q,Σ,δ,q0,F) accepts w if there exists a sequence of states r0,r1,…,rn such that:
r0=q0 (starts at the start state),
δ(ri−1,wi)=ri for i=1,…,n (each step follows the transition function),
rn∈F (ends in an accept state).
Regular Languages
A language is regular if there exists some finite automaton that recognizes it.
Examples:
Even number of 1s: The language B={w∈{0,1}∗∣w has an even number of 1s} is regular. A two-state automaton tracking parity can recognize it.
Equal number of 0s and 1s: This language is not regular — no finite automaton can recognize it (to be proven later).
Regular Operations
Operations on languages that produce new languages:
Union
The union A∪B={w∣w∈A or w∈B}.
Concatenation
The concatenation A∘B={xy∣x∈A and y∈B}. Often written as AB.
Star (Kleene Star)
The star A∗={x1x2…xk∣k≥0 and each xi∈A}. This always includes ε (the empty string) as the case k=0.
Examples (with A={good, bad}, B={boy, girl}):
A∪B={good, bad, boy, girl}
A∘B={goodboy, goodgirl, badboy, badgirl}
A∗={ε,good, bad, goodgood, goodbad, badgood, badbad, goodgoodgood, …} (infinite)
If A contains any non-empty string, A∗ is infinite. If A=∅ or A={ε}, then A∗={ε}.
Regular Expressions
Regular expressions describe languages using the regular operations. They consist of:
Atomic building blocks: alphabet symbols (e.g., 0,1), the empty string ε, the empty language ∅.
Composite expressions formed by applying union (∪), concatenation (juxtaposition), and star (∗).
Examples (over Σ={0,1}):
Σ∗ (or (0∪1)∗) is the language of all strings.
Σ∗1 is the set of all strings ending with 1.
Σ∗11Σ∗ is the set of all strings containing 11 — exactly the language of M1.
Equivalence: Finite automata and regular expressions are equally powerful — they both describe exactly the regular languages. This will be proved later.
Closure Properties
A class of objects is closed under an operation if applying that operation to objects in the class always yields another object in the same class. The class of regular languages is closed under union, concatenation, and star.
Closure Under Union
Theorem: If A1 and A2 are regular languages, then A1∪A2 is regular.
Proof:
Since A1 and A2 are regular, there exist finite automata M1=(Q1,Σ,δ1,q1,F1) and M2=(Q2,Σ,δ2,q2,F2) that recognize them. (We assume the same alphabet; the proof is similar otherwise.)
Construct a new automaton M that simulates M1 and M2 in parallel on the input w. M keeps track of which state M1 is in and which state M2 is in simultaneously.
State set of M: Q=Q1×Q2={(r1,r2)∣r1∈Q1,r2∈Q2}.
Start state: (q1,q2).
Transition function: δ((r1,r2),a)=(δ1(r1,a),δ2(r2,a)) for every a∈Σ.
Accept states: F={(r1,r2)∣r1∈F1 or r2∈F2} — because M should accept if either component accepts.
Then L(M)=L(M1)∪L(M2), so the union is regular.
Number of states: ∣Q∣=∣Q1∣×∣Q2∣ (product, not sum).
Note: The same construction using accept states {(r1,r2)∣r1∈F1 and r2∈F2} would give closure under intersection.
Closure Under Concatenation (Intuition and Challenge)
Theorem: If A1 and A2 are regular, then A1A2 is regular.
The natural approach: build an automaton M that first simulates M1 (which recognizes A1) and then, when M1 would accept, switches to simulating M2 (which recognizes A2). One might try to connect every accept state of M1 to the start state of M2 via ε-transitions, making those accept states non-accepting and making accept states of M2 the new accept states.
Why this naive approach fails: The correct split of w into two parts w=xy with x∈A1, y∈A2 is unknown. The first time M1 would accept after reading a prefix may not be the correct split; the true split might occur later. Since M cannot “look ahead” to see the rest of w, a single deterministic simulation cannot guess the split point.
Nevertheless, the theorem is true. The proof requires a more powerful concept — nondeterminism — which will be introduced next. Closure under concatenation will be proved in a subsequent lecture.
This concludes the first lecture. Upcoming topics include nondeterministic finite automata (NFA), proving the equivalence of regular expressions and finite automata, and establishing closure under all regular operations using these tools.

Ask anything
We've read this whole study set, so questions about it get the best answers.