The Timpson Lyceum seal

The Timpson Lyceum · Computation Theory

Lecture 3 (Computation Theory) Graph Theory and Finite Automata

Overview

This lecture builds up the mathematical machinery needed for computation theory by working through progressively richer models. It opens by reviewing set operations, relations, and functions, then introduces graph theory (undirected and directed graphs) as a gentle first example of a formal mathematical model. After a short detour into proof technique — De Morgan's laws for sets and proof by induction with sigma notation — it arrives at the central object of the course: the finite automaton. Using a door-controller story and two recognizers over the binary alphabet, the lecture shows how a state diagram and a formal five-tuple are two equivalent descriptions of the same machine, and how a machine's language is the set of strings it accepts.

Key Concepts

Set operations (review). For sets A={1,2,3,4}A=\{1,2,3,4\} and B={3,4,5,6}B=\{3,4,5,6\}:

Relations and functions.

Graphs.

De Morgan's laws for sets. Mirroring the logical laws ¬(α∧β)≡¬α∨¬β\lnot(\alpha\land\beta)\equiv\lnot\alpha\lor\lnot\beta and ¬(α∨β)≡¬α∧¬β\lnot(\alpha\lor\beta)\equiv\lnot\alpha\land\lnot\beta: (A∪B)c=Ac∩Bc(A∩B)c=Ac∪Bc(A\cup B)^c=A^c\cap B^c \qquad (A\cap B)^c=A^c\cup B^c

Sigma notation. A compact way to write a sum: ∑k=1nak=a1+a2+⋯+an\sum_{k=1}^{n} a_k = a_1+a_2+\dots+a_n. The bottom gives the dummy variable and starting value; the top gives the ending value; you substitute each integer in turn and add. E.g. ∑k=15k=1+2+3+4+5=15\sum_{k=1}^{5}k = 1+2+3+4+5 = 15.

Proof by induction. To prove a predicate P(n)P(n) holds for every natural number:

Strings and languages.

Finite automaton (DFA). A finite automaton is a five-tuple M=(Q,Σ,δ,q0,F)M=(Q,\Sigma,\delta,q_0,F):

A string is accepted if, reading its symbols one at a time from the start state, the machine ends in an accept state. The language of MM, written L(M)L(M), is the set of all strings MM accepts — equivalently, "MM recognizes AA." The state diagram and the five-tuple are equivalent descriptions of the same machine.

Worked Example

Prove by induction that ∑i=0ni=n(n+1)2\displaystyle\sum_{i=0}^{n} i = \frac{n(n+1)}{2} for all n∈Nn\in\mathbb{N}.

Let A={ n∈N∣∑i=0ni=n(n+1)2 }A=\{\,n\in\mathbb{N}\mid \sum_{i=0}^{n} i=\tfrac{n(n+1)}{2}\,\}; the goal is to show A=NA=\mathbb{N}.

Base case (n=0n=0): the left side is the single term 00, and the right side is 0(0+1)2=0\tfrac{0(0+1)}{2}=0, so 0∈A0\in A.

Inductive step: assume k∈Ak\in A, i.e. ∑i=0ki=k(k+1)2\sum_{i=0}^{k} i=\tfrac{k(k+1)}{2}. Then split off the last term and substitute the hypothesis:

∑i=0k+1i=(∑i=0ki)+(k+1)=k(k+1)2+(k+1)=k(k+1)+2(k+1)2=(k+1)(k+2)2=(k+1)((k+1)+1)2\begin{aligned} \sum_{i=0}^{k+1} i &= \left(\sum_{i=0}^{k} i\right) + (k+1) \\ &= \frac{k(k+1)}{2} + (k+1) \\ &= \frac{k(k+1) + 2(k+1)}{2} \\ &= \frac{(k+1)(k+2)}{2} \\ &= \frac{(k+1)\big((k+1)+1\big)}{2} \end{aligned}

This is exactly the formula with n=k+1n=k+1, so k+1∈Ak+1\in A. By induction A=NA=\mathbb{N}, and the identity holds for every natural number. ■\blacksquare

A finite automaton: even number of 0s. Over Σ={0,1}\Sigma=\{0,1\}, build a DFA recognizing all binary strings with an even number of 0s. Use two states: q0q_0 (even count so far, the start and accept state) and q1q_1 (odd count). On input 00, toggle between the states; on input 11, stay put. Tracing 001101001101 ends back in q0q_0 — accepted; tracing 0110101101 ends in q1q_1 — rejected. Formally L(M)={ w∣w has an even number of 0s }L(M)=\{\,w\mid w \text{ has an even number of 0s}\,\}.

Summary