post

In conversation with Robin Wilson

As the author and editor of 55 books, with a career weaving through academia, teaching, and popular maths writing, professor Robin Wilson has a variety of interests. His books cover topics ranging from graph theory and the history of maths to sudoku, Lewis Carroll, and the comic operas of Gilbert and Sullivan. But he considers himself first and foremost a communicator of mathematics. “I’ve always been a populariser and a publicist for maths, and I’ve always been thought of more naturally as a teacher. But I’ve certainly been involved with research, particularly in graph theory and its history.”

A prolific author

Many of his books lie in the areas of graph theory and combinatorics. He tells us how his first book, Introduction to Graph Theory, came to fruition. Still in print 52 years on, and now in its fifth edition, it began as a series of Oxford undergraduate lectures in graph theory. In those days, course lecture notes were sometimes in the form of booklets, purchasable from the university, so Robin wrote up his notes as a booklet, which was on sale for around £1. “At the time, there were few books in English on graph theory, and they were all too advanced and detailed, so you wouldn’t find someone attending just eight lectures buying one of them.” He continued: “I decided it would be useful to try and turn them into paperback book form.” The first edition went on sale for £1.50. He has also written several other books on graph theory, and also on its history, of which he is an acknowledged expert.

One of Robin’s most popular books is on How to Solve Sudoku, the now well-known combinatorial puzzle. He explained to us that “when sudoku puzzles came to this country in the autumn of 2004, and more and more newspapers started to include them, I enjoyed learning how to solve them. In mid-2005, there was a general election, and all the journalists were writing on political issues. But as soon as that was over, sudoku reached its peak, and all these journalists wanted to write about it, but didn’t know what to write.” A journalist approached Robin, calling him a sudoku expert, to which he replied, “No, I’m not an expert, I’m just an enthusiast.” Robin also recalls that he was asked how sudoku arose and how to solve it, and replied informing the journalist that Euler had not invented it, in spite of the websites that claimed he did. The next day, Robin’s paragraph appeared in the newspaper.

On the very same day, Robin received a phone call from a publisher inviting him to write a popular book on sudoku. Robin’s initial instinct was to decline, but he then spent a few days researching and developing techniques for solving them. The publishers gave him three weeks to write the book, in a race against Carol Vorderman’s book on sudoku. Robin rose to the challenge, writing it in just eleven days, and it was then published ten days later. Within just a few months it was available in twelve different languages. Robin recalls a highlight of the experience: “The BBC launched a puzzle magazine where my book was on the front cover of issue number one as a free gift. It gave me a real buzz, seeing it in the newspaper shops.”

Many of his books, both on graph theory and on the history of mathematics, are co-edited. He has co-edited with Lowell Beineke (from Indiana, US) a set of six research-based books, Topics in Graph Theory, which was initially intended as only a trilogy. Robin explained to us how the aim

One of Robin’s popular books

is to turn research-level work into surveys that are sometimes more readable by graduate students. This involves writing to the top international researchers in a particular area, and collecting their contributions into a single volume in which the expositions are then made more readable where necessary, and where the organisation, terminology and notation are standardised throughout the book. Although “it’s hard work being a good editor,” Robin enjoys this role, and he continues to edit books, often because “they’re books I’ve always wanted to have on my bookshelf.”

He has also published revised editions of some of his written books. We asked Robin how new editions come about. “For my Introduction to Graph Theory, I initially produced a new edition every eight or ten years.” Differences between editions sometimes arose in terminology; for example, “In the first edition I talked about circuits in graphs, but later ‘cycles’ became more standard.” Other changes were improvements to the exposition, or revisions in the exercises and the inclusion of solutions. In the wake of breakthroughs, major changes needed to take place: “When the first edition appeared, the four colour problem was still unsolved, and later editions had to take account of its solution.”

Robin next explained to us a project he worked on for several years. This project involved converting, into book form, an Open University course on the history of maths that was no longer being presented. He worked on this with two OU colleagues, the historians Jeremy Gray and June Barrow-Green. Volume 1 was published in 2019, and volume 2 in 2022, and Robin jokes, “They’re wonderful for door stops; volume 1 is 500 pages and volume 2 is 700 pages.”

These books present a source-based approach to the history of mathematics, with readers working through original sources, translated where necessary. Robin then went into more detail on some challenges of this project: “In many places we had to improve the exposition, and in order to make it more multicultural, we introduced more Indian and Chinese mathematics and strengthened our treatment of Islamic mathematics. We basically reworked the entire course, incorporating the source material where necessary. My role was mainly (but not entirely) on the editorial side, while June and Jeremy reworked the historical content.”

The four colour theorem states that any map can be coloured so that no two bordering countries are the same colour with at most four colours

The university of the air

Robin’s books on graph theory had their origins in his teaching in various universities. After completing his undergraduate degree at the University of Oxford, he went to the United States for his graduate work, being granted a PhD from the University of Pennsylvania. For his initial one-year scholarship, “the English-Speaking Union didn’t just want someone who was going to get a first. They wanted someone with other interests, and I’ve always had a great interest in music.” At Pennsylvania, he was then offered the chance to stay on as a teaching fellow: “I taught some calculus courses and thoroughly enjoyed this, and by the time I’d finished my PhD, I’d already presented 150 lectures, which provided me with a lot of teaching experience.”

Back in the UK, he held positions at Cambridge and Oxford universities, and his interest in teaching led him eventually to the Open University, where he was a member of the mathematics faculty for 37 years. The OU had recently been founded as an innovative new model for university education. Originally envisioned as a ‘university of the air’, students with any level of qualification could earn a university degree through distance learning, with specially designed course materials mailed to students and TV and radio programmes broadcast by the BBC. In addition to remote learning, OU students also attended tutorial classes and summer schools, and it was at the OU’s first maths summer schools in 1971 that Robin first became involved.

“I arrived basically sympathetic to the OU and its maths foundation course, and had two weeks teaching at an OU summer school in north Wales. I came back wildly enthusiastic. The students, many of whom had no previous mathematical background, worked from 9am to 9pm, and then went to the bar for a drink where they chatted about linear algebra. I don’t recall any Oxford students chatting in the bar about linear algebra!”

Robin’s experience at the OU summer schools was so positive that he decided to apply for a longer-term job there, and succeeded: “I was getting very enthusiastic about the whole idea. I was really thinking, this is my place.” He joined the OU full-time just as the first pure maths course was being developed. “I found it very exciting, and quite daunting, not least because I had to make five BBC nationally broadcast television programmes in my first three months, in addition to the appropriate training for this. I think that I was always quite a competent presenter, but I was never a natural; I eventually presented around 30 TV programmes, but was always much happier with my radio broadcasts.”

Robin before he realised he could also buy Chalkdust T-shirts

The TV programmes were originally recorded at Alexandra Palace in north London, the former home of the BBC which had been recently vacated with their studios available for use. “Studio A was the larger one where we usually did the recording, and studio B was the smaller one where we had our rehearsals. We once had to record in studio B, and when I remarked that it seemed rather cramped, the producer said: ‘Don’t criticise: in the 1950s we once broadcast Verdi’s Aida live from here!’ We usually
had rehearsals about a week beforehand, and recording was then a two-day job of incessant rehearsals followed by a one-hour recording session when we had to get everything right.”

Not everyone had such a positive opinion about the Open University. In particular, “the academic world was sceptical, saying that ‘You can’t get a degree just by watching the telly!'” In fact, it was the specially written correspondence texts that provided the main teaching resource, and the television was partly to give visual backup for reading them. Robin enthused: “The original staff members were quite remarkable. They came not only from academia, but also from schools and industry, and were sufficiently motivated about the OU concept to give up their previous full-time jobs to try this crazy thing which might not work.”

Mathematics and music

Robin has taken advantage of his position at the Open University to take courses in some of his other interests. He has always had a strong interest in music, and has been a choral singer since his teenage years, as well as taking part in many musical stage productions. “When I joined the OU, I decided to take advantage of its courses on the fundamentals and history of music, and eventually, combining these with other OU arts courses, I was able to complete a second BA degree, an honours degree in humanities with music.”

Music remains a huge part of his life. He regularly performs in musical theatre and operetta. “I recall appearing in Sweeney Todd, when I had to have my throat cut, with blood everywhere! In the coming year, I hope to take part in stage productions of Rodgers and Hammerstein’s Cinderella, and in Jesus Christ Superstar.”

It’s clear that, from graph theory to showbusiness, Robin Wilson has a knack for finding harmony in all the things he loves.

Robin appears as Euler in a history of mathematics lecture

post

Winning Wythoff’s game

Are you looking for a new game to beat your friends at? If so, look no further! I’m going to show you a simple game—just two players and one piece on a board—where you will be able to beat your friends every time, meeting a well-known sequence on the way…

Let me introduce you to Wythoff’s game. Named after the Dutch mathematician Willem Abraham Wythoff, it involves moving a queen on a two-dimensional board. If you’ve ever played chess, the movements of a queen will be familiar to you: she can move right, left, up, down and along any of the diagonals until she reaches the boundaries of the board:

the queen can move in all directions

Here’s the catch: in Wythoff’s game, the queen can only have some of these moves. She must not move in any way right or up. This gives a reduced set of moves:

queen moves wythoff

So for example, in Wythoff’s game, a move from $(4,3)$ to $(4,2)$ is allowed but moving from $(4,3)$ to $(4,4)$ is banned:

