Numerical Methods in Python

Lecturer: David Ham

In 2011 and 2012 I taught an introductory undergraduate numerical methods course in Python. The course outline and notes are here in case they are of use to anyone.


The course notes can be downloaded here


Lecture 1: Binary arithmetic
Counting, addition, multiplication and negative numbers.

Lecture 2: Floating point arithmetic & function approximation
Floating point numbers, radix and mantissa. Rounding error and catastrophic cancellation. Piecewise constant and piecewise linear approximations to functions. Big ‘O’ notation.

Lecture 3: Taylor’s theorem and numerical integration
Taylor series and error terms. Trapezoidal rule, Simpsons rule.

Lecture 4: Numerical differentiation
Divided differences, centred and non-centred schemes. Elementary methods for ODEs are included as extension material.

Lecture 5: Root finding
Newton’s method and bisection, rates of convergence for root finding algorithms and the limitations of these techniques.

Lecture 6: Numerical linear algebra
Dot products, matrix products, solving diagonal systems.

Lecture 7: Solving linear systems
LU factorisation.

Lecture 8: Curve fitting and least squares
Polynomial interpretation and least squares curve fitting.


The module was assessed via a practical programming test, and a question in a combined examination paper. The students were provided with this formula sheet.

2011: programming exercise, exam questions, exam questions with answers.
2012: programming exercise, exam questions, exam questions with answers.