∀ Computational thinking

The maths behind the code a blackboard, some chalk, one idea at a time

Logic, probability, theory of computation, graphs and optimisation: the mathematics beneath computing, explained at the blackboard.

The A* algorithm: pathfinding with an admissible heuristicEdit distance: Levenshtein and comparing textsInteger linear programming and branch and boundThe simplex method explained without heavy formulasCounting principles: the sum rule and the product ruleInjective, surjective and bijective functions with examplesProof techniques: direct, by contradiction and by casesStrong induction and loop invariants: proving code correctConfidence intervals: how to compute them and what they meanThe Monty Hall problem: why you should switch doorsRegression to the mean: why extremes do not repeatThe Church-Turing thesis: lambda calculus, recursion, registersMinimizing an automaton: Myhill-Nerode and equivalent statesPolynomial reductions worked out: from 3-SAT to clique and coverThe A* algorithm: pathfinding with an admissible heuristicEdit distance: Levenshtein and comparing textsInteger linear programming and branch and boundThe simplex method explained without heavy formulasCounting principles: the sum rule and the product ruleInjective, surjective and bijective functions with examplesProof techniques: direct, by contradiction and by casesStrong induction and loop invariants: proving code correctConfidence intervals: how to compute them and what they meanThe Monty Hall problem: why you should switch doorsRegression to the mean: why extremes do not repeatThe Church-Turing thesis: lambda calculus, recursion, registersMinimizing an automaton: Myhill-Nerode and equivalent statesPolynomial reductions worked out: from 3-SAT to clique and cover

Topics

Logic, probability, theory of computation, graphs and optimisation: the mathematics beneath computing, explained at the blackboard.

Featured articles

∀ Discrete mathematics

Check digits: Luhn, ISBN and IBAN explained with remainders

How check digits work for payment cards, ISBNs and IBANs: the Luhn algorithm, weights modulo 10 and 11, the modulo 97 check, and which errors they catch.

5 min read →
σ Probability & statistics

Bayes' theorem and false positives: the diagnostic test case

Bayes' theorem applied to a test with 99% sensitivity: why a positive result can be wrong in 5 cases out of 6 and how to update the estimate step by step.

4 min read →
λ Theory of computation

Approximation with guarantees: when the optimum is NP-hard

Approximation ratios, guaranteed algorithms for vertex cover and the travelling salesman, schemes for knapsack and the limits proved by inapproximability.

4 min read →
⋔ Graphs & optimisation

The A* algorithm: pathfinding with an admissible heuristic

A* combines Dijkstra with an estimate of the remaining distance: admissible and consistent heuristics, Manhattan distance, grids and speed trade-offs.

5 min read →
∀ Discrete mathematics

Equivalence relations, classes and partitions of a set

Equivalence relations, equivalence classes and partitions: how the three ideas connect, concrete examples, and the union-find structure for computing them.

4 min read →
σ Probability & statistics

Conditional probability and independence explained with examples

How to compute conditional probability, what independence between events really means and why confusing P(A|B) with P(B|A) leads to serious mistakes.

5 min read →
λ Theory of computation

The class P: what solving in polynomial time really means

Definition of the class P, why polynomial time is the boundary of tractability, the role of input encoding and why pseudo-polynomial ones fall short.

4 min read →
⋔ Graphs & optimisation

Dijkstra's algorithm: shortest paths with non-negative weights

How Dijkstra's algorithm works: relaxation, a heap-based priority queue, why it needs non-negative weights and how to apply it to real maps and networks.

4 min read →
∀ Discrete mathematics

Injective, surjective and bijective functions with examples

Domain, codomain and image; when a function is injective, surjective or bijective, how to invert it, and why it matters for hashes, keys and encodings.

4 min read →
σ Probability & statistics

Mean, median and mode: which measure to use and when

Arithmetic mean, median, mode, trimmed, geometric and harmonic mean: how to compute them, how they react to extremes and which to choose case by case.

5 min read →
λ Theory of computation

The halting problem: why it is undecidable

The diagonalization proof that no algorithm can decide whether a program halts, explained step by step, with its practical consequences for software.

4 min read →
⋔ Graphs & optimisation

Graph colouring: timetables, frequencies and registers without clashes

Graph colouring applied to exam timetables, radio frequencies and register allocation: chromatic number, the greedy algorithm, DSatur and practical limits.

5 min read →