LESSON 05 · UNIT 4 AOS 2 & 3 COMPLEXITY, COMPUTABILITY & AI

Complexity Classes, Heuristics, Computability & Philosophy of AI

Where Unit 4 Area of Study 1 measures how fast an algorithm runs, Areas of Study 2 and 3 ask a deeper question: what can and cannot be computed at all? This lesson maps the boundary between tractable (P\text{P}) and intractable (NP\text{NP}, NP-Complete\text{NP-Complete}, NP-Hard\text{NP-Hard}) problems, heuristic approximation methods, the mathematical foundations of computability (Hilbert, Gödel, Church, and Turing), and the philosophical and mathematical architectures of Artificial Intelligence.

01 · COMPUTATIONAL COMPLEXITY ZOO

complexity classes: p, np, np-complete & np-hard.

Complexity Theory classifies computational problems according to their inherent difficulty—specifically, the asymptotic time required to solve an instance from scratch versus the time required to verify a candidate solution (certificate).

CLASS P (POLYNOMIAL TIME) TRACTABLE

P refers to Polynomial: the class of decision problems that are tractable, meaning they can be solved deterministically in worst-case polynomial time O(nc)\mathcal{O}(n^c) or better for some constant c≥0c \ge 0. Every P-class problem can also be verified in polynomial time (P⊆NP\text{P} \subseteq \text{NP}).

  • Growth rates in P: O(1)\mathcal{O}(1) (Constant), O(log⁡n)\mathcal{O}(\log n) (Logarithmic), O(n)\mathcal{O}(n) (Linear), O(nlog⁡n)\mathcal{O}(n \log n) (Log-linear), O(nc)\mathcal{O}(n^c) (Polynomial).
  • Canonical Examples: Determining whether a number is prime (AKS primality test), all comparison searches and sorts (Binary Search, Merge Sort), Shortest Paths (Dijkstra, Bellman-Ford, Floyd-Warshall), Minimum Spanning Trees (Prim, Kruskal), and Matrix Multiplication.
CLASS NP (NON-DETERMINISTIC POLYNOMIAL) VERIFIABLE IN P

NP stands for Non-Deterministic Polynomial (never "Non-Polynomial"): the class of decision problems for which a proposed candidate solution (certificate/proof) can be verified by a deterministic algorithm in polynomial time O(nc)\mathcal{O}(n^c), or equivalently solved in polynomial time by a Non-Deterministic Turing Machine.

  • Intractable NP problems have known deterministic worst-case solving times strictly greater than polynomial (>O(nc)> \mathcal{O}(n^c)): exponential O(cn)\mathcal{O}(c^n), factorial O(n!)\mathcal{O}(n!), or super-exponential O(nn)\mathcal{O}(n^n).
  • Canonical Examples: Travelling Salesman Decision Problem (TSP), Boolean Satisfiability Problem (SAT), 0-1 Knapsack Decision Problem, NN-Queens Problem, and Integer Factorisation (verifiable in O(n2)\mathcal{O}(n^2) by multiplying factors, believed to be in NP∖(P∪NP-Complete)\text{NP} \setminus (\text{P} \cup \text{NP-Complete})).
NP-COMPLETE (NPC) NP ∩ NP-HARD

NP-Complete problems lie at the exact intersection of NP and NP-Hard (NP-Complete=NP∩NP-Hard\text{NP-Complete} = \text{NP} \cap \text{NP-Hard}). A problem XX is NP-Complete iff:

  1. X∈NPX \in \text{NP} (candidate solutions are verifiable in polynomial time), and
  2. X∈NP-HardX \in \text{NP-Hard} (every problem in NP can be transformed/reduced to XX in polynomial time).

All NP-Complete problems are computationally equivalent up to a polynomial-time factor: if any single NP-Complete problem is solved in polynomial time, then every problem in NP is solvable in polynomial time (P=NP\text{P} = \text{NP}).

  • Canonical Examples: SAT (Boolean Satisfiability — the first proven NPC problem via the Cook-Levin Theorem), TSP Decision Problem, 0-1 Knapsack Decision (O(2n)\mathcal{O}(2^n)), Hamiltonian Cycle/Path Decision (O(n!)\mathcal{O}(n!)), NN-Queens Decision, and kk-Colouring Decision. (Note: Tower of Hanoi requires Θ(2n−1)\Theta(2^n - 1) exponential steps simply to output its move sequence).
NP-HARD (NPH) AT LEAST AS HARD AS NP

NP-Hard is the class of problems that are at least as hard as the hardest problems in NP (every problem in NP reduces to them in polynomial time), but they may or may not belong to NP—meaning they are not required to be decision problems and may not even be verifiable in polynomial time (or computable at all).

  • Canonical Examples:
    • Optimal TSP (Optimisation Version): Finding the minimum tour cost kk (verifying optimality requires knowing no shorter tour exists among all (n−1)!(n-1)! tours).
    • Chromatic Number χ(G)\chi(G) (Optimisation Graph Colouring): Finding the minimum number of colours needed for a proper vertex colouring.
    • The Halting Problem (HALTTM\text{HALT}_{\text{TM}}): Belongs to NP-Hard ONLY—it is undecidable and cannot be verified or solved in any finite time bound.
