States · Transitions · Accepting states · Section 4.4 Theory of Computation
WHAT YOU'LL LEARN
FSM components · State transition diagrams · State transition tables · Acceptance
AQA SPEC LINK
4.4.1 — Finite state machines with and without output
FSM Definition
What is a Finite State Machine?
An FSM (Finite State Automaton) is a mathematical model of computation. It has a fixed number of states and transitions between them based on input symbols.
Q — finite set of states (q₀, q₁, q₂, …)
Σ (Sigma) — input alphabet (set of valid input symbols)
δ (delta) — transition function: δ(current state, input) = next state
q₀ — start/initial state
F — set of accepting (final) states
Diagrams
State Transition Diagram Notation
FSMs are drawn as directed graphs where nodes = states and labelled arrows = transitions.
Equivalent to diagram but in tabular form. Rows = current states, columns = input symbols, cells = next state.
FSM: Accepts strings ending in 'b'
Current State
Input: a
Input: b
→ q₀
q₀
q₁
q₁ ✓
q₀
q₁
→ means start state; ✓ means accepting state
Acceptance
Accepting an Input String
An FSM accepts an input string if, after reading all symbols from left to right starting at q₀, the machine ends in an accepting state. Otherwise it rejects.
Lexical analysis — compilers use FSMs to tokenise source code
Vending machines — state tracks amount inserted, transitions on coin/selection
Pattern matching — regex engines use FSMs to match patterns in strings
Network protocols — TCP uses FSM for connection state (LISTEN, SYN_SENT, ESTABLISHED…)
AQA Exam Style
Practice Question
AQA 7517 — Paper 1 Style
An FSM has states {q₀, q₁, q₂}, start state q₀, accepting state q₂. Alphabet {0,1}. Transitions: q₀→0→q₁, q₀→1→q₀, q₁→0→q₁, q₁→1→q₂, q₂→0→q₁, q₂→1→q₀. (a) Does the FSM accept the string "001"? Show trace. [2] (b) Does the FSM accept "0101"? Show trace. [2] (c) Describe in words what strings this FSM accepts. [1]