allowed banned wythoff

Below are some examples of the moves available when the queen is in different positions on the board. In the diagrams, the queen is allowed to move to any position along the arrows:

moves example

On a larger board, the pattern is the same: we’re always only interested in what’s below and to the left of the queen.

How to play

At the beginning of the game the queen is assigned a starting position by both of the players—this could be done by randomly choosing a square on the board or by you each picking your favourite number to get a coordinate.

The rules of the game are as follows:

  • Two players take it in turns to move the queen.
  • On each turn, a player must move the queen to a different square.
  • The player who cannot move the queen on their turn loses the game.

A player loses the game when the queen can’t be moved due to the boundaries on the left-hand side and the bottom of the board. You can try it out and see that this only occurs at the square $(0,0)$. By ending a turn on $(0,0)$ we leave our opponents with no moves and win the game!

A little position analysis

Alright, so $(0,0)$ is the magic square to land on, but how do we make sure we get there before our opponent?

We start by grouping the squares into two groups: the helpful ‘P’ positions and the unhelpful ‘N’ positions:

  • N positions are positions from which the next player to make a move will eventually win.
  • P positions are positions from which the previous player (who ended their turn by moving to the P position) will eventually win.

Here, $(0,0)$ is a very special P position as the player to move the queen to $(0,0)$ will win the game immediately. The positions which end the game are given the special name of terminal positions.

In our quest to get to $(0,0)$, we should think about the relationship between P and N positions. Let’s define a follower, $x’$, of a position, $x$, as any position that can be reached from $x$ by a player in one turn. For example, $(0,0)$ is a follower of the position $(1,0)$, and is reached by moving the queen one position to the left.

We can now say something about the behaviour of P and N positions:

  1. The terminal positions are P positions.
  2. All the followers of P positions are N positions (since landing on a P position leads to a win, so the player starting from that position should lose).
  3. Every N position has at least one follower which is a P position (which is how the next player will eventually win).

Starting from the terminal position $(0,0)$ and working backwards, we can categorise all the positions on the board of Wythoff’s game in the following way:

Step 1: Begin at the terminal position $(0,0)$ and highlight it blue. This is a P position by 1:

step1

Step 2: Consider all the positions that have $(0,0)$ as a follower. From 2 we know all the followers of P positions are N positions. The positions we are considering all have a P position as a follower so must instead be N positions. Highlight these N positions orange:

step2

Step 3: Move to a position that has not yet been coloured in, but where all the followers of this position have. If all the followers of this position are N positions then by 2 and 3 this must be a P position. If at least one of the followers is a P position then by 2 the position is an N position:

step3

Step 4: Repeat the previous step until all the positions on the board have been coloured.

Filling in the P and N positions of Wythoff’s game for the board here then goes like this:

step4 1
step 4 2

Tada! Once the P and N positions have been determined, the winning strategy is to always end your go by moving to a P position when possible. Using the P positions like stepping stones, you can reach the position $(0,0)$ and win.

Strategy in action

Time for an example game! Let’s consider the case where the queen begins at $(2,3)$ and that we are the player to move the queen first.

On our first move we move to the P position $(1,2)$:

example step 1

This leaves our opponent with only N positions to choose from, and they choose to move to $(0,2)$:

example step 2

We respond by moving to the terminal position $(0,0)$, winning the game and presumably lots of money/drinks/respect:

example step 3

Are we the champions?

Alright, so you’ve trapped a friend or lured in an innocent bystander to play with you; you are eager to try out your strategy. But before you get too confident, you’ve got to ask yourself one question: are you guaranteed to win (punk)?

If you haven’t already noticed it, go back and see if you can spot the trick to this strategy. The guarantee is real… but you have to get to a P position before your opponent! This means we must be the first player if the queen starts on an N position, or the second player if the queen starts on a P position. Deciding who starts is then what determines the winner of the game if you both know the winning strategy.

If you want to stop your friend uncovering your winning strategy it might therefore be beneficial to deliberately make a few mistakes here and there, throwing them off the scent (or rip out these pages in Chalkdust before you let them borrow it).

With the colour-coded cheat sheet of the board we made earlier, you should be all set to go. But if lugging around a sheet of colourful paper does not appeal to you, it might interest you to take a look at the coordinates of the P positions. These are symmetric and the first of these pairs is $(1,2)$ or equivalently $(2,1)$. The second pair is at $(3,5)$ or $(5,3)$. Feel familiar?

It turns out that a subset of the P positions of the game are given by the positions corresponding to a pair of Fibonacci numbers! All the P positions of the game have coordinates of the form \[(\lfloor n \phi \rfloor, \lfloor n \phi^2 \rfloor)\] and the symmetric equivalent $(\lfloor n \phi^2 \rfloor, \lfloor n \phi \rfloor)$. Here, $\lfloor \cdot \rfloor$ is the floor function which will round the argument down to the nearest integer; and $\phi$ is the golden ratio, which is the number approached by the ratio of consecutive Fibonacci numbers as we tend to infinity. Here are the coordinates of the P positions for $0 \leq n \leq 7$:

$n$ $\lfloor n \phi \rfloor$ $\lfloor n \phi^2 \rfloor$
0 0 0
1 1 2
2 3 5
3 4 7
4 6 10
5 8 13
6 9 15
7 11 18

This form of the P positions is given in Wythoff’s discussion of the game from 1907, A Modification of the Game of Nim, which you can find and read online.

The proof of this is a rather long proof by induction which I’ll let you try yourself, but essentially you have to show that these pairs satisfy the behaviour of the P and N positions set out in 1, 2 and 3.

What’s next?

A standard chess board is $8\times8$, but the terminal position of our game is only affected by the boundaries of the left and bottom edge of the board. If we extended the standard chess board to have more squares our strategy would remain unchanged. This means you can choose your board to be as large as you want—even infinite!—however you may want it to be a little smaller so that it fits on your coffee table. Here are the P positions on a $16\times16$ board:

big board

If you’re keen to see what happens when you play with multiple queens, check out the book Winning Ways for Your Mathematical Plays, volume 1, by Berlekamp, Conway and Guy. The analysis of P positions for many different games and the behaviour discussed earlier is explored in Thomas Ferguson’s book A Course in Game Theory. For further discussion on how Fibonacci numbers link to the P positions see Around the World in 80 Games by Marcus du Sautoy.

You now have the knowledge to beat your friends! Good luck—but if you decide the starting order, you won’t need it.

post

Notched edge cards

Once upon a time there were no cheap personal computers, which made storing data and looking up information really slow. But there was a solution: notched edge cards. Much of the terminology and techniques for these cards were borrowed from expensive mechanical technology used by regular punch cards.

But what is a notched edge card? Imagine a stiff piece of card with nice small round holes punched in the edges. A handheld punch—which looked like the punches used at one time for various paper tickets—can be used to turn a hole on the edge of the card into a notch, hence the name of the cards.

A punch card, ready to store one line of Fortran77

Once all the notch making is done, the cards are stacked in a deck. Borrowing a trick from punch cards, the upper right hand corner of each card is usually clipped off, allowing you to more easily make sure that all of the cards in a deck are facing the same way.

Long metal ‘knitting needles’ can then be inserted through the holes. With a little shaking, the needle is lifted up, and the cards that did not have a notch lift out on the needle. The notched cards are squared off and put in front of the unnotched cards. This process can be repeated with multiple holes, and at the end the cards with the same pattern of notches on their edges will be grouped together. With a little practice, anyone can quickly put the deck in sorted order.

This technology would not have been good for a very large database, but for several hundred cards it was wonderful. It required no expensive equipment or even electricity! The handheld notching punches originally cost less than around £5 each, and you can still find them for around £10. The original sorting needles had wooden and later plastic handles; these handles are not really needed, but can easily be replaced with handles from the hardware shop tool section.

When the notched edge cards were popular, and being used by larger commercial enterprises, there were some other tools available. There was a bulk notch tool, which could clip a notch in the same place in several hundred cards at once—think of it as a specialised office paper cutter. There was a vibrating platform which could help stack and square off a deck of notched edge cards. But the most interesting and rare piece of hardware was the card punch from the Royal McBee company for their Keysort cards. You could not buy one and instead had to rent it from the company, a practice started by IBM for the early unit record—that’s what we called punch cards back then—equipment.

A McBee Keysort B86791X card, designed for storing data about birds in South America

One notched edge card is placed in a slot at the top of the punch, and below that are several columns of buttons. The keys in each column were numbered $7, 4, 2, 1$. The operator pushed down these keys which locked in place. When the operator was happy with the configuration of punches they had encoded for that edge, they pulled the lever on the side the device, and all the punches came up and notched the columns on that edge of the card in a single stroke. You proceeded in this fashion with the rest of the cards in the deck. When you had finished one edge, you could rotate the cards to notch the holes on the next edge.

Many of the early adding machines also had this particular mechanical design: you push down keys to input the numbers you wanted to add, then pulled the lever and that number was printed on a continuous roll of paper. By throwing some other switches, you could get the total output onto the paper.

The best selling brand was the McBee Keysort, probably because they came up with the support devices that I just discussed and they pre-printed cards for common business applications. For example, it was possible to get blank multipart cheques pre-printed and pre-punched. This meant that a small business could reconcile its cheques without buying expensive tabulating equipment.