Euler diagram of P, NP, NP-Complete, NP-Hard, and Undecidable problems Assuming P is not equal to NP, P sits inside NP, NP-Complete is the intersection of NP and NP-Hard at the top of NP, and NP-Hard extends upward into Undecidable problems such as the Halting Problem. ALL COMPUTATIONAL PROBLEMS (ASSUMING P ≠ NP) DECIDABLE (COMPUTABLE) UNDECIDABLE (UNCOMPUTABLE) NP Verifiable in O(n^c) • Integer Factorisation NP-HARD • Optimal TSP • Chromatic Number χ(G) • 0-1 Knapsack (Opt) NP-HARD ONLY (∉ NP) • Halting Problem (HALT_TM) NP-COMPLETE SAT · TSP (Decision) N-Queens · k-Colour 0-1 Knapsack (Dec) P · Solvable in O(n^c) Sorting · Dijkstra · Prim · Primality
FIGURE 01 · EULER DIAGRAM OF COMPLEXITY & COMPUTABILITY CLASSES (UNDER P ≠ NP)
SUMMARY MATRIX · SOLVABILITY VS VERIFIABILITY ACROSS COMPLEXITY CLASSES
COMPLEXITY CLASS SOLVABLE IN O(nc)\mathcal{O}(n^c)? VERIFIABLE IN O(nc)\mathcal{O}(n^c)? CANONICAL VCE EXAMPLES
P (Polynomial) Yes (Tractable) Yes Merge Sort, Binary Search, Prim's/Kruskal's MST, Dijkstra, Matrix Multiplication, Primality testing
NP (Non-Deterministic Polynomial) Yes for P⊆NP\text{P} \subseteq \text{NP}; Unknown/No for NP∖P\text{NP} \setminus \text{P} Yes (Defining property of NP) All problems in P, Integer Factorisation, plus all NP-Complete problems
NP-Complete (NP∩NP-Hard\text{NP} \cap \text{NP-Hard}) No known polynomial algorithm (Intractable, O(2n),O(n!)\mathcal{O}(2^n), \mathcal{O}(n!)) Yes (since NPC⊆NP\text{NPC} \subseteq \text{NP}) Boolean SAT, TSP (Decision), 0-1 Knapsack (Decision), Hamiltonian Cycle, NN-Queens, kk-Colouring (Decision)
NP-Hard No (Intractable or Undecidable) May or may not be verifiable in polynomial time All NP-Complete problems, Optimal TSP (Optimisation), Chromatic Number χ(G)\chi(G), Halting Problem (Undecidable, ∉NP\notin \text{NP})
02 · COBHAM'S THESIS VS CHURCH-TURING THESIS

soft limits vs hard limits of computation.

Realistic, modern-day physical computers are constrained by the soft limits of computation (time and memory scaling). Theoretical models of computation with unbounded memory—such as the Turing Machine—are constrained only by the hard limits of computation (decidability).

SOFT LIMITS OF COMPUTATION COBHAM'S THESIS · TRACTABILITY

Cobham's Thesis identifies the class of problems that can be feasibly computed on physical hardware with the complexity class P\text{P}. Problems whose best deterministic algorithms require super-polynomial time (>O(nc)> \mathcal{O}(n^c), such as O(2n)\mathcal{O}(2^n) or O(n!)\mathcal{O}(n!)) are intractable.

While exact brute-force methods hit a soft limit as nn grows, we can bypass this barrier by sacrificing guaranteed optimality: using randomised heuristics (such as Simulated Annealing or Hill Climbing) or Machine Learning algorithms to find an approximate, "good-enough" solution in polynomial time.

HARD LIMITS OF COMPUTATION CHURCH-TURING THESIS · DECIDABILITY

The hard limits of computation refer to the absolute mathematical impossibility of solving uncomputable (undecidable) problems.

By the Church-Turing Thesis, no matter how fast a processor becomes or how much memory is added, certain problems (such as Alan Turing's Halting Problem, David Hilbert's Entscheidungsproblem, or the Busy Beaver function) admit no algorithmic solution whatsoever.

04 · CANONICAL COMBINATORIAL & OPTIMISATION PROBLEMS

tsp, n-queens, 0-1 knapsack & graph colouring.

1. The Travelling Salesman Problem (TSP)

In the Travelling Salesman Problem (TSP), a salesman must visit every city in a connected, weighted network exactly once and return to the starting city (forming a Hamiltonian circuit/cycle) with minimum total distance.

DECISION VERSION OF TSP NP-COMPLETE

"Given a complete weighted graph GG and a cost bound kk, does there exist a Hamiltonian circuit whose total cost is ≤k\le k?"

Why TSP (Decision) ∈NP\in \text{NP} (Polynomial Verification Proof): Suppose a candidate tour (proof/certificate) is given. A deterministic verifier checks:

  1. Every vertex is visited exactly once and returns to start: takes at most O(n2)\mathcal{O}(n^2) time.
  2. Look up and sum the edge weights along the tour: takes at most O(n2)\mathcal{O}(n^2) time.
  3. Compare the total tour length against ≤k\le k: takes O(1)\mathcal{O}(1) time.

Total verification time is 2n2=O(n2)2n^2 = \mathcal{O}(n^2) (polynomial). Because finding a Hamiltonian circuit is NP-Complete, TSP Decision is NP-Complete.

OPTIMISATION VERSION & BRUTE FORCE NP-HARD · O(n!)

"Given a complete weighted graph GG, find the minimum cost kk to complete a Hamiltonian circuit."

This problem is NP-Hard (at least as hard as every problem in NP, and reducible to repeated queries of the Decision Version).

