Computing as a Mathematical Tool
This closing lesson steps back to see how programming extends mathematics — not replacing rigour, but amplifying what a mathematician can do. Across the sciences, computation has become a third pillar alongside theory and experiment.
Numerical computation. Many problems have no closed-form solution — a difficult integral, a root of a messy equation, a large linear system. Programs solve them approximately: numerical integration (Riemann-sum refinements), Newton's method for roots, and iterative linear solvers. Unit 6's integrals and Unit 5's Newton's method become executable.
Symbolic computation. Computer algebra systems manipulate expressions exactly — differentiating, integrating, factoring, and solving symbolically, doing by machine the algebra a mathematician does by hand, but without arithmetic slips.
Simulation and exploration. Programs let you experiment with mathematics: generate data, test a conjecture on thousands of cases, visualise a function or a dynamical system, run a Monte Carlo simulation to estimate a probability by random sampling. This turns abstract structures into things you can see and probe.
Proof and verification. Computers assist proof — checking millions of cases (as in the four-colour theorem), and proof assistants verify each logical step of a formal proof with total rigour, catching errors no human referee would.
The essential caution for the mathematician: a program's output is only as trustworthy as its logic and its numerics. Floating-point results are approximate (Lesson 2), a simulation is only a sample, and a computation that runs is not a computation that is correct. Programming is a powerful mathematical instrument, but it demands the same scepticism and verification as any mathematical argument — the machine computes what you told it to, not necessarily what you meant.
Common pitfall: treating a program's numerical output as exact mathematical truth. Floating-point results are approximate and accumulate rounding error, a simulation estimates rather than proves, and a bug produces confident wrong answers. Computation supports mathematical work — exploring, checking, approximating — but its output must be verified with the same rigour as any argument; a number a program prints is not automatically a theorem.
Random accent points scattered in a square with an inscribed quarter-circle; the fraction landing inside times 4 estimates pi, converging as more points are added — Monte Carlo approximation.