Keysort cards became immensely popular for public schools and small-town libraries in the United States. They also gained popularity for military occupational specialties in the US army, record keeping in the US forestry service and other locations that did not have a lot of electrical outlets or big budgets.

There were also notched edge cards that had space in the centre for microfiche—a photographic technique that takes very small pictures of documents to save storage space and speed up access. By mounting them on a notch edge card, the operator could quickly find any given document they desired. I’d like to remind you the technologies I’m discussing are very old, so don’t be too judgmental—but these cards were still in use into the mid- and late 1960s.

Encoding systems

The simplest way to encode digits on notched edge card was group four holes into what was called a field. Within the field, the holes represent the values $7, 4, 2$ and $1$ from left to right. To store a digit in a field, you simply notched one or two holes. You stored a value of $3$ by notching both $2$ and $1$. Likewise, $5=4+1$, $6=4+2$, $8=7+1$ and finally $9=7+2$. It is possible to store a $7$ by notching $4, 2$ and $1$ (instead of just notching the $7$), but this involves three columns and physically weakens the card, so was avoided. Likewise, you could store some numbers larger than 9 by notching more than two holes, but since we use a base 10 number system it was more convenient to store each digit of a number separately.

Letters can also be done in two punches each. The trick is that some combinations will represent multiple letters, much like you see on some paper index products which will have ‘XYZ’ on a single tab.

Finally, we could use what was originally called a superimposed code. The most popular of these was known as Zatocoding, but today is referred to as hashing and we have a better understanding of the mathematics behind it. While the encoding of letters and digits was relatively standard, each of these hashes was unique to the set of data we were trying to index, and required a copy of the key to the hash. It’s still a good technique though, especially if you have a small data set that’s relatively static (notice that the definitions of ‘small’ and ‘ static’ have changed a good bit since this technology was popular).

Making cards

If you want to make your own card database, it’s not too hard to get hold of what you need. Knitting needles that can be used as sorting needles are easy to get from any craft shop. Notching punches can be found on eBay, or you might get lucky and find them in an office supplier, maybe sold as a ticket punch. Getting the cards themselves is the real challenge.

I recommend finding a print shop that does wire spiral binding: the punch they use to make the holes for the spiral bind often makes circular holes around the right size and distances apart. You’ll want to print on your cards before sending them to the bindery: it’s hard to print pages that have already been punched.

I hope you get a chance to play with this technology and it gives you some incentive to read about the history of early computing equipment.

post

On the cover: Spirographs

Spirographs blur the line between geometry and art. When spirographs are mentioned, a first thought probably goes to the kids’ art toy—but who says it’s just for kids?! After this issue’s cover artist introduced me to spirographing at a Piscopia Initiative event, my first task was a trip to Smyths toys superstores to grab myself a kit. The shapes of a spirograph (hypotrochoids and epitrochoids—but we will get to that later) are created by using two circles. One circle is stationary; we will call this a ring because it has a large hole in the centre. Around the inside and outside of the ring are small teeth, or notches. The other circle we use moves and we will call it a cog. The cog is a smaller filled circle with small holes for your pen, and teeth around the outside. These teeth help with the rotations of the circle and give guidelines for where to start. In short, you take a ring, put your cog on the inside (or outside), line up the teeth, put your pen in the hole and go around and around the circle. Although it sounds simple, the creation of spirographs takes practice and is a slow art form.

About the artist

One person who got this kit as a child and never gave it up is Rachel Evans. She is better known in the community as Spirograph Girl. When I asked her about her inspirations for choosing spirographs as an art form, she said this: “I would say that as an artist I found spirograph but that’s completely untrue! Spirograph made me into an artist and it’s been an amazing ride, just going through one project after another. My process is very simple: I spirograph, colour in the pattern, then cut it out and stick it on. I also work digitally via the Inspiral app—which is what I used for this cover, I hope you like it!”

Hypotrochoids

Let’s get into the maths! Most of the spirographs on the cover are hypotrochoids. These are roulette curves which are created when a circle rolls around the inside of a fixed circle. Consider the diagram of a typical spirograph setup. We have the following variables:

  • $R$: the radius of the fixed ring.
  • $r$: the radius of the rotating cog.
  • $d$: the distance between the pen and the centre of the cog.

Schematic of a spirograph setup

The equations of the two circles are given by \begin{align*} && && \text{Ring: }& & x^2 + y^2 &= R^2 && &&\\ && && \text{Cog: }& & (x-(R-r))^2 +y^2 &= r^2. && && \end{align*} By examining the path the pen takes as the cog rotates around the ring, we get the following pair of parametric equations for the hypotrochoid: \begin{align*} x(t) &= (R-r)\cos(t) + d\cos\left({\frac{R-r}{r}t}\right) \\ y(t) &= (R-r)\sin(t)-d\sin\left({\frac{R-r}{r}t}\right). \end{align*} Note here that the parametric variable $t$ is not the polar angle, but the angle between the centre of the rotating cog and the horizontal axis. To complete the full pattern, this angle $t$ takes values from $0$ (when the pattern starts) to $ 2\pi \times \operatorname{LCM}(r,R)/{R} $ (when the pattern is complete). Here, $\operatorname{LCM}$ denotes the lowest common multiple between the radii of the cog and ring. Interestingly, we can use this to determine the number of spokes a spirograph pattern will have, and how many rotations of the cog it takes for the pattern to be complete! We have \begin{equation*} \text{number of rotations} = \frac{\operatorname{LCM}(r,R)}{R}, \end{equation*} and \begin{equation*} \text{number of spokes} = \frac{\operatorname{LCM}(r,R)}{r}. \end{equation*}

What we can notice is that only the radii of the two circles affect the number of spokes in your pattern. The pen location $d$ has no impact on this. The pen location only changes how `spiky’ your pattern is. When your pen is close to the centre of the cog, you will obtain very wide and short spokes, and when the pen is closer to the edge of the cog, you will get more tall and narrow spokes.

In particular it is the ratio between the two radii that is most important. Let’s call this ratio \begin{equation*} k = \frac{R}{r}. \end{equation*} We get different behaviour depending on the value of $k$. If $k$ is a rational number, given in its simplest form as $k=a/b$, the number of spokes is given by $a$ and the number of rotations are given by $b$. This is equivalent to the LCM formulation presented above. We get some interesting examples when $k$ is an integer (but we will look at those later). If $k$ is irrational the pattern is infinite and will never complete.

The cogs and rings of a spirograph usually have the number of teeth written on them

Now, before you all take out your rulers and attempt to measure the radii of your spirograph parts, there is an easier way to calculate these. Each spirograph part comes labelled with the number of teeth it has (the rings have two numbers for the inner and outer circles). We can rewrite the formulae in terms of the number of teeth on the rings and cogs instead. Let’s say that $N$ represents the number of teeth on the ring and $n$ represents the number of teeth on the cog. If the distance between the teeth is uniform across all parts, and this distance is, say, $S$, then the circumferences of the wheels are given by \begin{align*} L &= NS, & \mathcal{l} &= nS. \end{align*} However, we know that the circumference of the circle is given by \begin{align*} L &= 2\pi R, & \mathcal{l} &= 2\pi r. \end{align*} From simple manipulation, we obtain \begin{align*} R &= \frac{S}{2\pi} N, & r &= \frac{S}{2\pi} n, \end{align*} and end up with the much easier to work with formulae \begin{align*} \text{number of rotations} &= \frac{\operatorname{LCM}(n,N)}{N}, \\ \text{number of spokes} &= \frac{\operatorname{LCM}(n,N)}{n}. \end{align*}

Epitrochoid with $R=8$, $r=3$ and $d=2.5$

Epitrochoids

Another type of roulette curve created by a spirograph is an epitrochoid. This curve is created when circle rolls around the outside of a fixed circle. Following the path the pen takes as the cog rotates around the outside of the ring (as we did for hypotrochoids), we get the following pair of parametric equations for the epitrochoid: \begin{align*} x(t) &= (R+r)\cos(t)-d\cos\left({\frac{R+r}{r}t}\right) \\ y(t) &= (R+r)\sin(t)-d\sin\left({\frac{R+r}{r}t}\right). \end{align*}

Ellipse and rounded polygons with $d=r/2$. From left to right: $k=2$ (ellipse), $k=3$, $k=4$, $k=5$

Ellipses and rounded polygons

The first example we’ll look at is when the ratio of the ring to the cog is an integer, $R = kr$. The parametric equations are given by \begin{align*} x(t) &= (k-1)r\cos(t) + d\cos\left({(k-1)t}\right), \\ y(t) &= (k-1)r\sin(t)-d\sin\left({(k-1)t}\right). \end{align*}

Using the formulae above, the number of spokes the pattern will have is the integer $k$ and it will only take one rotation to complete the pattern! Additionally, if $k$ is even the pattern will be symmetric about the $y$-axis. A very special case is when $k=2$, as this produces an ellipse!

If you have a standard spirograph kit at home, you can see this behaviour with the 144/96 ring and the 48, 32, 24 cogs ($k= 2,3,4$ in these cases). Note that this only works if $d \neq 0$, ie your pen is not in at the centre of the cog. Regardless of the choice of $k$, for $d = 0$ you will always get a circle!

Hypocycloids with $R = kr$ and $d=r$. From left to right: $k=2$ (Tusi couple), $k=3$ (destroid), $k=4$ (astroid), $k=5$ (pentoid)

Hypocycloids

The second example we’ll look at is when the pen is on the circumference of the cog ($d=r$). This is not something we can draw with a physical spirograph kit unfortunately, but the resulting shapes are still very cool to look at. The equations for these are the exact same as for a hypotrochoid except with $d=r$. The spokes obtained in hypocycloids are what are known as cusps, sharp corners where the curve is not differentiable. A famous example of a hypocycloid is when \mbox{$R = 2r$}. This results in a 2-cusped hypocycloid which is just a line segment! This is often referred as a `Tusi couple’ named after Persian mathematician and astronomer Nasir al-Din al-Tusi (1201–1274): \begin{align*} x(t) &= (R-r)\cos(t) + r\cos\left({\frac{R-r}{r}t}\right), \\ y(t) &= (R-r)\sin(t)-r\sin\left({\frac{R-r}{r}t}\right). \end{align*}

