People are sometimes mildly surprised when I say I go out to the garden at work or to a cafe on the weekend or outside at home to do a bit of recreational mathematics.
What sort of recreational mathematics? Often, filling in the many gaps in my knowledge usually using online resources (more on that later), almost always going down a rabbit hole. I’ll elaborate on the “rabbit hole” part in future posts.
To paraphrase Star Trek’s Dr McCoy, I’m a software engineer, not a mathematician dammit, but I truly think mathematics is humankind’s most amazing invention or discovery, depending upon your philosophical position (a rabbit hole of its own). I’ve had the sense that mathematics is important since at least my last year of school (1980) when I was first introduced to topics like complex numbers and calculus.
In school, I was a very average student, often below average, doing much better with study after leaving school. It is sometimes said that education is wasted on the young. There’s truth in that, because often, we’re not ready when we’re young. We have other interests, don’t see our possible futures well, don’t see the big picture, don’t have the right mentor. I’m 60 now, and have a slightly different perspective on the world than that of my teenage self.
Mathematics is the language of Science. Having worked in a research organisation for more than a decade, surrounded by people with much greater knowledge of math and science, having had kids go through school, wanting to help when they’ve struggled, just as I did: these things have motivated me to spend more and more time learning new things and re-learning old. But now I do it mostly for myself. Just because. I don’t really need another reason. Having said that, it is also important for my work.
The last of my two kids finished school a couple of years ago (although my daughter expressed interest in learning more math in 2023, so we did some calculus together, which was nice). Much of the way math is done in schools (at least in Australia) does not seem to have changed much in the 43 years since I was in school. The text books are similar, sure sometimes they’re PDFs on a laptop, and sometimes there are online and tools and resources with quizzes, but mostly it’s still done with pencil/pen and paper. You get graded on what you get right and learn (maybe) from the bits you lose points on. At least for my two kids, reinforcing quizzes seemed to be infrequently used, and often, people were left behind.
It’s no wonder that people talk about how they hate math in later life, given their school experience, which is a shame, because there is wonder in mathematics and it underpins a lot of what we take for granted (all our technology). Do we really need more politicians with Law degrees or more with science, engineering, mathematics? I’m reminded of a Star Trek episode where the Enterprise answers a distress call and beams down to the planet to find a civilisation whose technology is breaking down and no-one understands it anymore.
There are plenty of text books and some great books, such as Calculus and Pizza that I ate up (groan) several years ago. The Theoretical Minimum does a reasonable job of giving you enough math (mostly calculus) to do classical physics. But in my view, one of the best resources (for math and science) is Khan Academy. What I love about it is that you watch a short video or two, perhaps read a short reinforcing article, then you are presented with 4 problems. The free app means that all I need is my phone, a notepad and a pen (slightly ironic given my comment about pen and paper above).
A rule that I rarely break is that no matter how many sets of 4 problems (they change each time, with some eventual recycling) I have to go through, I don’t proceed to the next section until I get them all right. It’s about competence, mastery. I’m not in a hurry, which is good, because I’m the slow plodding type. If I do break that rule it’s because I’ve done many sets of 4 problems for the section but I’ve just made careless mistakes, and I believe I fully understand the concepts. I’ve broken that rule once in the last couple of years, and it still didn’t feel right, even though I knew exactly what I had done wrong and why I shouldn’t have made the mistake. I may even have done an (almost) identical problem in a previous set of 4, and got that right.
This issue of mistake-making while solving problems is something that increasingly interests me.
I’ve been a software engineer for more than 25 years and coding for fun for more than 40 years, so I’m used to the idea of writing code and writing additional code to test that. There are various approaches to software verification and that’s a topic I could write a lot about, and spend a lot of time doing and talking about as a practitioner of software development in my workplace. For example, to illustrate the idea, given this trivial function in the Python programming language that returns the cube of a number (
def cube(x):
return x*x*x
one or more functions, procedures actually, can be written to test this by asserting that certain expressions must be true. Here is one such procedure:
def test_cube():
assert cube(2) == 8
assert cube(4) == 4**3
assert [cube(n) for n in range(1, 101)] == \
[n**3 for n in range(1, 101)]
which, in words says:
- It must be true that applying the function cube to 2 equals 8.
- It must be true that applying the function cube to 4 equals 4 raised to the power of 3.
- It must be true that applying the function cube to each number in the range 1 to 100 is the same as raising each corresponding number to the power of 3.
If any of these assert statements yield an expression that is not true, the test will fail, often with obvious red text in the output. An important benefit is that if the code under test is later modified (e.g. to make it run faster) a test should detect failures if bugs are inadvertently introduced.
As an aside, in case you’re wondering, 101 is not included in the range above, a so-called exclusive range in Python. As another aside, the odd looking code in test_cube:
[cube(n) for n in range(1, 101)]
is a so-called “list comprehension” which is essentially a loop that returns a list, in this case:
[1, 8, 27, 64, 125, 216, 343, 512, ..., 1000000]
A real-life function I wrote recently computes the checksum of the bytes of a sensor packet allowing it to be compared to the expected checksum (designed to guard against transmission errors between sensor and computer) where the expected checksum is encoded as the last byte of the packet. In this case I could write the checksum function knowing that there were known good expected results against which a test function could be written. It’s not always that straightforward though.
Returning to Khan Academy and mathematics, while often a problem will be presented and a numeric answer required, it is not uncommon for the problem writers to acknowledge the difficulty level such that multiple choice symbolic answers are given, often in the form of a non-trivial function. The learner may then realise that none of the answers given matches his/hers, prompting a check of the steps leading up to a solution, precisely what you are forced to do when code you have written fails to pass a test.
Could an increased emphasis upon such approaches help learners of mathematics? I suspect so, and I plan to explore this theme in future posts.
