As attention in England turns to the World Cup, I’ve been reading a couple of books about the mathematical modelling of football: Anderson and Sally’s The Numbers Game and Sumpter’s Soccermatics. I’d recommend them both if you’re interested in learning more about some of the patterns in the data that football (in this case, soccer) generates. I suspect young (and not so young) people are already quite familiar with the computational modelling of football, not through books such as these, but through computer games such as FIFA and Football Manager. These games make extensive use of real data, and are excellent examples of what the English computing standards describes as ‘computational abstractions that model the state and behaviour of real world problems’

The parallel between mathematical modelling and the computer programming is no coincidence: there are deep historical connections between computer science and mathematics, and these remain strong to this day. Doing mathematics, at its heart, is a two-step process of thinking about a problem and then manipulating symbols according to rules: before Turing’s day the symbol manipulation (typically arithmetic) was done by people called computers, since his time (in the real world, if not always in school), this work is done by machines called computers. In either case, it’s the thinking about the problem and its solution where the real mathematics lies. Similarly, programming is a two-step process: thinking about the problem and how to solve it (the ‘computational thinking’), and then writing the instructions (the code) which mean the solution can be carried out by a dumb machine.

In his classic 1957 text, How to Solve It, Polya identifies four principles for problem solving in mathematics: understand the problem, plan a solution, carry the plan and review or extend the solution. I think all of these apply to problem solving in computing, with all but the third stage sitting comfortably within most approaches to computational thinking. There’s much common ground between computer science and mathematics: both domains demand logical thinking and a systematic approach, both result in computation, and both draw on the idea of abstraction. In her 2008 paper, Wing drew a distinction between abstraction in computer science and abstraction in mathematics, indicating that in CS, abstraction was both more general and more practical than it is in mathematics.

For those teaching in elementary school, there are so many opportunities to exploit the connections between mathematics and computer science, as they’re likely to find themselves teaching both to their class. Papert’s turtle graphics have long had their place in the mathematics curriculum as well as providing what I think remains a great way into coding. Scratch introduces pupils to four quadrant coordinates. Away from programming, dynamic geometry software such as Geogebra or graphics programs like Pixlr can introduce the ideas of transformations. Pupils can be introduced to probability through simulations in Scratch or Excel, and statistics through online surveys and data logging with the micro:bit.

Further up the education system, it becomes harder to bridge the artificial gap between CS and mathematics, but it’s well worth the attempt. Take any mathematics investigation or open-ended problem and, after trying a few ideas with pencil and paper, explore how you might program a computer to solve it: personal favourites are problems like ‘how many ways can you make 50 cents using coins?’, or ‘how many perfect shuffles does it take to get a 52 card pack back in order?’ Modelling works well here too, perhaps showing how a ball bounces, or estimating pi through the ratio of random points inside to those outside a unit circle, to creating a class (and overloaded operators) to perform fractions arithmetic. All of these are great coding activities, but they’d also develop pupils’ mathematical understanding of these ideas.

There are some great resources out there for folks interested in linking mathematics and computer science more closely. Top of my list would go the Scratch Maths project for Y5/Y6 maths from University College London, and the Bootstrap World courses for algebra and data science. It’s notable that both of these have taken impact evaluation very seriously.

Originally published in CSTA’s Advocate blog, and based loosely on a talk I gave at the Education Festival