Rosettes

Last, but certainly not least, we have my favourites—the rosettes. This example produces spirograph patterns that look like flowers. This occurs when we choose $d = R-r$. The parametrised equations for this curve are given by \begin{align*} x(t) &= (R-r) \left[\cos(t) + \cos\left({\frac{R-r}{r}t}\right)\right], \\ y(t) &= (R-r) \left[\sin(t)-\sin\left({\frac{R-r}{r}t}\right)\right]. \end{align*} However, for rosettes it is much more convenient to write the equations in polar form instead. After doing some clever trigonometry, we end up with the polar equation \begin{equation*} \rho = 2(R-r)\cos\left({\frac{R}{R-2r} \theta}\right), \end{equation*} where $\rho$ is the distance from the curve to the origin and $\theta$ is the polar angle. In this formulation, it is the ratio \begin{equation*} p = \left| \frac{R}{R-2r} \right| = \left| \frac{k}{k-2} \right| \end{equation*} that determines how many spokes (or `petals’) our flower will have. If $p$ is an integer we get a special pattern called a rose curve as it resembles a petalled flower. If $p$ is odd the flower will have $p$ petals and if $p$ is even the flower will have $2p$ petals. If $p$ is not an integer, you will get a rosette with the number of spokes given by the formulae introduced earlier for hypotrochoids.

Rosa curve, $p=2$

Rosa curve, $p=3$

Rosa curve, $p=5$

Rosa curve, $p=8$

 

 

$p=3/2$

$p=11/7$

$p=23/9$

$p=49/45$

post

Easy to state, hard to prove: The Collatz conjecture

The Collatz conjecture is an unsolved problem in mathematics. It is one of the most famous, and very easy to state, but hasn’t been proven despite being conjectured nearly 90 years ago.

Take any starting integer $a_0$, and follow this process:
\begin{equation*}
a_{i+1} =
\begin{cases}
\;a_i/2 & \text{if $a_i$ is even,}\\
\;3a_i+1 & \text{if $a_i$ is odd.}
\end{cases}
\end{equation*}
We stop applying this when we get $a_k=1$ for some $k$.

For example, with $a_0=17$, we get the sequence $17 \to 52 \to 26 \to 13 \to 40 \to 20 \to 10 \to 5 \to 16 \to 8 \to 4 \to 2 \to 1$.

It is conjectured that for any starting number, the process will terminate at 1 after finitely many steps: this is called the Collatz conjecture.

In some places, the statement of the conjecture doesn’t include the termination step, and instead says that it will reach 1 after finitely many steps. This is the same thing, since if you don’t stop as soon as you reach 1, you’ll follow the pattern $1 \to 4 \to 2 \to 1 \to 4\dots$ forever.

This conjecture was proposed in 1937 by Lothar Collatz (pictured above).

The conjecture is widely believed to be true, and so far it has worked for every number mathematicians have tried. Although ‘try everything and see what works’ is a valid approach (Chalkdust has been doing it for years!), it won’t give us a rigorous proof that the conjecture is true, as there would be an infinite number of integers to check.

If the conjecture were false, it would mean there is some number whose sequence doesn’t terminate at 1. Either it would keep increasing beyond any threshold we set, or it would end up in some loop (like the $4 \to 2 \to 1$ loop) of large numbers.

We could try to get a computer to find a counter-example, which would either end up in some other loop of large numbers or find a sequence which gradually increases forever without looping. However, this lands us back in the issue of asking the computer to carry out an infinite number of calculations in a finite amount of time.

Another approach would be to try to get a general proof which may only need some cases checking—for example, we know all powers of 2 eventually terminate. Can we categorise other numbers into finitely many categories which always terminate? Terence Tao had a go at this in 2019, and proved that the Collatz conjecture is ‘almost’ true for ‘almost all’ starting numbers. (In a similar vein, ‘almost all’ issues of Chalkdust have some ‘almost’ good jokes.)

The sequences produced by the algorithm are known as hailstone sequences, due to their rise and fall—until you reach some power of 2, you’ll always have to increase at some step when you’ve reached an odd number.

We say that the stopping time of a number is the smallest number of steps needed to reach 1. The stopping time varies for each starting number; if we begin with 32, we reach 1 after 5 steps, but starting with the smaller number of 27 takes 111 steps to reach 1. The graphs below show the stopping times for the numbers up to 100 and 2000.

An easier ‘problem’, similar to the Collatz conjecture, involves using $a_{i+1} = a_i + 1$ when $a_i$ is odd. This time we get a $1 \to 2 \to 1$ loop, and for every other odd number $a_{i+2}$ will always be smaller than $a_i$. We can rule out both the ‘increasing forever’ and ‘infinite loop of large numbers’ cases, so we know that sequences will always terminate.

This doesn’t work for the actual Collatz conjecture, because $(3a_i+1)/2$ is larger than $a_i$, and if this is odd, then we’ll grow larger still, so there’s a chance we can keep growing by a factor of $3/2$. However, this chance is small, so probabilistically, we’ll decrease in the long run. Unfortunately, this isn’t quite enough to prove we’ll always reach 1—unlikely things happen all the time!

As of 2020, all initial values up to $2^{68} \approx 2.95×10^{20}$ have been checked, and end at 1. This number has improved from earlier verifications; in 1992 the bound was $5.6\times 10^{13}$, which was improved to $19\times 2^{58} \approx 5.48\times 10^{18}$ in 2008.

post

The problem with addition

Addition is easy, it’s one of the first things we teach to primary school kids. $1 + 1 = 2,~ 2 + 2 = 4$, etc. A much more difficult operation to learn is multiplication. The numbers get bigger much more quickly, there are whole tables to memorise and there’s something I still don’t quite believe about $7\times 8 = 56$. However, precisely because of multiplication being ‘more restrictive’ an operation than addition in some sense, many of the biggest unsolved problems in maths are difficult, at least in part, because of addition.

The Goldbach conjecture asserts that any even number bigger than 2 is the sum of two prime numbers and the conjecture is still unsolved. If the problem were instead asking about representing integers $n$ as products of primes, we would quickly see that multiplication is too restrictive, and we can always find some large $n$ that can only be written as a product of any number of primes we desire. Even partially solved additive problems are unwieldy. The partition function of a positive integer (denoted $p(n)$) is the number of ways $n$ can be written as a sum of positive integers (up to reordering); so
$$
\begin{aligned}
p(1) = 1\!\!: & \quad 1=1, \\ p(2)=2\!\!: & \quad 2 = 2,\, 1+1, \\ p(3)=3\!\!: & \quad 3=3,\, 1+2,\, 1+1+1,
\end{aligned}
$$
and so on.
However, no closed form expression for $p(n)$ is known and the best we can do is a recurrence relation or approximate $p(n)$ (which ‘looks like’ \[\frac{1}{4n \sqrt{3}} \exp\left( \pi\sqrt{\frac{2n}{3}}\right)\] for large $n$). However, if the problem was instead: how many ways a positive integer $n$ can be written as a product of integers (denoted by say $\tilde{p}(n)$), then $\tilde{p}(n)$ will be smaller in general than $p(n)$ and depends only on the prime decomposition of $n$ (which admittedly has a whole host of other problems). “But maybe these two problems are just outliers!” I hear you cry. Let’s slowly build up to an additive problem called Waring’s problem and showcase some of the techniques used to tackle it by first looking at how a similar multiplicative problem might be dealt with.

Given some positive integer $n$, can we find non-negative integers $x$ and $y$ which satisfy \[x^2 \times y^2 = n?\] To solve this problem we can use a trick: $n=(xy)^2$, so $n$ must be a square number. Say $n = m^2$ for some positive integer $m$ so we can re-write \[x \times y = \sqrt{n} = m.\] Now we can appeal to the fundamental theorem of arithmetic, which tells us that $m$ can be written as a unique product of prime numbers, up to reordering. Thus, any $x$ and $y$ must themselves be products of these primes also. Then, after a simple counting exercise, we can even find all possible pairs $x$ and $y$ which solve this equation. Even if we throw more variables than just $x$ and $y$ into the mix, we will only ever find solutions where $n$ is a square number.

This technique will also work for powers other than 2, or for problems with more variables than just $x$ and $y$. In general, for a power $k$ and $s$-many variables $x_1,\dots, x_s$, the equation \[x_1^k x_2^k \cdots x_s^k = n,\] has solutions only when $n = m^k$ for some integer $m$. In this case, exactly as before, the fundamental theorem of arithmetic tells us there exists some (not necessarily distinct) primes $p_1, \dots, p_t$ such that \[ x_1x_2 \cdots x_s = m = p_1p_2\cdots p_t.\] To find all solutions we can set each $x_i~(i=1,\dots,s)$ to some product of the $p_j~(j=1,\dots,t)$, ensuring that each $p_j$ occurs for only one of the $x_i$. This is easy to do precisely because of how ‘restrictive’ multiplication is compared to addition and it shows just how powerful a result the fundamental theorem of arithmetic really is.

Now let’s change this from a multiplicative problem to an additive one, and ask the same question. Given some positive integer $n$, can we find non-negative integers $x$ and $y$ which satisfy
\begin{equation}
\label{eqn:simple}
x^2 + y^2 = n?
\tag{1}
\end{equation}
Suddenly, and despite using the ‘easier’ operation of addition, this has become a much more difficult problem to solve. It’s not even obvious if there are solutions for every $n$. As always, a good place to start when stuck is to try some test cases. Cases $n = 1$ and $n=2$ are both straightforward:
\begin{equation*}
1^2 + 0^2 = 1, \qquad 1^2 + 1^2 = 2.
\end{equation*}
But what about $n = 3$? We can’t have $x$ or $y \geq 2$ as then the left hand side of equation (\ref{eqn:simple}) would be at least 4, a contradiction. We are stuck again. Maybe if we allow more variables we can find solutions for more numbers $n$? Maybe, 3 variables is enough. So the question becomes: given some positive integer $n$, can we find non-negative integers $x,y,z$ which satisfy
\begin{equation*}
x^2 + y^2 + z^2= n?
\end{equation*}
Now, we can find solutions for all $n$ up to 7. But, similarly to $n=3$ in equation \eqref{eqn:simple}, 7 itself poses another problem. Maybe given a positive number $n$ we need four square numbers to be able to write $n$ as a sum of squares, ie
\begin{equation*}
x^2 + y^2 + z^2 + w^2 = n.
\end{equation*}
This now seems promising as we check more and more integers $n$ we can keep finding integers $x,y,z,w$ which satisfy this equation. In fact, Lagrange proved in 1770, by looking at remainders of numbers and their squares when divided by primes, his four-square theorem, which guarantees that 4 variables is enough for any positive integer $n$ we choose.

Phew! That was a lot of work compared to the multiplicative case where the fundamental theorem of arithmetic solves all our woes. To make matters worse the techniques of looking at remainders of cubed numbers and higher powers aren’t as nicely behaved as squares, so, the method to prove Lagrange’s four-square theorem breaks down for these higher powers. We’ve only answered the question for squares! If we allow any power and as many variables as needed, we can state the aforementioned Waring’s problem in full generality.


The intervals for Waring’s problem with $n = 2^k, 3^k, 4^k$ respectively on unit circles in the complex plane are shown by the sections in pink, which are the points $\mathrm{e}^{2\pi\mathrm{i}\alpha}$ satisfying $|\alpha-a/q|<n^{-1+1/(5k)}$

for each $1\leq q\leq n^{1/k}$ and $0\leq a/q\leq 1$. The intervals with smaller contributions are the leftover sections in blue. Notice how the intervals shrink as there are more and more disjoint intervals. In reality the pink sections are much much smaller than what is shown here but then they would be too difficult to see!

Waring’s problem

For a given integer $k$, is there some integer $s$ such that given any positive integer $n$ we can find non-negative integers $x_1, x_2, \dots, x_s$ satisfying
\begin{equation*}
x_1^k + x_2^k + \dots + x_s^k = n?
\end{equation*}
To try and solve this problem we can appeal to techniques from a branch of maths called analytic number theory.

The goal for the problem (and indeed much of analytic number theory) is to find an asymptotic formula, which is an approximation for some desired function that gets better and better with bigger and bigger numbers, then manually check the finitely many numbers leftover which aren’t approximated well. For Waring’s problem, we define the function $r_{k,s}(n)$ to be the number of solutions $(x_1, \dots, x_s)$ to the above equation. Waring’s problem can now be equivalently stated as: Given some $k$, is there an $s$ such that $r_{k,s}(n) \geq 1$ for all positive integers $n$? But, we still need a clever trick to rewrite $r_{k,s}(n)$ in a way that is useful to us. This clever trick comes from a large branch of mathematics called complex analysis.

Complex analysis is a branch of mathematics largely concerned with the theory of functions of complex numbers, but all we need are some results about integrating complex functions in the complex plane. Given some $n$ we can take the seemingly arbitrary function
\begin{equation*}
f(z) = \sum_{m=0}^N z^{m^k},
\end{equation*}
where we require $N \geq n^{1/k}$ and we finally get the integral:
$$
\begin{aligned}
\label{eqn:r}
r_{k,s}(n) = & \frac{1}{2\pi \mathrm{i}}\int_{|z|=1} \frac{f(z)^s}{z^{n+1}}\,\mathrm{d}z \\ = & \int_0^1 f(\mathrm{e}^{2\pi \mathrm{i} \alpha})^s \mathrm{e}^{-2\pi \mathrm{i} \alpha n}\,\mathrm{d}\alpha .
\end{aligned}
$$
Some of you may recognise this as the formula for computing the Fourier coefficients of the periodic function $f(\mathrm{e}^{2\pi \mathrm{i} \alpha})^s$.

The rest of the work is finding suitable bounds and estimates for this integral. It turns out that most of the size of the integral comes from small intervals around rational numbers between 0 and 1 with small denominator. Everything else has a relatively small contribution to the integral.

An example of what these intervals look like on the unit circle can be seen above.

Eventually, after approximating the integral on these small intervals, we ultimately find that for ‘sufficiently large’ $n$, if $s \geq 2^k + 1$ then $r_{k,s}(n)$ behaves like $C n^{s/k – 1}$ for some positive constant $C$, as seen on the next page.

Or, to put it another way, for sufficiently large $n$, $r_{k,s}(n) \geq 1$ and there is at least one solution for every $n$.

The circle method

Under the hood of the proof of Waring’s problem is a technique known as the circle method. Attributed to Hardy, Ramanujan and Littlewood, this method is used by analytic number theorists to solve a wide range of problems. The crux of this method is to find the Fourier coefficients of the function or series in question. This translates the problem from one about, in this case, the integers, to a problem about a sequence or function around a circle. The hope is that there are separate regions around the circle where the evaluation of the function is small (known as the minor arcs) and large (known as the major arcs). The minor arcs, which will form most of the circle, can then be bounded. This leaves the major arcs, where the contribution is most significant, to be studied. This will often result in a more tractable problem.

The values of $r(n)$ (blue) and $Cn^{1.5}$ (orange) for $k=2$, $s=5$. For large $n$, $r(n)$ is bounded between approximately $Cn^{1.5}/2$ and $3Cn^{1.5}/2$.

This is certainly a far cry from the simple method we came up with for our multiplicative problem! But we have our general method that works for any integer $k$. This is an example of a powerful tool called the circle method, which has been used to solve many problems in number theory.

Remember Goldbach’s conjecture mentioned at the start? There’s a similar, weaker problem which has been solved by the circle method called the ternary Goldbach problem, which claims every odd number bigger than 5 can be written as a sum of three prime numbers.

It should be noted however that there are many shortcomings to our work here. The keen-eyed reader may have noticed that at no point did we find a minimal $s$ for each $k$ (and often we massively overshot the minimum). It is also extremely difficult to specify what ‘sufficiently large’ actually means and even when we can the estimate is often in the region of $10^{10,000,000}$. Another drawback is that we are limited by how well we can estimate various integrals along the way, which is often not an easy thing to do. Thus the circle method stands as a warning to all despite popular perception, addition is hard!

post

Borwein integrals

The study of mathematics has long been steadfastly driven towards patterns. They seem to appear out of nowhere, and defy all sense and reason; we depend on the minds of curious thinkers to give them any logical backing at all. After all, human brains are designed to look for order and structure in our environments to predict what will come next. It gives us an edge over those that can’t. Stocking grain for winter becomes incredibly useful when you know that you cannot harvest wheat in December, and following herds is a lot easier when you know that they move up north for summer every year.

Mathematicians function in much the same way—we can’t deny that we do have biases towards pretty and unexpected results! Little mind is given to the patterns that don’t fit into our box of mathematical tricks, and we overlook what beauty they can hide in their spontaneity. Sometimes the patterns that break hold new secrets entirely, and show us new ways of viewing problems that may not have been apparent in the first place. But the last place we expect to see something like this is a normal looking integral.

That sinc-ing feeling

We can start with the sinc function across the real line, which is commonly used in signal analysis for signal reconstruction and frequency filtering.
$$
\operatorname{sinc}x=\frac{\sin(x)}{x}.
$$
We can use a nice trick to integrate sinc over the whole real line:
\[ \int_{-\infty}^\infty \operatorname{sinc}x \mathrm{d} x = \int_{-\infty}^\infty \frac{\sin(x)}{x} \mathrm{d}{x}.\]
Since both sine and $1/x$ are odd functions, multiplying them gives an even function that is symmetric across the $y$-axis. This means we can split our integral into two parts, which are both equal:

\begin{align*}
\int_{-\infty}^{\infty} \frac{\sin (x)}{x} \mathrm{d}{x} &=\int_{-\infty}^{0} \frac{\sin (x)}{x} \mathrm{d}{x}+\int_{0}^{\infty} \frac{\sin (x)}{x} \mathrm{d}{x}\\ &= 2\int_{0}^{\infty} \frac{\sin (x)}{x} \mathrm{d}{x}.
\end{align*}
This is a pretty well known integral, which we can evaluate to be $\pi/2$ using contour integration; so our whole integral comes out as $\pi$.

Continue reading

post

Ferm-ant’s principle

Here’s a standard(ish) calculus question, known as Fermat’s principle: what is the quickest way to get from one corner of a field to the opposite one, if one side has been mowed so you can move speedily across it, but the other side is growing wild and slowing you down?

If you set off straight towards the opposite corner, you’ll take the shortest path—but not necessarily the quickest one. The fastest path will involve travelling a bit further on the nice ground, and a bit less far on the overgrown side; it might look a bit like this:

problem setup

You could sit down and work it out (it’s not too tricky), using a bit of stationary point analysis. Or, you can get ants to solve it for you! Just put a colony of hungry ants in one corner of the field and some food on the other. The foragers will want to collect the food and bring it back as quickly as possible. Some researchers from Regensburg in Germany actually tried it out, and the ants found the quickest route between the two corners, taking into account the different speeds they can move on different surfaces. Thanks, ants. Thants.

quickest path

We can make the picture a bit more complicated: instead of the field being mown on one side and overgrown on the other, we could assign a different grass height to each point in space. (Mathematicians call this a… field.)

field

The ants will still want to take the fastest path from one side to the other, but now the calculus problem is starting to get complicated. It can help if we split the field up into sections, and draw a graph representing all the different routes the ants could take.

graph theory

Once we know how long it will take the ants to move along each edge, we just have to check all the routes and figure out which one is fastest.

Prob-ant-bility

Probability theorists like to ask a very similar question, but about random fields. Instead of fixed timings on each edge, they make each one random. Now that the shortest path is also random, it’s natural to wonder what the path is typically like: how long is it on average? Does it start by going upwards or rightwards? Is it mostly straight or very wiggly?

There are many types of grass, and so many different choices for the random amount of time it takes to cross an edge. You could choose your favourite distribution. For simplicity though, let’s say that the time is a uniformly random amount between one and two minutes.

If our graph is one-dimensional (in other words, a line), there’s only one possible route from left to right.

a line

When there are $n$ segments, the average time to get across the field is close to $n$ times the average length of time per segment—so $3n/2$. This is the law of large numbers.

prob-ant-bility

But when we have an $n \times n$ grid, we can definitely get from corner to corner in time $4n$, and it must take at least time $n$. We know that there exists a number $\alpha\in [1,4]$ such that the total time is very close to $\alpha n$, but unlike the one-dimensional case, no one knows what $\alpha$ is!

post

Poly-π

While reading William Dunham’s The Mathematical Universe, I came across this:

A novice, introduced to circles for the first time, would rather quickly recognise an essential fact: All circles have the same shape… We note by contrast that not all triangles have the same shape, nor all rectangles. Behind this unexciting observation lies one of the profound theorems in mathematics: that the ratio of the circumference to the diameter is the same for one circle as for any other.

What does Dunham mean by “all circles have the same shape”? We would all agree that this is true, regardless of a circle’s size, but more formally, we can say all circles are geometrically similar. And while this is obviously true for circles, it is equally true for equilateral triangles or squares. And it occurred to me that this “profound theorem” Dunham refers to is as true for these polygons as it is for the circle, provided we can define their diameters. This is easy for a certain subset of polygons: regular polygons! Just as $\pi$ represents the constant ratio of circumference to diameter for all circles of all sizes, regular polygons have an analogous constant, which I’ve named ‘polygon-$\pi$’, or ‘poly-$\pi$’ for short.

The triangle

Let’s start with the equilateral triangle. For consistency, I’ll define the triangle’s radius $r$ as the distance from the centre of the triangle to any vertex. Its diameter is then twice its radius.

For an equilateral triangle with sides of length $L_3$, the counterpart to the circle’s circumference is, of course, the triangle’s perimeter, $3L_3$. So, we can define the $\pi_3$ value for all equilateral triangles as \begin{equation*} \pi_3 = \frac{3L_3}{2r}, \end{equation*} where the subscript ‘3’ indicates the number of sides.

To find $L_3$ in terms of $r$, we can draw a line from the centre of the triangle to each vertex. This divides the equilateral triangle into three equal isosceles triangles with sides of length $r$ and three central angles of 120°.

An equilateral triangle split into three smaller isosceles triangles with the same vertices.

Dropping a perpendicular from the centre to any side divides $L_3$ and the central angle in half, creating a right-angled triangle and allowing us to observe the following relation:

\begin{equation*} \sin(60°) = \frac{L_3}{2r}. \end{equation*}

Replacing $L_3 / 2r$ with $\sin60°$ in the expression for $\pi_3$ gives us
\[\pi_3 = 3\sin(60°) \approx 2.598.\]
This value is the equilateral triangle’s poly-$\pi$ value! So, for any equilateral triangle, the ratio of the triangle’s perimeter to its ‘diameter’ equals $\pi_3$ or about $2.6$.

The square

Let’s now examine the square. Again, we define a radius $r$ as the length from the square’s centre to a vertex and the length of one side as $L_4$.

A square, subdivided into four isosceles triangles.

Now the ratio of the square’s ‘circumference’ to its ‘diameter’ can be written as
\begin{equation*} \pi_4 = \frac{4L_4}{2r}. \end{equation*} Note that the central angles in the square are 90° and the four radii divide the square into four isosceles triangles with base angles of 45°.

Again, dropping a perpendicular divides $L$ and a central angle so we can write
\begin{equation*} \sin(45°) = \frac{L_4}{2r}. \end{equation*} Substituting $\sin( 45° )$ for $L_4 / 2r$ in our expression for $\pi_4$, we get \[\pi_4 = 4\sin( 45° ) \approx 2.828.\] This is the square’s poly-$\pi$ value.

The hexagon

The poly-$\pi$ value for a hexagon turns out to be quite simple.

A hexagon, divided into six equilateral triangles.
Note that the inner angles are $360° / 6 = 60°$. The other angles in the six triangles of the hexagon are then also $60°$ and so we have six equilateral triangles. This then means that $r = L_6$. As a result,
\begin{equation*} \pi_6 = \frac{6L_6}{2r} = \frac{6L_6}{2L_6}, \end{equation*} and so \[\pi_6 = 3.\]

$n$-sided polygons

In each subsequent regular polygon we employ the same technique. That is, the $n$th poly-$\pi$ is given by
\begin{equation*} \pi_n = \frac{nL_n}{2r} = \frac{P_n}{2r}, \end{equation*} where $P_n$ is the perimeter.

A perpendicular drawn from the central angle $360°/n$ divides $L$ and the central angle such that
\begin{equation*} \sin\left(\frac{1}{2}\times \frac{360°}{n}\right) = \frac{L_n}{2r}, \end{equation*}
so that
\begin{equation} \pi_n = n\sin\left(\frac{180°}{n}\right). \tag{1} \label{eq:pin} \end{equation} This now is the poly-$\pi$ value for a regular polygon with $n$ sides. Note how the result does not depend on any physical characteristics of the polygon except the number of sides!

The table below displays the poly-$\pi$ for several polygons. The values have been rounded.

number of sides poly-$\pi$
3 2.608
4 2.828
5 2.939
6 3.000
7 3.037
8 3.061
9 3.078
10 3.090
100 3.14108
1000 3.141587

And here’s a plot of the poly-$\pi$s up to 10:

A graph, increasing quickly from x=2, y=2 towards y=pi as x gets larger

We can see (as we would expect) that as $n\to\infty$, $\pi_n → \pi = 3.14159\dots$

Using poly-$\pi$

When given the radius of a circle, we can calculate the circumference, and vice versa, because of the constant of proportionality between them expressed as $\pi$. This is also the case for a regular polygon because of the existence of its poly-$\pi$. So for a pentagon whose perimeter is, say, 15 we can find its radius (the distance from the centre of the pentagon to a vertex) by rearranging \eqref{eq:pin} to get \[r = \frac{P_5}{2\pi_5}.\] Using the table above we find that $\pi_5 = 2.94$, so \[r = \frac{15}{2(2.94)} \approx 2.55\] Unlike a circle, however, in addition to using poly-$\pi$s to calculate the perimeter or radius, we can also calculate the length of a polygon’s side. Using \eqref{eq:pin} and the value derived above for the radius, we get
\begin{align*} L_5 = \frac{2\pi_5r}{5} \approx \frac{2\times2.94\times2.55}{5} \approx 3.0, \end{align*} which is, of course, what we should get as the perimeter is 15 and the figure is a pentagon, so each side is $15/5=3$.

Poly-$\pi$ and area

The area of each $n$-sided polygon is given by the sum of the areas of the $n$ inscribed triangles. A perpendicular drawn from the central angle to a side ($L_n$, the triangle’s base) gives us the height of one of the inscribed triangles and can be written as \[r \cos\left( \frac{1}{2} \times \frac{360°}{n} \right) = r \cos\left(\frac{180°}{n}\right).\] So, for a regular $n$-sided polygon, its area is given by
\begin{equation*} A_n = n\left(\frac{1}{2}L_n\right)\left[r\cos\left(\frac{180°}{n}\right)\right] = \frac{nrL_n}{2}\cos\left(\frac{180°}{n}\right). \end{equation*} Solving \eqref{eq:pin} for $L_n$ we get
\begin{equation*} L_n = \frac{2\pi_n r}{n}. \end{equation*}

Combining these last two equations, we can write the area of an $n$-sided polygon in terms of $r$, its radius, as

\begin{equation} A_n = \pi_n r^2 \cos\left(\frac{180°}{n}\right). \tag{2} \label{eq:An2} \end{equation} Note how similar this equation is to the equation for the area of a circle! And, in fact, note that as $n\to\infty$, $180°/n \to 0$, and $\cos( 180°/ n ) \to 1$. Thus, we can state that for $n$-sided polygons, as the number of sides increases or as $n \to \infty$, $A_n → \pi r^2$.

We can also express the area in terms of the length of a side. Using \eqref{eq:pin} but this time solving for $r$, we get \[ r = \frac{n L_n}{2\pi_n}.\] Substituting this into \eqref{eq:An2}, we get
\begin{equation} A_n = \frac{1}{\pi_n}\left(\frac{nL_n}{2}\right)^2 \cos\left(\frac{180°}{n}\right). \tag{3} \label{eq:An3} \end{equation} Though not as elegant as \eqref{eq:An2}, it does allow us to determine the area of a regular polygon given the length of one side. Again we can consider what happens as $n\to\infty$. If we have a fixed side length $L$, our area formula becomes \[A_n=\frac{1}{\pi_n}n^2 \left(\frac{L}{2}\right)^2 \cos\left(\frac{180°}{n}\right).\] Now, we know $1/\pi_n →1/\pi$, and $\cos(180°/n) \to 1$ as before. Since we’re holding the side length constant, $(L/2)^2$ is just a constant. But $n^2$ certainly goes to infinity! In hindsight, this is obvious—if we keep the same side length, but add more and more sides then clearly the area must get larger and larger.

Using poly-$\pi$ to calculate the area of a regular polygon

Using \eqref{eq:An2} we can easily find the area of any regular polygon if we know its radius. So for a hexagon with a radius of 12, we can find its area as follows: \[ A_6 = \pi_6 r^2 \cos\left( \frac{180°}{6} \right).\] We know $\pi_6$ is exactly 3, so \[ A_6 = (3)(12)^2\cos\left(\frac{180°}{6}\right) = 432 \cos(30°).\] What is the length of a hexagon’s side given such an area? Solving \eqref{eq:An3} for $L_n$, we find

\begin{equation*} L_n = \frac{2}{n}\left(\sqrt{\frac{A_n \pi_n}{\cos(180°/n)}}\right). \end{equation*}

For the above hexagon, that is

\begin{align*} L_6 &= \frac{2}{6}\sqrt{432\times 3 \times \cos(30°)/\cos(30°)} \\ &= \frac{1}{3}\sqrt{1296} = 12. \end{align*} Although, we knew that from the start—given this is a hexagon, we already know that the radius and the length of a side are equal. Since we proposed a radius of length 12, the side ($L_6$) should also be of length 12.

Conclusion

A $\pi$-like value exists for regular polygons. It emerges naturally once we noticed that regular polygons at different scales have `the same shape’, just like circles. Given a measurement for a polygon, poly-$\pi$s make it easy to find others. For example, from the side length we can find the distance from its centre to any vertex (its radius); from the area we can find the perimeter.

Additionally, this concept might help people get a better idea of what $\pi$ really means. The special symbol and the `funny’ name of $\pi$ may create a mystique (not entirely undeserved) that can distract from its true meaning. Introducing poly-$\pi$s helps to clarify that $\pi$ is not a mysterious quantity exclusive to circles but rather a simple ratio—and such ratios appear in many different geometrical objects.

post

Treating the differential with discretion

The differential is an interesting beast in many respects. It is a map which has been, ironically, integral to the theory of calculus, and has the fascinating property that its square disappears. This is to do with the fact that its partial derivatives always commute, so that they happen to cancel each other out. Last summer I had a go at proving why this happens using a combinatorial version of an existing proof by Michèle Audin, Mihai Damian and Reinie Erné. The goal was to use the subtle force that is Morse theory (sadly no relation to the code of dots and dashes).

Morse theory is all about analysing the topology on a manifold by looking at how differentiable functions act on it. For instance, I can look at the height function on a torus, and see that we have a maximum and a minimum as well as two saddle points. We can see that the type of level sets of the height function changes at each critical point. By level set we just mean a slice where the height function is constant. Any function with this property is called a Morse function, and the rigidity of this constraint means that we get stronger statements about them. For instance, if a Morse function yields exactly two critical points on a manifold then the manifold is homeomorphic to a sphere.

A torus with the level sets of the height function marked, near the bottom of the torus the level sets are a circle, then between the saddle points the level sets are two circles, then finally between the upper saddle point and maximum, the level sets are a circle.

In the title I said we would treat the differential with discretion, by which I mean we translate our manifolds into the discrete setting. To do this we can make the manifolds be simplicial complexes. If you don’t know what a simplicial complex is, the name can look a bit intimidating but it is in reality just a graph, where each ‘vertex’ of the graph is a simplex. A simplex is just a fancy name for a triangle or one of its relatives in different dimensions. An $n$-simplex has $n+1$ vertices all connected to each other, so that a 0-simplex is a vertex, a 1-simplex is an edge, a 2-simplex is a triangle and a 3-simplex is a tetrahedron, and so on.

From left to right: a 0-simplex, 1-simplex, 2-simplex, and 3-simplex.

From left to right: a 0-simplex, 1-simplex, 2-simplex, and 3-simplex.

Doubling derivatives: it’s trivial, darling

You may now be staring at your Chalkdust magazine and asking aloud “What do you mean the square of the derivative vanishes‽ ” We are all familiar with computing the second derivative of a function—after all, how else would we analyse the nature of critical points. So, obviously, we cannot mean that taking the derivative twice always vanishes. Here when we say the square of the derivative we are referring to expressions more akin to those in vector calculus where we have identities like $\vec\nabla \cdot \left(\vec\nabla \times \vec{A}\right)=0$ and $\vec\nabla\times \left(\vec\nabla f\right)=\vec{0}$. That is, the divergence of a curl vanishes and the curl of a gradient vanishes. As anyone who has gone through the delight of a vector calculus course knows, both of these identities rely on the fact that partial derivatives commute: for $f(x,y)$,
\[\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y}\right)=\frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x}\right).\]

On the other hand, any differential geometers or algebraic topologists reading this will be saying “Of course taking the derivative twice vanishes, that is practically part of its definition.”

Simple simplices

A simplicial complex is a gluing together of some simplices. For instance, in the image we have a 3-simplex glued to a 2-simplex, which is glued to two 1-simplices, and a disconnected zero simplex.

If you’re wondering how a simplicial complex can represent a manifold, I can give you an example of the correspondence. A tetrahedron is the simplicial complex version of the sphere, where the discrete Morse function on the tetrahedron corresponds to the height function on the sphere, so that the critical maximum and minimum as we usually know them are represented by the 2-simplex at the top and the 0-simplex at the bottom. This is an example we will come back to in the next section.

So what do functions on these objects look like?

In general, we want it to feel natural to slide down dimension, for instance, from a triangle to one of the edges on its boundary, as in the triangle below. Here I’m saying boundary to mean `at the edge of the simplex’.

We slide down a dimension from a 2-simplex to
an edge on its boundary.

However, despite gravity, occasionally we might wish to jump up a dimension, for instance, from a boundary edge of a triangle to the triangle itself.

We jump up a dimension from a 1-simplex to a
triangle it lives on the boundary of.

We talk about orientations of simplices in everyday Morse discussions, which means defining an ordering on the vertices. On 1-simplices this is very intuitive as we are simply following the flow of the edge, like an arrow. On 2-simplices we take a circular route around the boundary of our triangle, and on 3-simplices we do a sort of `box-step’ dance between the vertices. Conventionally we label vertices by letters, $a, b, c$; edges by pairs of vertices, $ab, bc, ca$; and so on.

The Morse differential, as we will see, is the count of the signs of all the paths from an $(n+1)$-simplex to an $n$-simplex. In particular, if we take a 2-simplex $\alpha$ and drop down two dimensions to a vertex $\gamma$ on its boundary, there are two paths to do this, shown in blue and in pink.

In this diagram the 2-simplex is $\alpha= a bc$, while the vertex $\gamma$ is $a$.

As the direction of the blue path is the opposite of that of the pink, they have opposite signs, so that they cancel each other out. That is, the square of the Morse differential, found by dropping dimension twice, is 0.

A Morse function takes an $n$-simplex either up a dimension or down a dimension, and the rare instances of being able to jump up dimension we call Morse arrows. The distinguishing rule is that there can only ever be at most one Morse arrow associated to any simplex. If a simplex doesn’t have any Morse arrows belonging to it, we call it a critical simplex. I like to think that it is critical of all the other simplices jumping about and being rowdy.

Hasse diagrams

A Hasse diagram is a directed graph whose vertices represent the simplices in a simplicial complex and whose directed edges represent boundary maps from an $(n+1)$-simplex to an $n$-simplex in the simplicial complex. For our triangle $abc$ the vertices are the $2$-simplex $abc$, the three $1$-simplices $ab, bc, ca$, and the three $0$-simplices $a, b, c$. The directed edges show that $ab$, $bc$, $ca$ are parts of the boundary of $abc$.

A nice way of displaying the information of possible directed paths is a Hasse diagram.

Below, we have (top left) a simplicial complex consisting of a 2-simplex $abc$ and the simplices in its boundary. On the top right, we show the Hasse diagram, whose arrows correspond to boundary maps.

The Hasse diagram has only critical simplices, since none of the arrows point up. We can choose to make this slightly less trivial by changing the Morse function. This means reversing some of the arrows. Below, we see what effect this has on the simplicial complex, and on the right we see the modified Hasse diagram.

However, this is far too easy so let us glue two of these 2-simplices together and take an arbitrary Morse function on the resulting complex. This gives us the simplicial complex (bottom left) with modified Hasse diagram (bottom right) as shown.

Notice that this satisfies the rule that any individual simplex can only have one Morse arrow (highlighted in yellow) attached. Can you find the critical simplices in this Hasse diagram?

A directed path through a Hasse diagram between two critical simplices two dimensions apart is what we call a flowline, and forms the pivotal concept of this article. To see a flowline, let’s look at a tetrahedron.

We alluded to this earlier: a possible Morse function we can define on the tetrahedron is that representing the height function on a sphere; imagine something like this:

If the top 2-simplex $abc$ is a critical maximum (that is, a source simplex whose arrows all point away from it), and the 0-simplex $d$ is a critical minimum (that is, a target simplex whose arrows all point toward it), the tetrahedron has the Hasse diagram to the right, and here’s an example of a flowline:

You see, we can define an algorithm which changes a flowline bit by bit in a small way to become another flowline, seeking out a flowline with a particular property. You may notice that a flowline travels down and up a dimension almost in alternation, but to get to the level below it must drop down twice through an ‘intermediate simplex’. The intermediate simplex in this flowline, for instance, is the 1-simplex $ab$. We want flowlines whose intermediate simplices are critical. If the flowline has this property, we say it is a critical flowline.

The Hasse diagram for…

…a possible Morse function on two glued triangles

A tetrahedron…

…and the Hasse diagram where $abc$ is a critical maximum and $d$ is a critical minimum

Using this concept of flowline criticality, we define the square differential of a critical $(n+1)$-simplex $\alpha$ in Morse theory to be the signed count of critical flowlines to critical $(n-1)$-simplices. This counts all of the paths that have a critical $(n+1)$-, $n$- and $(n-1)$-simplex. If there are no critical $n$-simplices or $(n-1)$-simplices, then $\partial^2\alpha=0$ since there are no critical flowlines. But usually this is not the case, so we have to do a bit more to definitively prove our case.

So what are the actions we can perform on a flowline? Actually, there are three. We can ‘insert’ a Morse arrow to the intermediate simplex, like so:

In general, insert adds in two Morse arrows either above the intermediate simplex, or below the intermediate simplex, depending on where its Morse arrow is (if it has one at all).

The second action we can perform on a flowline is a `flop’. I showed you earlier that there are two ways down from the 2-simplex to a vertex on its boundary:

The two ways down a triangle.

The two ways down shown on a Hasse diagram

That is, if $ab$ is our intermediate simplex, we can find the other intermediate simplex $ac$ that is a boundary of $abc$ and has $a$ on its boundary. It’s worth noting that if we flop the pink flowline once we obtain the blue flowline, and if we flop the flowline again we will get back to the pink flowline. We can generalise this. If $\beta$ is our intermediate simplex, we can find the other intermediate simplex $\beta’$ that is a boundary of $\alpha$ and has $\gamma$ on its boundary (this $\beta’$ is unique), and flop to this other path, like so:

In general, this flop action is always possible, and self-inverse, since applying it twice gets you back to the same flowline.

The final action is cancel. We can ‘cancel’ out the Morse arrow at an intermediate simplex by removing the redundant path adjacent to the intermediate simplex like so:

In general, we can cancel whenever there is a backwards Morse arrow.

Setting boundaries: know the signs

It’s worth noting that cancel is inverse to insert, so if we devise an algorithm it doesn’t make any sense to apply one after the other. Similarly, going back to our 2-simplex example, we can see that applying flop twice will get us back to the same flowline, so it doesn’t make sense to ever apply two flops in a row.

Ultimately, the algorithm we find looks like this:

The algorithm in action

We sadly can’t apply the algorithm to a critical flowline through the two glued triangles we met earlier, because there aren’t any critical flowlines. In particular, the differential as we define it in discrete Morse theory can only be applied to a critical simplex. In this simplicial complex, since our ingredients are 0-, 1-, and 2-simplices, and if we are dropping two dimensions, we require the existence of a critical 2-simplex in our simplicial complex. One thing we can do, however, is change the Morse function we endow it with in order to remove one of the Morse arrows.

Now our simplicial complex has $abc$, $ac$ and $a$ as critical simplices. The astute reader may have noticed that I’ve highlighted critical simplices. This makes them easier to keep track of for the next step.

Let us start with the easiest critical flowline we can find:

Applying our algorithm to this critical flowline looks like this:

We can see from this that there are an odd number of floperations from start to finish, and that the critical flowlines travel through the simplicial complex in the following way:

The reason that the algorithm terminates at a critical flowline is because the only floperation we can apply to a critical flowline is flop, since there aren’t any Morse arrows to insert or cancel.

Notice that no matter how many times we cycle around each wing of the diagram, we’ll always have an odd number of actions in our algorithm. This is going to be important later when we look at the signs of a flowline. But the punchline of this algorithm is that it terminates at a critical flowline. Not only that, but when we apply the algorithm to a critical flowline, the algorithm is involutive. This means that applying it once to some critical $F’$ gives us a distinct critical flowline $F^{\prime\prime}$, and applying it twice gives us $F’$ again. It is possible to find a flowline through the simplicial complex which isn’t touched by this algorithm, but in this case when we apply the algorithm once and twice to this flowline, we will get a different pair of critical flowlines. In this way, we can partition all flowlines into equivalence classes.

Here, we note three details.

  • The algorithm starts with a flowline $F$, and every flowline the algorithm passes through is `equivalent’ to $F$.
  • The algorithm terminates when it arrives at a critical flowline.
  • There are either 2 or 0 critical flowlines in any given equivalence class.

A consequence of this is that every critical flowline belongs to one equivalence class and there is a unique distinct flowline that is also in that equivalence class.

Another aspect of flowlines that we have only briefly touched on is the concept of a ‘sign’. A flowline can be seen as positive or as negative, and each of the actions of flop, insert and cancel negates the sign of the flowline. We have talked a bit about why this happens for flop, but why do insert and cancel flip the sign of the flowline? Well, the sign of the flowline is calculated in terms of $(-1)$ to the power of half the number of arrows in the flowline. When we insert or cancel, we either increase or decrease the number of arrows by two, meaning that we change the power of $(-1)$ by $\pm 1$.

Applying the algorithm to $F$ gives $F’$…

…then applying the algorithm to $F’$ gives $F^{\prime\prime}$…

To see the space of flowlines, we could, for instance, have a flowline $F$, where applying the algorithm gives $F’$, giving a sequence of flowlines and applying it twice gives $F^{\prime\prime}$, with a possible algorithm step-by-step shown above. In particular, we pass through the same flowlines to get from $F^{\prime\prime}$ to $F’$ as we do to get from the $F’$ to $F^{\prime\prime}$. You may be able to see, now, why the algorithm is involutive.

Now, if $F$ has sign $+$ then we can find the sign of $F’$ and $F^{\prime\prime}$ by looking at the number of actions between them. In particular, we can see that since there is always an odd number of actions (starting with flop and ending with flop) between $F’$ and $F^{\prime\prime}$, they must have opposite signs.

Putting all this information together, we can find an expression for the squared differential in terms of flowlines through a simplicial complex. The squared differential of $\alpha$, some $(n+1)$-simplex, is the signed sum of flowlines $\alpha$ to $\beta$ times the number of flowlines $\beta$ to $\gamma$ for each critical simplex $\gamma$ and each critical $\beta$.

For example, if we imagine a system with one critical $\gamma$ and two critical flowlines $F’$ and $F\prime\prime$ through the system, then
\[\partial^2\alpha=\hspace{-3mm}\sum_{\substack{\text{critical}\\\text{flowlines }F}}\hspace{-3mm} \operatorname{sign}(F)=\operatorname{sign}(F’)+\operatorname{sign}(F^{\prime\prime}).\]
But since $F’$ and $F^{\prime\prime}$ are the only two critical flowlines, they belong to the same equivalence class, and therefore are related by an odd number of operations so that $\operatorname{sign}(F’)=-\operatorname{sign}(F^{\prime\prime})$. Then $\partial^2\alpha=0$.

In general, as critical flowlines come in these pairs, everything reduces to this case, so that $\partial^2\alpha=0$ in any simplicial complex. This is a very satisfying way to see a proof of this geometric identity. In the smooth case, we have better contact with the manifolds themselves, but it’s not so easy to actually compute things. When we see what surfaces look like in this combinatorial abstraction of the problem, we pinpoint the aspects of the space we really care about. And, as we have seen, by abstracting the problem to this discrete analogue, everything cancels out so nicely. So if you’re ever feeling down, just remember that you can always abstract your problems. Discrete mathematics really does come through.