Exhaustive / Brute-Force Analysis: Choosing a start vertex (nn choices), then a second vertex (n−1n-1 choices), and so on yields n×(n−1)×(n−2)⋯=n!n \times (n-1) \times (n-2) \dots = n! vertex orderings, or (n−1)!(n-1)! distinct directed cycles from a fixed start vertex. Thus brute-force TSP has worst-case time complexity O(n!)\mathcal{O}(n!). (Heuristics such as 2-opt or Christofides' algorithm approximate TSP in polynomial time).

2. The NN-Queens Problem

Given an n×nn \times n chessboard, the NN-Queens Problem asks whether nn queens can be placed on the board so that no two queens attack each other (no two share the same row, column, or diagonal). This decision problem belongs to NP-Complete (when generalised to completion of partial boards) and has no optimisation version.

COMBINATORIAL STATE-SPACE REDUCTION (8-QUEENS WORKED DERIVATION) PRUNING THE SEARCH TREE

For n=8n = 8 (an 8×88 \times 8 board with 64 squares), progressively encoding domain constraints shrinks the brute-force search space by five orders of magnitude before backtracking even begins:

  1. Unconstrained subsets of 8 squares from 64: (648)=64!8!×56!=4,426,165,368\binom{64}{8} = \frac{64!}{8! \times 56!} = 4,426,165,368 possible ways.
  2. Restricting to 1 queen per row (each of the 8 queens has 8 column choices in its assigned row): 88=16,777,2168^8 = 16,777,216 arrangements.
  3. Permutations of 8 queens (1 per row and 1 per column) (eliminating row and column collisions simultaneously): 8!=40,3208! = 40,320 permutations.
PYTHON IMPLEMENTATION · N-QUEENS BACKTRACKING SOLVER DEPTH-FIRST STATE-SPACE PRUNING
def n_queens(n):
    board = [[0 for i in range(n)] for j in range(n)]   # Create an n x n board with 0s
    backtrack(0, board, n)                              # Run backtracking from row 0
    for row in board:
        print(row)

def backtrack(row, board, n):
    if row == n:                                        # Base case: all n queens placed safely
        return True
    for col in range(n):
        if safe_move(row, col, board, n):               # Prune branch if position is under attack
            board[row][col] = 'Q'
            if backtrack(row + 1, board, n):
                return True
            board[row][col] = 0                         # Backtrack: undo queen placement
    return False

def safe_move(row, col, board, n):
    for i in range(n):                                  # Check current row
        if i != col and board[row][i] == 'Q':
            return False
    for j in range(n):                                  # Check current column
        if j != row and board[j][col] == 'Q':
            return False
    for i, j in zip(range(row, -1, -1), range(col, -1, -1)):   # Upper-left diagonal
        if board[i][j] == 'Q':
            return False
    for i, j in zip(range(row, n, 1), range(col, -1, -1)):     # Lower-left diagonal
        if board[i][j] == 'Q':
            return False
    return True

3. The 0-1 Knapsack Problem

Given a set SS of nn items—each with weight wiw_i and value viv_i—and a knapsack of maximum weight capacity WW, the 0-1 Knapsack Problem requires choosing a subset of items where each item is either included (11) or excluded (00) without splitting items.

  • Decision Version (NP-Complete): Given items SS, target value VV, and capacity WW, can a total value of at least VV be achieved without exceeding weight WW?
  • Optimisation Version (NP-Hard): Given items SS with weights and values, what is the maximum value VV obtainable within weight capacity WW?
  • Brute-Force Power Set Analysis (O(2n)\mathcal{O}(2^n)): Because each of the nn items has 2 binary states (in or out of the knapsack), exhaustive search tests the entire Power Set P(S)\mathcal{P}(S) of size 2×2×⋯×2=2n2 \times 2 \times \dots \times 2 = 2^n, resulting in an intractable O(2n)\mathcal{O}(2^n) worst-case time complexity.

4. The Graph Colouring Problem (Proper Vertex Colouring)

Let G=(V,E)G = (V, E) be a simple undirected graph and C={1,2,3,…,k}C = \{1, 2, 3, \dots, k\} be a set of kk colours. A proper vertex colouring assigns a colour v.colour∈Cv.\text{colour} \in C to every vertex v∈Vv \in V such that no two adjacent vertices share the same colour:

∀u∈adj(v),v.colour≠u.colour\forall u \in \text{adj}(v), \quad v.\text{colour} \neq u.\text{colour}
DECISION VS OPTIMISATION VERSIONS CHROMATIC NUMBER χ(G)
  • Decision Version (kk-Colouring, NP-Complete for k≥3k \ge 3): Given a graph GG and integer kk, does GG admit a proper vertex colouring using at most kk colours?
  • Optimisation Version (NP-Hard / NP-Complete): Find the chromatic number χ(G)\chi(G)—the minimum number of colours required to properly colour all vertices of GG.

Real-World Applications: Conflict-resolution and allocation problems—such as exam timetabling (subjects with shared students cannot be scheduled in the same slot), seating allocation (incompatible guests cannot sit adjacent), compiler register allocation, and planar map colouring.

MATHEMATICAL BOUNDS ON χ(G) BROOKS & FOUR-COLOUR
  • Trivial Upper Bound: χ(G)≤∣V∣\chi(G) \le |V|. Equality χ(Kn)=∣V∣=n\chi(K_n) = |V| = n holds iff GG is a complete graph KnK_n.
  • Four Colour Theorem (Planar Graphs): For any planar graph GG, χ(G)≤4\chi(G) \le 4.
  • Brooks' Theorem (General Upper Bound): For every connected graph GG that is neither a complete graph (KnK_n) nor an odd cycle (C2m+1C_{2m+1}), χ(G)≤deg⁡max⁡(v)\chi(G) \le \deg_{\max}(v) (otherwise χ(G)≤deg⁡max⁡(v)+1\chi(G) \le \deg_{\max}(v) + 1).
  • Combined Lower & Upper Inequality: Bounded below by the clique/independence ratio (ω(G)≤χ(G)\omega(G) \le \chi(G) and ∣V∣Kn≤χ(G)\frac{|V|}{K_n} \le \chi(G), where α(G)\alpha(G) / KnK_n denotes the max independent/clique bound in curriculum notation):
∣V∣Kn≤χ(G)≤deg⁡max⁡(v)\frac{|V|}{K_n} \le \chi(G) \le \deg_{\max}(v)
PSEUDOCODE · GREEDY GRAPH COLOURING HEURISTIC ALWAYS VALID · NOT GUARANTEED OPTIMAL
ALGORITHM GreedyGraphColouring(G = (V, E)):
    // Always produces a valid proper colouring, but optimality depends on vertex ordering
    Initialise C = {c_1}, the set of used colours, with count i = 1
    For each uncoloured vertex v in V do:
        assigned <- False
        For each colour c in C do:
            If colouring v with c creates no conflicts with adj(v) then:
                v.colour <- c
                assigned <- True
                Break
            End If
        End For
        If assigned == False then:
            i <- i + 1
            Add new colour c_i to C
            v.colour <- c_i
        End If
    End For
    return G, C
End Algorithm
05 · FOUNDATIONS OF MATHEMATICAL LOGIC & UNDECIDABILITY

hilbert's program, gödel's incompleteness & the halting problem.

1. Hilbert's Program (1920s Formalism)

In the early 1920s, German mathematician David Hilbert proposed a grand foundational programme—known as Hilbert's Program (or formalism)—to ground all of mathematics in a finite set of axioms written in a precise formal language and manipulated according to well-defined mechanical rules. Hilbert demanded four properties:

1. COMPLETENESS & 2. CONSISTENCY HILBERT'S AXIOMATIC GOALS
  • Completeness: A proof that all true mathematical statements can be formally proved within the axiomatic system.
  • Consistency: A proof—using only finitistic reasoning about finite mathematical objects—that no contradiction (paradox) can ever be derived in the formalism of mathematics.
3. CONSERVATION & 4. DECIDABILITY ENTSCHEIDUNGSPROBLEM
  • Conservation: A proof that any result about "real objects" obtained using reasoning about "ideal objects" (such as uncountable sets) can also be proved without using ideal objects.
  • Decidability (The Entscheidungsproblem): There should exist a single finite mechanical algorithm capable of deciding the truth or falsity of any mathematical statement given the axioms.

2. Kurt Gödel's Incompleteness Theorems (1931)

In 1931, logician Kurt Gödel proved that Hilbert's Program can never be achieved for any formal system rich enough to express elementary arithmetic:

  • First Incompleteness Theorem (Every rich consistent system is incomplete): "Any consistent formal system FF within which a certain amount of elementary arithmetic can be carried out is incomplete; i.e., there are statements of the language of FF which can neither be proved nor disproved in FF."
    Mechanism (Gödel Numbering & Self-Reference): Gödel encoded every mathematical symbol, formula, and proof in system FF as a unique natural number (Gödel numbering). Mirroring the linguistic Liar Paradox ("This statement is false"), he constructed a formal arithmetic statement—the Gödel sentence GFG_F—asserting: "Statement GFG_F is not provable in system FF." If FF proves GFG_F, then FF proves a false statement (making FF inconsistent). Therefore, if FF is consistent, GFG_F is true but unprovable in FF.
  • Second Incompleteness Theorem (No consistent system can prove its own consistency): "For any consistent system FF within which a certain amount of elementary arithmetic can be carried out, the consistency of FF cannot be proved in FF itself."

3. The Halting Problem & The Entscheidungsproblem (Alan Turing, 1936)

While Gödel demolished Completeness and Consistency, Alan Turing and Alonzo Church independently demolished Hilbert's fourth pillar—Decidability (the Entscheidungsproblem)—in 1936.

  • Hilbert's Original Question: Given an arbitrary formal proof system ψ\psi and statement SS, is it possible to algorithmically determine whether SS is provable in ψ\psi?
  • Turing's Equivalent Restatement (The Halting Problem): Given the description of an arbitrary Turing Machine TT and an input string ww, can an algorithm determine in advance whether TT eventually halts on ww or runs forever in an infinite loop?
HALTTM={⟨T,w⟩∣T halts on input w}is UNDECIDABLE.\text{HALT}_{\text{TM}} = \{ \langle T, w \rangle \mid T \text{ halts on input } w \} \quad \text{is UNDECIDABLE.}
PROOF 1 · DIAGONALISATION / CONTRADICTION SELF-REFERENTIAL PARADOX
  1. Assume for contradiction that a universal halt-decider H(P,w)H(P, w) exists that always halts and outputs TRUE if program PP halts on ww, and FALSE if PP loops forever on ww.
  2. Construct a new adversarial machine D(P)D(P) that calls H(P,P)H(P, P) on PP's own source code:
    • If H(P,P)=TRUEH(P, P) = \text{TRUE}, DD deliberately enters an infinite while True loop.
    • If H(P,P)=FALSEH(P, P) = \text{FALSE}, DD immediately halts.
  3. Feed DD into itself by running D(D)D(D):
    • If D(D)D(D) halts, then H(D,D)H(D, D) returns TRUE, causing D(D)D(D) to loop forever.
    • If D(D)D(D) loops forever, then H(D,D)H(D, D) returns FALSE, causing D(D)D(D) to halt immediately.
  4. Both cases yield a logical contradiction (D(D) halts  ⟺  D(D) loopsD(D) \text{ halts} \iff D(D) \text{ loops}). Therefore, HH cannot exist, and HALTTM\text{HALT}_{\text{TM}} is undecidable.
PROOF 2 · REDUCTION FROM TM ACCEPTANCE RECOGNISABILITY VS DECIDABILITY

From formal language theory, the Halting Problem's undecidability also follows by reduction from the TM Acceptance Problem ATM={⟨T,w⟩∣T accepts w}A_{\text{TM}} = \{ \langle T, w \rangle \mid T \text{ accepts } w \}:

  1. The TM Acceptance problem reduces to HALTTM\text{HALT}_{\text{TM}}.
  2. The TM Acceptance problem is undecidable.
  3. Hence, HALTTM\text{HALT}_{\text{TM}} is also undecidable.

If HALTTM\text{HALT}_{\text{TM}} were decidable, then every Turing-recognisable language would be decidable (L is recognisable  ⟹  L is decidableL \text{ is recognisable} \implies L \text{ is decidable}), which is false.

Practical Implication (Static Code Analysis & Rice's Theorem): Because of the Halting Problem, no compiler or automated verification tool can ever determine for every arbitrary program whether it will get trapped in an infinite loop or satisfy any non-trivial semantic property (Rice's Theorem).

06 · MODELS OF COMPUTATION & FORMAL LANGUAGES

church-turing thesis, turing machines & computability.

1. Effectively Calculable & The Church-Turing Thesis (1936)

To prove that no algorithm could solve Hilbert's Entscheidungsproblem, Alan Turing (via Turing Machines) and Alonzo Church (via Lambda Calculus) independently formalised what it means for a method to be an algorithm.

DEFINITION · EFFECTIVELY CALCULABLE FOUR FORMAL CRITERIA

A function or method is effectively calculable iff it satisfies four conditions:

  1. It consists of exact, unambiguous instructions that are finite in length (requiring zero guessing or human intuition).
  2. Given unbounded time and resources, it completes in a finite number of steps.
  3. Its instructions and data are encoded over a finite alphabet (e.g., binary {0,1}\{0, 1\}).
  4. It can be executed mechanically by a human working with unlimited time and an unlimited supply of pen and paper.
THE CHURCH-TURING THESIS EQUIVALENCE OF FORMALISMS
f is effectively calculable  ⟹  f is computable (by a Turing Machine)f \text{ is effectively calculable} \implies f \text{ is computable (by a Turing Machine)}

Any effectively calculable method of computation—whether expressed in Alonzo Church's Lambda Calculus (where functions are defined and applied to arguments), a modern programming language (Python, C++), or cellular automata—is computationally equivalent to a Turing Machine.

2. The Turing Machine (TM) Architecture & Formal 8-Tuple

A Turing Machine (TM) consists of four physical/logical components: (1) an infinite tape divided into discrete cells, each holding a symbol from a finite alphabet; (2) a moveable read/write head that reads the current cell, writes a symbol, and steps Left (L\text{L}) or Right (R\text{R}); (3) a state register storing the current state from a finite set; and (4) a finite table of transition instructions.

FORMAL DEFINITION · TURING MACHINE 8-TUPLE STATE TRANSITION CALCULUS
M=(Σ,Γ,b,Q,δ,q0,qa,qr)M = (\Sigma, \Gamma, b, Q, \delta, q_0, q_a, q_r)
  • Σ\Sigma: The finite input symbol alphabet.
  • Γ\Gamma: The finite tape alphabet, containing all input symbols plus any extra working symbols written to the tape (Σ⊆Γ\Sigma \subseteq \Gamma).
  • b∈Γb \in \Gamma: The blank symbol (often written ⊔\sqcup), which fills the infinite tape beyond the input string (b∉Σb \notin \Sigma).
  • QQ: The finite set of all machine states.
  • q0∈Qq_0 \in Q: The initial (start) state.
  • qa∈Qq_a \in Q: The halting accept state (sometimes written as an accepting set FF).
  • qr∈Qq_r \in Q: The halting reject state (qr≠qaq_r \neq q_a).
  • δ\delta: The state transition function mapping a non-halting state and current tape symbol to a next state, overwritten symbol, and head direction:
δ:(Q∖{qa,qr})×Γ→Q×Γ×{L,R},δ(qcur,wcur)=(qnext,woverwrite,L or R)\delta: (Q \setminus \{q_a, q_r\}) \times \Gamma \to Q \times \Gamma \times \{\text{L}, \text{R}\}, \qquad \delta(q_{\text{cur}}, w_{\text{cur}}) = (q_{\text{next}}, w_{\text{overwrite}}, \text{L or R})

Three Possible Outcomes on Input ww: A Turing Machine can (1) Halt and Accept (reach qaq_a), (2) Halt and Reject (reach qrq_r), or (3) Run Forever in an infinite loop. A Turing Machine that halts on all inputs (never loops forever) is called a Decider.

3. TM Configurations, Notation & Worked State Diagram

A TM Configuration is an instantaneous snapshot capturing: (1) the current state qq, (2) the full contents of the tape, and (3) the exact position of the tape head.

  • Configuration String Notation: The state symbol qq is inserted inline into the tape string at the head position (e.g., abqabb; note the HESS notes remark that the current head is adjacent to where qq is placed, with starting configuration q0wq_0 w).
  • Yield Relation (C  ⟹  C′C \implies C'): Applying δ\delta transforms configuration CC into C′C':
    • Right move: uqbv  ⟹  uctvu q b v \implies u c t v (written in HESS notes as uqbv  ⟹  ucqv  ⟺  δ(q,b)=(t,c,R)u q b v \implies u c q v \iff \delta(q, b) = (t, c, \text{R}))
    • Left move: uaqbv  ⟹  utacvu a q b v \implies u t a c v (written in HESS notes as uqbv  ⟹  tucv  ⟺  δ(q,b)=(t,c,L)u q b v \implies t u c v \iff \delta(q, b) = (t, c, \text{L}))
    • Left boundary rule: qbuv  ⟹  tcuv  ⟺  δ(q,b)=(t,c,L)q b u v \implies t c u v \iff \delta(q, b) = (t, c, \text{L}) (the head cannot move left past the first tape cell).
  • String Acceptance: M accepts w  ⟺  C1  ⟹  C2  ⟹  ⋯  ⟹  CkM \text{ accepts } w \iff C_1 \implies C_2 \implies \dots \implies C_k, where C1=q0wC_1 = q_0 w and CkC_k is in accept state qaq_a (or FF).
  • State Diagram Shorthand: For M=(Σ,Γ,Q,δ,q0,F,⊔)M = (\Sigma, \Gamma, Q, \delta, q_0, F, \sqcup) with Σ=Γ={0,1}\Sigma = \Gamma = \{0, 1\}, Q={A,B,C}Q = \{A, B, C\}, q0=Aq_0 = A, F={C}F = \{C\}, an edge labelled a→b,Ra \to b, \text{R} represents δ(q0,a)=(q1,b,R)\delta(q_0, a) = (q_1, b, \text{R}). If the TM does not overwrite the tape symbol, we shorten it to a→Ra \to \text{R}.
Turing Machine Architecture and State Diagram recognising strings with substring 11 Top: Infinite tape with cells containing blank, 0, 1, 1, 0, blank, read/write head pointing to active cell, and state register. Bottom: State transition diagram with states A (start), B (saw one 1), and C (accept, saw 11). A · INFINITE TAPE, MOVEABLE HEAD & STATE REGISTER ⋯ ␣ 0 1 1 0 ␣ ⋯ HEAD · STATE q = B (◀ L | R ▶) B · STATE DIAGRAM FOR L = { w ∈ {0,1}* | w CONTAINS SUBSTRING "11" } q_0 A 0 → R B 1 → R 0 → R C (q_a) 1 → R (Accept)
FIGURE 02 · TURING MACHINE TAPE ARCHITECTURE & STATE DIAGRAM RECOGNISING L = { w | w HAS SUBSTRING 11 }

4. Why Turing Machines Are More Powerful Than FSAs & PDAs

While Finite State Automata (FSAs) recognise regular languages and Pushdown Automata (PDAs) recognise context-free languages such as {0n1n}\{0^n 1^n\}, neither can recognise the context-sensitive language:

L={0n1n2n∣n∈N0}L = \{ 0^n 1^n 2^n \mid n \in \mathbb{N}_0 \}

Because a Turing Machine can move its head both Left and Right and overwrite tape cells with markers, it easily decides L={0n1n2n}L = \{0^n 1^n 2^n\} (or equivalently anbncna^n b^n c^n). Furthermore, by Theorem T1 (Determinism Equivalence), every Non-Deterministic Turing Machine (NTM) has an equivalent Deterministic Turing Machine (DTM)—non-determinism adds zero extra computability power to a Turing Machine.

HIGH-LEVEL TM PSEUDOCODE · DECIDING L = { 0^n 1^n 2^n } CROSS-OFF TAPE ALGORITHM
TM M (on input tape):
    // 1. Preprocessing input
    Move head Right until non-blank character
    Check if tape is of the regular form 0*1*2* (if not, Reject)

    // 2. Iterative cross-off pass
    While unmarked symbols remain:
        Return head to start of tape
        Move head Right
        Replace one instance each of '0' ('a'), '1' ('b'), and '2' ('c') with 'x'
        If any of the three symbols is missing while others remain, Reject

    // 3. Verification
    If crossed out the last instance of '0', '1', and '2' together, Accept

5. Computability: Functions, Sets, Numbers & Uncountable Sets

COMPUTABLE FUNCTIONS & SETS COMPUTABILITY ⟺ DECIDABILITY
  • Computable Function: A function f:X→Yf: X \to Y over X={x1,…,xn}X = \{x_1, \dots, x_n\} is computable iff there exists a TM MM that, when given encoding ⟨xi⟩\langle x_i \rangle as input, halts with ⟨f(xi)⟩\langle f(x_i) \rangle on its tape.
  • Computable Set: A set XX is computable iff its associated language L={⟨x1⟩,⟨x2⟩,… }L = \{\langle x_1 \rangle, \langle x_2 \rangle, \dots\} is Turing-decidable:
Computability  ⟺  Decidability,Undecidable  ⟺  Uncomputable\text{Computability} \iff \text{Decidability}, \qquad \text{Undecidable} \iff \text{Uncomputable}
COMPUTABLE NUMBERS & UNCOUNTABLE SETS CANTOR CARDINALITY LIMIT
  • Computable Number (Marvin Minsky): "A computable number is one for which there is a Turing machine which, given nn on its initial tape, terminates with the nn-th digit of that number encoded on its tape" (or computes a rational Cauchy approximation within 2−n2^{-n}).
  • The 3.143.14 vs π\pi Finite-State Dilemma: A terminating decimal like 3.143.14 can be printed by a trivial Turing Machine using a hard-coded chain of states that writes 3, moves Right, writes ., moves Right, writes 1, moves Right, writes 4, and halts. However, when we try to compute an irrational real number like π\pi—which has infinitely many non-repeating digits—we cannot assign one state per digit because a Turing Machine is restricted to a finite set of states QQ. Instead, π\pi is computable because a finite-state algorithm (using loops over a convergent series) can take any index nn on its initial tape and halt after outputting the first nn digits (or the nn-th digit) in finite time.
  • Uncountable Sets Are Not Computable: Because every Turing Machine is described by a finite string over a finite alphabet, the set of all Turing Machines is countably infinite (ℵ0\aleph_0). By Cantor's diagonalisation argument, the set of real numbers R\mathbb{R} and the set of all finitary functions f:N→Nf: \mathbb{N} \to \mathbb{N} are uncountable (2ℵ02^{\aleph_0}). Therefore, most real numbers and functions are uncomputable—canonical examples include the Busy Beaver function and Kolmogorov complexity.
07 · HISTORY & PHILOSOPHY OF ARTIFICIAL INTELLIGENCE

timeline of ai, the turing test & the chinese room argument.

Artificial Intelligence (AI) is intelligence demonstrated by machines running algorithms that perceive their environment, adapt, reason, and take actions to maximise the chance of achieving goals. Machine Learning (ML) is a subset of AI where machines are not explicitly programmed rule-by-rule, but instead learn patterns from large volumes of data.

HISTORICAL TIMELINE OF ARTIFICIAL INTELLIGENCE · 1950s TO PRESENT DAY
ERA / YEAR LANDMARK DEVELOPMENTS & PARADIGMS COMPUTATIONAL & HISTORICAL SIGNIFICANCE
1950s (1950 & 1956) Alan Turing's "Computing Machinery and Intelligence" (1950); The Logic Theorist (1956) Turing proposes the Turing Test; computers are room-sized mainframes with tiny memory limited to defence, big tech, and universities. The Logic Theorist becomes the first proof-of-concept AI program mimicking human theorem-proving.
1950s – 1970s General Problem Solver (GPS), ELIZA chatbot, and The AI Winter (1974–1980) Hardware becomes smaller, faster, and cheaper; GPS and ELIZA show early promise in problem-solving and natural language processing. However, combinatorial explosion and limited progress cause government funding to dry up from 1974 to 1980 (The AI Winter).
1980s Searle's Chinese Room Argument (1980), Expert Systems & Deep Learning revival John Searle publishes his rebuttal to Strong AI (1980). Funding returns via commercial Expert Systems—programs encoding domain-expert rules to advise non-experts—alongside rediscovery of multi-layer neural network training.
1990s – Present Windows Speech Recognition, IBM Deep Blue (1997) & Google AlphaGo (2017) Storage limits vanish; speech recognition ships in Microsoft Windows. In 1997, IBM's Deep Blue (symbolic AI / heuristic search) defeats chess world champion Garry Kasparov. In 2017, Google's AlphaGo defeats Go champion Ke Jie.

Strong AI vs Weak AI & The Turing Test (1950)

STRONG AI VS WEAK (NARROW) AI ONTOLOGICAL STATUS
  • Strong AI Hypothesis: A suitably programmed machine can develop genuine human cognitive abilities, semantic understanding, intelligence, and (arguably) consciousness—meaning its "mind" is in essence no different from a biological human mind, capable of teaching itself to solve novel problems across domains.
  • Weak AI (Narrow AI): Uses advanced algorithms to accomplish specific problem-solving or reasoning tasks (e.g., playing chess or classifying images) without achieving self-awareness, consciousness, or the full range of human cognition.
THE TURING TEST (IMITATION GAME, 1950) BEHAVIOURAL CRITERION

A human interrogator communicates via text-only messages with two hidden subjects—one human and one computer—who both try to convince the interrogator they are human. According to Alan Turing, if the interrogator cannot reliably differentiate the machine from the human, the computer is capable of thinking.

The test asks: (1) Can a suitably programmed computer imitate human language and behaviour? (2) Is there a theoretical limit on what a computer can input or output in language? (A theoretical Turing Machine with infinite time and memory has no upper bound on state space).

John Searle's Chinese Room Argument (1980)

Philosopher John Searle formulated the Chinese Room Argument as a direct refutation of the Strong AI Hypothesis and the Turing Test, arguing that passing a behavioural test via formal symbol manipulation (syntax) never suffices for genuine mental understanding or meaning (semantics).

The Thought Experiment: Searle (who knows zero written or spoken Chinese) is locked in a room with a large batch of Chinese writing and an English rulebook that correlates one set of formal Chinese symbols with another purely by their shapes. When native Chinese speakers slide questions in Chinese under the door, Searle follows the English rules to output indistinguishable Chinese responses. To observers outside, the room passes the Turing Test for Chinese—yet Searle neither understands a single word of Chinese nor is "thinking" in Chinese. Likewise, a computer running a program only manipulates uninterpreted syntax without semantic understanding.

SEARLE'S 4 FORMAL AXIOMS (A1–A4) PREMISES
  • (A1) Programs are formal (syntactic).
  • (A2) Minds have mental contents (semantics).
  • (A3) Syntax by itself is neither constitutive of nor sufficient for semantics.
  • (A4) Brains cause minds.
SEARLE'S 4 FORMAL CONCLUSIONS (C1–C4) DEDUCTIONS
  • (C1) Programs are neither constitutive of nor sufficient for minds.
  • (C2) Any other system capable of causing minds would have to have causal powers (at least) equivalent to those of brains.
  • (C3) Any artifact that produced mental phenomena, any artificial brain, would have to be able to duplicate the specific causal powers of brains, and it could not do that just by running a formal program.
  • (C4) The way that human brains actually produce mental phenomena cannot be solely by virtue of running a computer program.
FOUR CLASSIC OBJECTIONS TO THE CHINESE ROOM & SEARLE'S REBUTTALS
OBJECTING ARGUMENT CORE CLAIM OF THE OBJECTION JOHN SEARLE'S COUNTER-REPLY
1. The Systems Argument (Systems Reply) While the person inside the room does not understand Chinese in isolation, the entire room as a holistic system (person + rulebook + ledger + paper) understands Chinese—just as no single neuron understands English, but the whole human does. Let the man memorise the entire rulebook and perform all calculations in his head outdoors. Now "the man" and "the system" are the exact same object—yet the man still understands zero Chinese, so the system doesn't either.
2. The Robot Argument (Robot Reply) Words derive semantic meaning from causal interaction with the real world (e.g., seeing fire for 火). If the Chinese Room were placed inside a robot body with camera eyes and motor limbs, its symbols would acquire grounded meaning. Camera and sensor inputs simply arrive inside the room as yet more uninterpreted formal symbols, and outputs go to motors. The person in the room "doesn't see what comes into the robot's eyes" and still only follows formal syntax rules without knowing what the symbols mean.
3. The Brain Simulator Argument A computer that simulates not merely high-level rules, but the exact neurobiological structure of a native Chinese speaker's brain down to every synapse firing must genuinely understand Chinese. A formal simulation of neuron firings does not reproduce the actual physical and chemical causal properties of biological human brains (simulating the formal structure of a brain no more produces consciousness than simulating a stomach digests food).
4. The Other Minds Argument We never directly experience another human's consciousness; we infer that other people think purely from their external behaviour. By parity of reasoning, we must grant intelligence to a machine exhibiting equivalent behaviour. We attribute consciousness to other humans not solely from behaviour, but because we know they share our biological construction formed during gestation—which a synthetic machine does not replicate.
08 · MACHINE LEARNING ARCHITECTURES & ETHICAL GOVERNANCE

support vector machines, neural networks & ethics of ai.

1. Support Vector Machines (SVMs)

A Support Vector Machine (SVM) is a supervised binary classification algorithm. Given two classes of labelled training data plotted in an NN-dimensional feature space, the SVM computes an (N−1)(N - 1)-dimensional decision boundary (hyperplane)—a line in 2D, a plane in 3D—that separates the two classes with the maximum margin.

  • Maximum-Margin / Optimal Hyperplane: The hyperplane that maximises the perpendicular distance from the boundary to the nearest data point on each side.
  • Support Vectors: The critical data points from each class that lie closest to the decision boundary (on the margin gutters). Because the decision function depends only on these support vectors, SVMs are highly memory-efficient.
  • Kernel Transformations (ϕ\phi): When data is not linearly separable in its original input space, a kernel transformation function ϕ(x)\phi(x) lifts the data into a higher-dimensional space where a linear hyperplane can separate the classes—common examples include polynomial kernels (ϕ(x)=xc\phi(x) = x^c, such as ϕ(x)=x2\phi(x) = x^2) and modular kernels (x mod 3x \bmod 3).
  • Canonical Applications:
    1. Image recognition, such as detecting cancerous cells based on millions of medical images.
    2. Predicting future driving routes with a well-fitted regression model.
Support Vector Machine Maximum-Margin Hyperplane and Kernel Transformation Left panel shows 2D linearly separable classes separated by an optimal hyperplane with dashed margin boundaries passing through highlighted support vectors. Right panel shows 1D non-linearly separable points lifted onto a parabola phi(x) = x^2 where a linear hyperplane separates them. A · MAXIMUM-MARGIN HYPERPLANE & SUPPORT VECTORS x_1 x_2 Support Vectors (circled) Hyperplane (N−1 dim) B · KERNEL LIFTING φ(x) = x² x φ(x) = x² Linear boundary in φ-space
FIGURE 03 · SVM MAXIMUM-MARGIN HYPERPLANE WITH SUPPORT VECTORS (LEFT) & POLYNOMIAL KERNEL TRANSFORMATION φ(x) = x² (RIGHT)

2. Neural Networks & Deep Learning

Deep Learning is a subfield of Machine Learning built on Artificial Neural Networks (ANNs): layered graphs of interconnected artificial neurons comprising an input layer, one or more hidden layers (where "deep" refers to the depth of hidden layers), and an output layer.

  • Feedforward vs Backpropagation: In a feedforward neural network, signals flow strictly forward from input to output with no loops. Networks with feedback links that propagate error signals backward from output to hidden/input layers use backpropagation.
  • Perceptron (Step-Function Binary Classifier): Accepts weighted inputs x1,x2,…,xnx_1, x_2, \dots, x_n with weights w1,w2,…,wnw_1, w_2, \dots, w_n and outputs a hard binary decision (00 or 11). For linearly separable data, its decision boundary is the hyperplane:
    w1x1+w2x2+⋯+wnxn−bias=0w_1 x_1 + w_2 x_2 + \dots + w_n x_n - \text{bias} = 0
  • Sigmoid Neuron (Smooth Real-Valued Output): Instead of a discontinuous step function, a sigmoid neuron outputs a smooth real number strictly between 00 and 11 using the logistic sigmoid function, allowing small weight adjustments to produce smooth changes in output:
    S(x)=11+e−xS(x) = \frac{1}{1 + e^{-x}}
TRAINING NEURAL NETWORKS · FOLDS, EPOCHS & GRADIENT DESCENT CHAIN RULE DERIVATIVE

A dataset is partitioned into subsets called folds (some folds used for training, others held out for testing). Across many full passes over the training set (epochs), the network compares its predicted output AA against the true label using a loss function LL (commonly Mean Squared Error / variance) and updates weights at a learning rate η\eta (Greek letter eta).

Gradient Descent & Stochastic Gradient Descent (SGD) iteratively minimise the multivariable loss function LL by computing the partial derivative of the loss with respect to each weight ww via the calculus Chain Rule:

dLdw=dLdA×dAdw\frac{dL}{dw} = \frac{dL}{dA} \times \frac{dA}{dw}

where LL is the Loss Function, ww is the weight of a given input, and AA is the neuron's Activation value (output).

COMPARATIVE ANALYSIS · SUPPORT VECTOR MACHINES (SVMs) VS NEURAL NETWORKS
MODEL ADVANTAGES (PROS) DISADVANTAGES (CONS)
Support Vector Machines (SVMs)
  • Highly effective on multi-feature data (financial, medical, cancer cell imagery).
  • Significantly faster to train than Neural Networks.
  • Effective even when the number of features exceeds the number of data points.
  • Memory-efficient: decision boundary uses only a subset of training points (support vectors).
  • Prone to overfitting if the number of features is vastly larger than the number of data points.
  • Does not directly output probability estimates of classification confidence.
  • Requires complete supervised labelling of input training data.
  • Directly applicable only to binary classification.
Neural Networks (Deep Learning)
  • Makes use of all training data (no data points are discarded), yielding higher accuracy on massive, well-labelled datasets.
  • Accuracy continues to scale upward as more training data is fed.
  • Effective when no explicit rule-based algorithm is known for solving a complex perceptual task.
  • Requires significantly more training data than SVMs.
  • Opaque ("black box"): extremely difficult to inspect or trace the internal "train of thought".
  • Computationally much slower to train than SVMs.

3. Ethics of Artificial Intelligence

As AI systems govern high-stakes decisions in finance, healthcare, justice, and media, VCE Algorithmics evaluates AI ethics across three core criteria—Transparency, Responsibility, and Incorruptibility—alongside societal impacts on information integrity and labour:

1. TRANSPARENCY & 2. RESPONSIBILITY TRACEABILITY & ACCOUNTABILITY
  • Transparency (What is going on behind the process?): An AI must maintain a traceable chain of processes so harms can be audited back to their root cause. For example, if a rejected home-loan applicant sues a bank for racial bias, an opaque multi-layer deep neural network makes it nearly impossible to audit how or why the model weighed race, gender, or postcode.
  • Responsibility (Who takes the blame?): When autonomous AI systems cause catastrophic harm, legal and ethical frameworks must establish clear accountability through regulations co-designed by engineers, lawmakers, and civil society.
3. INCORRUPTIBILITY, BIAS & SOCIETAL IMPACT THREE SOURCES OF BIAS
  • Incorruptibility & Personal Data: Datasets containing Personally Identifiable Information (PII) must be protected against misuse at the design stage, and productivity profits generated from public personal data must be equitably shared.
  • Three Sources of Algorithmic Bias:
    1. Existing bias: Pre-existing social, institutional, or historical prejudices embedded in the training data.
    2. Technical bias: Distortions introduced by hardware constraints, sampling flaws, or mathematical algorithm design.
    3. Emergent bias: Bias arising after deployment as real-world populations, cultural contexts, or user behaviours shift.
  • Fake News & The Automated Workplace: AI-driven social feeds enable bad actors to micro-target populations with political propaganda, requiring defensive AI detection. Meanwhile, workplace automation displaces routine labour while augmenting other roles, requiring governments, employers, and AI firms to coordinate worker retraining and fair compensation.
09 · ACTIVE VERIFICATION & EXAM MASTERY

worked self-checks & synthesis checklist.

SELF-CHECK 01 · Why is the Decision Version of TSP in NP-Complete, whereas Optimal TSP and the Halting Problem are in NP-Hard?

To belong to NP (and therefore NP-Complete), a problem must be a decision problem whose candidate solution (certificate) can be verified deterministically in polynomial time O(nc)\mathcal{O}(n^c). Given a proposed TSP tour and bound kk, we can check that every vertex is visited once and sum the edge weights in O(n2)\mathcal{O}(n^2) time to verify whether total cost ≤k\le k.

By contrast, Optimal TSP asks for the minimum possible tour cost; verifying that no strictly shorter tour exists cannot be done in polynomial time from a single tour certificate alone, placing it in NP-Hard. Finally, the Halting Problem is undecidable—it cannot be solved or verified in any finite time bound—so it lies in NP-Hard only (NP-Hard∖NP\text{NP-Hard} \setminus \text{NP}).

SELF-CHECK 02 · How does Simulated Annealing overcome the primary limitation of Hill Climbing?

Hill Climbing is purely greedy: it only moves to a neighbour if Evaluation(x)>Evaluation(currentNode)\text{Evaluation}(x) > \text{Evaluation}(\text{currentNode}), causing it to terminate prematurely whenever it hits a local optimum.

Simulated Annealing introduces a temperature parameter TT and accepts worse neighbours (Δ=c(new)−c(old)>0\Delta = c(\text{new}) - c(\text{old}) > 0) with Boltzmann probability Pr⁡=e−Δ/T\Pr = e^{-\Delta / T}. At high initial temperatures, the algorithm freely climbs out of local valleys; as TT cools (T←0.9TT \leftarrow 0.9 T), acceptance of worse moves decays toward zero, allowing convergence near the global optimum.

SELF-CHECK 03 · Distinguish how Gödel's Incompleteness Theorems and Turing's Halting Problem each refuted Hilbert's Program.

Hilbert's Program required mathematics to be Complete, Consistent, Conservative, and Decidable. In 1931, Kurt Gödel used Gödel numbering and self-referential paradoxes to prove that any consistent formal system capable of elementary arithmetic is incomplete (First Theorem: there exist true statements unprovable in the system) and cannot prove its own consistency (Second Theorem).

In 1936, Alan Turing and Alonzo Church refuted Hilbert's fourth requirement—Decidability (the Entscheidungsproblem)—by defining effectively calculable functions (Church-Turing Thesis) and proving that HALTTM\text{HALT}_{\text{TM}} is undecidable.