Intergalactic population dynamicist Thanos starts 2018 superhero epic *Infinity War* with a clear goal: he wants to wipe out half of every population in the universe. His planet, Titan, underwent a terrible disaster because of outgrowing limited resources. He sees himself as the saviour of the peoples of the universe because by shrinking all populations by 50%, he can save them from the same fate. Like a good film protagonist, he faces obstacles and people who want to stop him on his quest, in the form of the Avengers and others, but ultimately, with his last ounce of energy, he achieves his goal. Snap.

What effect would that have?

A basic model of population growth is simply to consider that the rate of increase of population with respect to time, \(t\), is proportional to the current number in the population, \(N\). The more members of a population, the more babies. Simple. That is,

\[ \frac{\mathrm{d}N}{\mathrm{d}t} ~~\propto~~ N \text{.} \]

This is a very simple model because it just allows growth to continue unchecked without any restrictions caused by lack of resources or other limits. Adaptions can be made to the model to account for limited resources. Thanos, though, seems to think population growth will continue regardless of resources until terrible disaster strikes, so let’s make the same assumption.

The above proportional relationship can be expressed as an Ordinary Differential Equation (ODE):

\[ \frac{\mathrm{d}N}{\mathrm{d}t} = rN \text{,} \]

where \(r\) is the growth rate. If we let the population at time \(t=0\) be \(N_0\), then we can solve this equation to give

\[ N = N_0 e^{rt} \text{.} \]

Given a particular population’s \(N_0\) and \(r\), we can make predictions about population growth. Let’s try an example.

Say a population contains a million people in year 0. Then if we measure populations in millions we can set \(N_0=1\) so

\[ N = e^{rt} \text{.} \]

Say our unsustainable and unrestrained population has grown to 1.5 million in year \(t=5\). Then we can say

\[

\begin{align*}

1.5 &= e^{5r}\\

\ln(1.5) &= 5r\\

r &= \frac{\ln(1.5)}{5} \approx 0.081\text{.}

\end{align*}

\]

Now we have values for \(N_0\) and \(r\), we can make predictions about the growth of our population.

Let’s see what happens to the population after 100 years.

\[ N = e^{100 \ln(1.5) / 5} \approx 3325 \text{,}\]

that is, about 3.3 billion.

Instead, let’s say Thanos’s snap came in year 50. At this point, the population was

\[ N = e^{50 \ln(1.5) / 5} \approx 58 \text{,}\]

and so the snap would set up a new equation from that point with a new \(N_0=29\) (now considering year 50 to be \(t=0\)):

\[ N = 29 e^{t \ln(1.5) / 5} \text{.}\]

Now, thanks to Thanos’s saving grace, the population wouldn’t reach the horribly unsustainable level of 3.3 billion until:

\[ \begin{align*} 3325 &= 29 e^{t\ln(1.5) / 5}\\ \frac{3325}{29} &= e^{t\ln(1.5) / 5}\\ \frac{5}{\ln{1.5}} \ln\left(\frac{3325}{29}\right) &= t \approx 58.475 \text{,} \end{align*} \]

that is, sometime in the 108th year. If 3.3 billion was an unsustainable level, Thanos can sit down to rest at the end of Infinity War safe in the knowledge he has given our population a little over eight years respite.

Populations are not always as simple as all that, even if we don’t consider most of the necessary resources. Some populations interact with each other as predator and prey. If the prey population falls, there is less food for the predators and the predator population falls. With fewer predators around, the prey population has the opportunity to recover. As the prey population grows, so too does the food supply for the predators. And the cycle continues.

A simple model that exposes this dynamic is the Lotka-Volterra system of equations:

\[ \begin{align*} \frac{\mathrm{d}x}{\mathrm{d}t} &= \alpha x – \beta xy \text{;}\\ \frac{\mathrm{d}y}{\mathrm{d}t} &= \delta\beta xy – \gamma y \text{,} \end{align*} \]

where \(x\) is the prey population, \(y\) is the predator population, \(t\) is time and \(\alpha\), \(\beta\), \(\gamma\) and \(\delta\) are parameters encoding interactions between the populations.

Following a tutorial, it is possible to solve these equations numerically in Python. Say \(\alpha=1\), \(\beta=0.1\), \(\gamma=1.5\) and \(\delta=0.75\). Set the initial prey population to 20 and the initial predators to 6. Then the population levels grow and decline in a regular cycle.

The question, then, is what effect Thanos’s snap would have on this dynamic? Say at \(t=14\) the snap occurs. Both populations are halved, so what does the graph look like after this point?

Immediately after the snap, with a sudden decrease in prey as the predator population was already in the decline part of the cycle, the predator population declines quite seriously. With a reduction in predators, the prey population grows to an unprecedented size. With such an abundance of prey, the predator population grows also much bigger than before. This large number of predators causes a severe decline in prey, and a new cycle has been entered.

The new dynamic caused by the snap has both populations growing larger than before and declining lower, meaning this new dynamic is substantially different to what came before. The model doesn’t take external effects into account, but possibly this quite different dynamic might have other consequences in the environment or on other populations. Another factor not taken into account by the model is extinction. It is possible that the new low achieved by the predator population in the time following the snap might cause such a decline that the population can’t recover (the model doesn’t allow for this). Either way, it does not seem likely that this new population dynamic is more sustainable than what came before.

It’s a few years since the snap. Some populations have already grown back to the levels they were at before, and others have suffered catastrophic collapse. Thanos realises his error and uses the Time Stone to undo the snap, enrolling in a university course on sustainable development instead. Runtime: 5 minutes.

One day, a couple of months ago, I was walking my son to nursery and he asked what I was doing that day. I said I was going to do some teaching. What about? he asked. Well.

I’m a university mathematics lecturer. He’s a three-year-old. He knows about counting, but not what maths is. This could be a problem. But I was in luck – that day I was teaching on our new module Game Theory and Recreational Mathematics. Specifically, I was introducing combinatorial game theory. I told him my teaching that day was about playing games. He was very excited, and figured he might do a bit of that at nursery as well. (There’s something here about the role of play in education, and how we lose this as we go along, but that’s another story.)

Since then, he’s asked now and then. But this week, he has taken a particular interest in what I’m teaching. Could I explain all this week’s teaching in a way he will understand? As an intellectual game, this is a bit of fun, and it interests me as an exercise in communication – can I explain what I do to a three-year-old, even if only in a superficial way?

- Monday: “I helped my friend Hannah teach about the weather. Have you noticed that it’s getting dark later in the evening? A few weeks ago, it was dark and we could see stars on the way home from nursery. Now, it’s starting to get dark but the sky is still blue” [first year mathematical modelling, fitting trig models to various weather data from the Met Office, leading with a worked example on hours of daylight.]
- Tuesday: “about aeroplanes. It’s about people getting off aeroplanes as quickly as they can” [second year mathematical modelling. A cellular automata-type model for aircraft evacuation].
- Wednesday: no teaching.
- Thursday: “about computers” [second year mathematics students programming module]. He was a bit disappointed with this, and complained “that’s what you told me the other week”, but it was a review of the module ahead of students starting individual programming projects next week, so hard to be specific!
- Friday: “I helped my friend Alex teach about a game and juggling” [Tantrix tiles lead to necklace numbers lead to siteswap juggling moves, via graph colouring and various counting techniques.] He’s fascinated by juggling and asked me various questions about this. He wants me to teach him how to juggle so we can be “like clowns”.

How much does he really understand about what I do? Not much, I guess. But he seems excited to hear about it and I hope he has a positive association with what daddy does as a result.

]]>This weekend, he asked me to help him learn it. I’ve tried to memorise it before, to save having to find the book when he wants me to recite it. But somehow, it’s never quite stuck. I can remember all the bits and the basic order (Cows-Trees-Mice), and know what happens after the lines ending “Nong” (“Cows go bong”), “Ning” (“Trees go ping”) and “Nang” (“Mice go clang”). What I struggle with is remembering which order the “Ning”, “Nang” and “Nong” go before the one that rhymes with what comes next.

At the weekend, I wrote “Ning”, “Nang” and “Nong” on pieces of paper and we rearranged them as we read the poem. I realised my difficulty is a mathematician pattern-spotting one. There’s a not-quite Latin square embedded in the poem.

There are six permutations of the words “Ning”, “Nang” and “Nong”.

- Ning Nang Nong
- Ning Nong Nang
- Nang Nong Ning
- Nang Ning Nong
- Nong Ning Nang
- Nong Nang Ning

The poem uses three of these (1, 5 and 6 in the list above). I think my problem is that although all possible endings are used, the same is not true of the starting positions. This is why I struggle to remember whether it is the one that rhymes with “Trees go ping” or the one that rhymes with “Mice go clang” that starts “Nong”. I’m expecting variety, but actually both start with “Nong”.

That is to say, the choice of three permutations doesn’t form a Latin square. And it could. Here is a Ning Nang Nong Latin square:

Ning | Nang | Nong |

Nang | Nong | Ning |

Nong | Ning | Nang |

I think I would find the poem more pleasing, and easier to remember, if this structure were embedded. Still, realising this is my problem seems to have helped – I can now remember which lines go in which order.

My son has adapted the final line of the poem. It goes “What a noisy place to belong, is the Ning Nang Ning Nang Nong”. He then shouts “And here!”

With all this Ninging, Nanging and Nonging, he’s not wrong.

Pringles ran a Super Bowl advert. In case you’re looking for ways to give Pringles more money, apparently you can buy several tubes of Pringles and mix the flavours. (Pringles are a type of food. Super Bowl is a kind of sport. None of that matters, what matters is…) The advert shows a man stacking three Pringles together and claims there are 318,000 possibilities.

Lucy (@honeypisquared) alerted me to this claim and some tweets by @bobloch trying to calculate the number. Bob noticed that the Pringles website has an interactive function to pointlessly simulate the stacking. This insists on precisely three Pringles being stacked together and allows a choice of 18 flavours (on a computer) or 17 flavours (mobile version, as far as I can tell). The website allows repetition (you can choose the same flavour multiple times). If there are 17 options per slot and three slots to fill, this means there are \( 17^3 = 4913 \) possibilities. If there are 18 flavours, this increases to \( 18^3 = 5832 \). Neither are anywhere near big enough.

So where does 318,000 come from? @jjc578 asked Pringles directly. Here’s their response.

So this says there are 25 flavours (weirdly, given how many the website shows) and we are allowed 2, 3 or 4 in a stack (weirdly, given the website insists on 3 only). The comments about not counting different orderings of the same Pringles suggests we are after combinations. Then the number of ways of choosing 2, 3 or 4 from 25 is:

\[ \binom{25}{2}+\binom{25}{3}+\binom{25}{4}=15250 \text{.} \]

Still not big enough.

Then @DavidKButlerUoA worked it out. If we are arranging 2, 3 or 4 Pringles in a stack, chosen without repetition from 25 where order *does* matter, then we use permutations rather than combinations and get this calculation:

\[ \frac{25!}{(25-2)!}+\frac{25!}{(25-3)!}+\frac{25!}{(25-4)!}=318000 \text{.} \]

That’s our magic number! It doesn’t match the Pringles advert, website or Twitter reply, but it’s nice that it does align to some piece of correct maths!

I made this. Here’s how…

Rob Eastaway tweeted a little curiosity he had been given by Tim Rowett – an equation that works as an equation when rotated 180°.

To make this isn’t completely trivial. It seems clear that $x$, $1$ and $8$ have rotational symmetry, such that they work either way up (you may have to draw an unusually symmetric $8$). The same is true of $+$, $-$, implicit multiplication and the horizontal line in a fraction. It is also clear that some numbers have no rotational symmetry and so cannot be used. A $2$, $3$, $4$ or $7$, no matter how you draw it, won’t look like anything useful when rotated. If you draw them right, a $6$ and a $9$ can be rotations of each other. This leaves $5$. As far as I am concerned, if you draw it in a certain way it is recognisable when rotated (as in the tweet at the top of this post).

You also have to consider the order of operations and ensure this makes sense both ways up. For example, you can’t start one side of the equation like $-1+\ldots$, because when rotated this would look like the nonsensical $\ldots+1-$. By careful use of symbols, you can make equations that are valid and soluble when rotated.

So far, so curious. But Rob posed an interesting question: does a similar equation exist that has the *same* solution both ways?

I realised that the arrangement of fractions in the equation Tim gave Rob were leading to one solution one way up and two solutions the other way up, meaning there was no possibility of a complete match. So I wondered if it might be possible to find a set of four constants with appropriate values for which one solution matched.

That is, we want equations of the form

\[ \frac{x}{a}=b-\frac{c-x}{d}\text{.} \]

with $a,b,c,d \in \{1,5,6,8,9\}$, for which one solution of the rotated equation matches the solution of the non-rotated equation.

Say the rotated form is

\[ \frac{e}{x-f}-g=\frac{h}{x}\text{.} \]

Such that $d$ rotates to give $e$ using the following mapping:

\[\begin{align*} 1 &\to 1;\\ 5 &\to 5;\\ 6 &\to 9;\\ 8 &\to 8;\\ 9 &\to 9. \end{align*} \]

And $c$, $b$ and $a$ map to $f$, $g$ and $h$, respectively, using the same mapping.

First, we solve the non-rotated version of the equation in general form:

\[ \begin{align*} \frac{x}{a} &= b-\frac{c-x}{d}\\ \frac{x}{a} – \frac{x}{d} &= b-\frac{c}{d}\\ x \frac{d-a}{da} &= \frac{bd-c}{d}\\ x &= \frac{abd-ac}{d-a}\text{.} \end{align*} \]

Then we solve the rotated version:

\[ \begin{align*} \frac{e}{x-f}-g&=\frac{h}{x}\\ ex – gx(x-f) &= h(x-f)\\ 0 &= gx^2 + (h-e-fg)x – hf \end{align*} \]

So, applying the quadratic formula,

\[ x = \frac{(fg+e-h) \pm \sqrt{(h-e-fg)^2 + 4fgh}}{2g}\text{.} \]

I wrote a little Python 3 program to exhaustively search, testing each of the possible values of $a$, $b$, $c$ and $d$ to see if we had a match.

Here is my `rotate(n)`

function, which take a number `n`

and returns its rotated version.

def rotate(n): if n==1 or n==5 or n==8: return n elif n==6: return 9 elif n==9: return 6 else: raise ValueError("Input should be 1, 5, 6, 8 or 9")

And here is the code for running the search. It uses SciPy for the square root to deal with any potential complex numbers.

import scipy as sp candidatevalues = (1,5,6,8,9) for a in candidatevalues: for b in candidatevalues: for c in candidatevalues: for d in candidatevalues: if d!=a and a!=1 and d!=1: # mustn't divide by zero! Also a and d !=1 so not trivially reducible e = rotate(d) f = rotate(c) g = rotate(b) h = rotate(a) x1 = (a*b*d - a*c) / (d-a) # solution a,b,c,d x2 = ( (f*g+e-h) + sp.sqrt( (h-e-f*g)**2 + 4*f*g*h ) )/(2*g) # +ve solution e,f,g,h x3 = ( (f*g+e-h) - sp.sqrt( (h-e-f*g)**2 + 4*f*g*h ) )/(2*g) # -ve solution e,f,g,h if x1==x2 or x1==x3: print(a,b,c,d," / ",e,f,g,h," / ",x1,x2,x3)

This method found three solutions.

I figure you could set up a neat trick where you say “solve this equation” (the $a$, $b$, $c$, $d$ version), “then rotate the equation 180° and input your value for $x$”. Because the solution to the non-rotated equation is one of the solutions to the rotated one, the player would find their answer works both ways up. Astonishment, fame and riches naturally follow!

But it isn’t completely satisfying, is it?

Playing around on paper, I came up with an equation format that would yield two solutions in either case and ran a similar piece of code. This found eight non-trivial equations that had the same pair of solutions either way. Really, this is four pairs of equations, where each pair are a trivial rearrangement of the each other.

Non-rotated | Rotated | Solutions |
---|---|---|

$\frac{x-1}{6}=\frac{9}{5-x}$ | $\frac{x-5}{6}=\frac{9}{1-x}$ | $x=3 \pm 5\mathrm{i}\sqrt{2}$ |

$\frac{x-1}{9}=\frac{6}{5-x}$ | $\frac{x-5}{9}=\frac{6}{1-x}$ | $x = 3 \pm 5\mathrm{i}\sqrt{2}$ |

$\frac{x-1}{6}=\frac{9}{8-x}$ | $\frac{x-8}{6}=\frac{9}{1-x}$ | $x = \frac{9\pm\mathrm{i}\sqrt{167}}{2}$ |

$\frac{x-1}{9}=\frac{6}{8-x}$ | $\frac{x-8}{9}=\frac{6}{1-x}$ | $x = \frac{9\pm\mathrm{i}\sqrt{167}}{2}$ |

$\frac{x-5}{6}=\frac{9}{8-x}$ | $\frac{x-8}{6}=\frac{9}{5-x}$ | $x = \frac{13 \pm 3\mathrm{i}\sqrt{23}}{2}$ |

$\frac{x-5}{9}=\frac{6}{8-x}$ | $\frac{x-8}{9}=\frac{6}{5-x}$ | $x = \frac{13 \pm 3\mathrm{i}\sqrt{23}}{2}$ |

$\frac{x-6}{5}=\frac{8}{9-x}$ | $\frac{x-6}{8}=\frac{5}{9-x}$ | $x = \frac{15 \pm \mathrm{i}\sqrt{151}}{2}$ |

$\frac{x-9}{5}=\frac{8}{6-x}$ | $\frac{x-9}{8}=\frac{5}{6-x}$ | $x = \frac{15 \pm \mathrm{i}\sqrt{151}}{2}$ |

So far, so good, but the solutions were all complex. In some ways, complex number solutions are fine. But, really, it’d be nicer and more accessible as a trick to have real solutions.

Finally, I did a bit of tweaking to try to increase the chances the discriminant was positive, essentially by changing the minuses to pluses, and found some with real solutions.

Non-rotated | Rotated | Solutions (2 d.p.) |
---|---|---|

$\frac{x+1}{6}=\frac{9}{5+x}$ | $\frac{x+5}{6}=\frac{9}{1+x}$ | $4.62,-10.62$ |

$\frac{x+1}{9}=\frac{6}{5+x}$ | $\frac{x+5}{9}=\frac{6}{1+x}$ | $4.62,-10.62$ |

$\frac{x+1}{6}=\frac{9}{8+x}$ | $\frac{x+8}{6}=\frac{9}{1+x}$ | $3.64,-12.64$ |

$\frac{x+1}{9}=\frac{6}{8+x}$ | $\frac{x+8}{9}=\frac{6}{1+x}$ | $3.64,-12.64$ |

$\frac{x+5}{6}=\frac{9}{8+x}$ | $\frac{x+8}{6}=\frac{9}{5+x}$ | $1,-14$ |

$\frac{x+5}{9}=\frac{6}{8+x}$ | $\frac{x+8}{9}=\frac{6}{5+x}$ | $1,-14$ |

$\frac{x+6}{5}=\frac{8}{9+x}$ | $\frac{x+6}{8}=\frac{5}{9+x}$ | $-1,-14$ |

$\frac{x+9}{5}=\frac{8}{6+x}$ | $\frac{x+9}{8}=\frac{5}{6+x}$ | $-1,-14$ |

From these, I picked one with integer solutions which I found fairly pleasing symmetrically, and tweeted it.

I’m sure there will be other equation formats out there that yield solutions with this property, but that’ll do for me. Here’s the full code that found the eight real solutions.

# non-rotated: (x+a)/b = c/(d+x) # rotated: (x+e)/f = g/(h+x) import scipy as sp def rotate(n): if n==1 or n==5 or n==8: return n elif n==6: return 9 elif n==9: return 6 else: raise ValueError("Number should be 1, 5, 6, 8 or 9") candidatevalues = (1,5,6,8,9) for a in candidatevalues: for b in candidatevalues: for c in candidatevalues: for d in candidatevalues: e = rotate(d) f = rotate(c) g = rotate(b) h = rotate(a) if (not (a==h and b==g and c==f and d==e)) and (not (a==e and b==f and c==g and d==h)) and b!=1 and c!=1: # only test cases that aren't boring and b and c !=1 so not reducible x1 = (-(d+a) + sp.sqrt((d+a)**2 - 4*(a*d-b*c)))/2 # a,b,c,d +ve x2 = (-(d+a) - sp.sqrt((d+a)**2 - 4*(a*d-b*c)))/2 # a,b,c,d -ve x3 = (-(h+e) + sp.sqrt((h+e)**2 - 4*(e*h-f*g)))/2 # e,f,g,h +ve x4 = (-(h+e) - sp.sqrt((h+e)**2 - 4*(e*h-g*f)))/2 # e,f,g,h -ve if (x1==x3 and x2==x4) or (x1==x4 and x2==x3): print(a,b,c,d," / ",e,f,g,h,"/",x1,x2)

This is not unrelated to what I submitted as my entry to The Big Internet Math-Off last summer. I have been revisiting this idea ready for a class next week in my second year programming module.

I have this idea that I am trying to teach my students to program, rather than to write code in a particular language, so I am bullish about throwing them into a different syntax and allowing them to flex their programming muscles. With this in mind, I intend to spend a brief period drawing graphics using TikZ.

My eye was drawn to this picture from the Aperiodvent day 7 entry (which is from this 2015 post by Vicky Neale on Alex Bellos’ Guardian Blog):

I decided to try to recreate these images using TikZ. First, the images. I’m sure the colours could be made prettier, but here is what I got. Click to enlarge.

And now the code. I’m sure it, too, could be made prettier, but it works.

\documentclass[oneside]{article} \usepackage[a4paper,margin=10mm]{geometry} \usepackage{tikz} \begin{document} \pagestyle{empty} ~\vspace{25mm} \begin{center} \begin{tikzpicture} \draw [green, ultra thick] (0,0)--(0,-2); \foreach \i in {0,...,9} { \draw [green, ultra thick] (9-\i,0) -- (0,\i) -- (\i-9,0); } \foreach \i in {0,...,7} { \draw [green, ultra thick] (7-\i,7) -- (0,\i+7) -- (\i-7,7); } \foreach \i in {0,...,5} { \draw [green, ultra thick] (5-\i,12) -- (0,\i+12) -- (\i-5,12); } \draw [red,fill=red] (2,13) circle [radius=0.3]; \draw [yellow,fill=yellow] (-1,13.5) circle [radius=0.3]; \draw [red,fill=red] (-1,9.5) circle [radius=0.3]; \draw [yellow,fill=yellow] (1,9) circle [radius=0.3]; \draw [green,fill=green] (1,8) circle [radius=0.3]; \draw [red,fill=red] (0.8,7) circle [radius=0.3]; \draw [lightgray,fill=lightgray] (-3,7.5) circle [radius=0.3]; \draw [lightgray,fill=lightgray] (1.7,2.7) circle [radius=0.3]; \draw [red,fill=red] (1.2,1.2) circle [radius=0.3]; \draw [yellow,fill=yellow] (-2,1) circle [radius=0.3]; \draw [yellow,fill=yellow] (-2.5,1.5) circle [radius=0.3]; \draw [green,fill=green] (-5,0) circle [radius=0.3]; \end{tikzpicture} \end{center} \newpage ~\vspace{10mm} \begin{center} \begin{tikzpicture}[xscale=0.8,yscale=1.2] \draw [blue,fill=blue] (-11,-10) rectangle (11,10); \foreach \i in {0,...,9} { \draw [yellow, ultra thick] (9-\i,0) -- (0,\i) -- (\i-9,0); \draw [yellow, ultra thick] (9-\i,0) -- (0,-\i) -- (\i-9,0); } \foreach \i in {0,0.2,...,1} { \draw [yellow] (1-\i+9,4) -- (9,\i+4) -- (\i-1+9,4); \draw [yellow] (1-\i+9,4) -- (9,-\i+4) -- (\i-1+9,4); } \foreach \i in {0,0.2,...,1} { \draw [yellow] (1-\i-7,7) -- (-7,\i+7) -- (\i-1-7,7); \draw [yellow] (1-\i-7,7) -- (-7,-\i+7) -- (\i-1-7,7); } \foreach \i in {0,0.2,...,1} { \draw [yellow] (1-\i-8.5,-3) -- (-8.5,\i-3) -- (\i-1-8.5,-3); \draw [yellow] (1-\i-8.5,-3) -- (-8.5,-\i-3) -- (\i-1-8.5,-3); } \foreach \i in {0,0.2,...,1} { \draw [yellow] (1-\i-3,-8) -- (-3,\i-8) -- (\i-1-3,-8); \draw [yellow] (1-\i-3,-8) -- (-3,-\i-8) -- (\i-1-3,-8); } \foreach \i in {0,0.2,...,1} { \draw [yellow] (1-\i+5,-5) -- (+5,\i-5) -- (\i-1+5,-5); \draw [yellow] (1-\i+5,-5) -- (+5,-\i-5) -- (\i-1+5,-5); } \end{tikzpicture} \end{center} \newpage ~\vspace{10mm} \begin{center} \begin{tikzpicture}[scale=1.5] \foreach \i in {0,...,35} { \pgfmathparse{(mod(\i+7,36))*10} \node at (\pgfmathresult:5) (A\i) {}; \pgfmathparse{\i*10} \node at (\pgfmathresult:5) (B\i) {}; \draw [red, ultra thick] (A\i.center)--(B\i.center); } \draw [teal, line width=12] (-1,3) .. controls (1,8) .. (0.3,8.5); \draw [teal, line width=12] (1,3) .. controls (-1,8) .. (0.3,8.5); \draw [teal, fill=teal] (0.3,8.5) circle [radius=0.3]; \end{tikzpicture} \end{center} \end{document}]]>

The result is a command `\stargraph`

, which takes two parameters, the number of radial nodes and the radius in cm of the graph. Here is the definition of `\stargraph`

and its use in a document.

\documentclass{article} \usepackage{tikz} \newcommand{\stargraph}[2]{\begin{tikzpicture} \node[circle,fill=black] at (360:0mm) (center) {}; \foreach \n in {1,...,#1}{ \node[circle,fill=black] at ({\n*360/#1}:#2cm) (n\n) {}; \draw (center)--(n\n); \node at (0,-#2*1.5) {$K_{1,#1}$}; % delete line to remove label } \end{tikzpicture}} \begin{document} \begin{center} \stargraph{7}{2} % usage: \stargraph{number of radial nodes>0}{radius in cm} \end{center} \end{document}

Here is the result of making this document:

]]>So it was that I realised I could enter some Babylonian-style tablets made from gingerbread.

I made a gingerbread reconstruction of a particular tablet, YBC 7289, which Bill Casselman calls “one of the very oldest mathematical diagrams extant“. Bill writes about the notation on the tablet and explains how it shows an approximation for the square root of two. I’m sure I didn’t copy the notation well, because I am just copying marks rather than understanding what I’m writing. I also tried to copy the lines and damage to the tablet. Anyway, here is my effort:

In addition, I used the rest of the dough to make some cuneiform biscuits. I tried to copy characters from Plimpton 322, a Babylonian tablet thought to contain a list of Pythagorean triples. Again, Bill Casselman has some interesting information on Plimpton 322.

Below, I try to give a description of my method.

I tried the recipe given but I don’t know if I mistranslated the American cups measurements, but it came out too dry, so I adjusted the ingredients and tried again before making it the third time for real. Below is a description of what I did.

The idea here is to make a gingerbread that tastes good but crucially has the stiffness to take the cuneiform writing and that doesn’t rise much so the writing stays in place while it cooks. There’s a lot of chilling to harden the dough. I should mention that you make the dough one day and cook it the next.

Ingredients:

- 500g plain white flour;
- 110g soft brown sugar;
- 160g butter;
- 145g treacle;
- 1 medium egg;
- 1 teaspoon bicarbonate of soda;
- 2 teaspoons ground ginger powder;
- half teaspoon cinnamon;
- half teaspoon nutmeg;
- half teaspoon salt.

Method:

Day one, mix the dough.

- Weigh the butter and cut up into lumps, leave on a plate to warm up for at least 20 minutes.
- Mix the dry ingredients in a bowl.
- Add the butter and mix up.
- Add the treacle and egg and mix well. I used a food processor. It made a stiff dough.
- Compress into a bowl, cover with cling film and put in the fridge overnight.

Day two, make the gingerbread.

- Roll out the dough. I made a big tablet and a set of little biscuits. I put a tea towel on the side with greaseproof paper on top, and rolled on this using a rolling pin and some flour. The dough is quite happy to be pushed around and cut up.
- Put the rolled out dough on greaseproof paper on baking sheets and put it in the fridge for half an hour to re-stiffen.
- Cuneiform writing using a square handle of a chopstick. The linked blog post has a lot on this, including a nice video demonstration of the technique. I bought some cheap chopsticks online, and while the handles were square, they were a bit too rounded. This meant the impressions made in the gingerbread were not very clear, especially after baking. My parents had a sharper-handled chopstick and I was able to use this for the real thing. So it is important to get the right tool. I also used a blunt knife for making lines and a teaspoon for scraping out sections of the tablet I was copying that were broken.

- After scribing, refrigerate again while heating up the oven.

- I cooked mine at gas mark 4 for 10 minutes (biscuits) or 12 minutes (large tablet). Our oven is a bit quirky, though, so you might want to experiment. The first go I over-cooked them a little.

Probably by now you are firmly of the view that I am not a recipe writer! There is a lot more detail in the original blog post and I recommend reading this and watching the short video before starting.

I am grateful to Farrell Monaco for sharing her cuneiform gingerbread recipe, and to Bill Casselman for his pages on Babylonian mathematics tablets.

]]>Bernard Bolzano (1781 – 1848) worked to "free calculus from the concept of the infinitesimal" and was born on 5 Oct http://bit.ly/9TV331

— Maths History (@mathshistory) October 5, 2010

That autumn, I looked into the Twitter API and wrote myself a program that would run every day and tweet these little titbits. I loaded some messages into a database and scheduled a daily tweet at 10:23am starting from 16th December 2010.

Johann Radon (1887-1956) worked on the calculus of variations, differential geometry & measure theory & was born 16 Dec http://bit.ly/eAQlSK

— Maths History (@mathshistory) December 16, 2010

Over the months that followed, I slowly built up a database of daily tweets, sometimes managing to get a few weeks ahead of the present, and sometimes missing days and filling them in the following year. Sometime in 2011 or 2012, I had a full year’s tweets in the database. Since then, I have been tweaking. Sometimes someone sends in an error and I make a correction. I’ve also swapped all the URLs from bit.ly (necessary in 2010 to fit the message in a tweet) to the full address. But, generally speaking, the script has pushed a daily mathematician onto the feed every day since then without interference.

Generally speaking, this has had some success. The account currently has about 65k followers. Twitter’s statistics system regularly records 10,000 ‘impressions’ per tweet (which Twitter defines as “Times a user is served a Tweet in timeline or search results”), several times that for a big name. (Though I tried to set up the database to promote less-well-known names and areas, of course the big names cause most interest.)

There is more to history than marking dates and reading biographies, but as an exercise in raising some awareness of history of mathematics, I think it is going pretty well.

And today I sent my last @mathshistory daily mathematician tweet.

Michael Mästlin (1550-1631) Kepler's teacher, publicised the Copernican system, born 30 Sep https://t.co/DVTY0o9Oev

— Maths History (@mathshistory) September 30, 2018

Since BSHM got themselves a web server a little while ago, we have been chatting about moving the daily tweets over to it. I remain a member of BSHM, but I finished my term on Council in 2013. I think it does the Society a lot of good to have full control over its Twitter account and not be relying on me and my server. Over the summer we duplicated the database and code, and over the last few days we’ve been testing it. Now it’s ready to go.

So ends my eight-year run tweeting daily mathematicians from @mathshistory. Tomorrow’s tweet will be served from BSHM. Basically, followers should notice no difference, but for me it will be very strange – the first ever @mathshistory daily mathematician tweet not sent by me.

]]>Nim objects could be anything, of course, but conventionally sticks or stones are used. There are various types of dot in LaTeX that might look like stones, but somehow a line of dots didn’t seem satisfactory. There are various ways to draw a line (not least simply typing ‘|’), including some tally markers (e.g. in hhcount). My problem with these (call me picky) is that they are all identical lines, and a ‘heap’ of them just looks very organised. Really, I want a set of lines that looks like someone just threw them into heaps (though probably without crossings for the avoidance of ambiguity). So I wrote my own.

I used PGF/TikZ. My basic strategy was to draw a thick vertical line in TikZ with a little wobble added so each one doesn’t look extremely well-lined-up with its neighbour, achieved by adding or subtracting a small random number in PGF. This is a command `\drawnimstick`

. On top of this, I made a command `\nimgame{}`

which takes a comma-separated list of numbers and makes a row of Nim heaps with those numbers of sticks. For example, `\nimgame{5,2,3}`

makes a 3-pile Nim game with five sticks in the first pile, two in the second and three in the third. There is no limit to the number of piles or the number in a pile, but this code doesn’t do anything to cope when line breaks start happening because I only anticipate using small numbers of small piles myself.

Here are the definitions of the commands `\drawnimstick`

and `\nimgame{}`

.

% load packages and seed random number \usepackage{pgf,tikz} \pgfmathsetseed{\number\pdfrandomseed} % command \drawnimstick draws a single Nim stick with a little random wobble. \newcommand{\drawnimstick}{% \pgfmathsetmacro{\topx}{(random(0,20)-10)/100}% top of the line: 0 +/- random \pgfmathsetmacro{\botx}{(random(0,20)-10)/100}% bottom of the line: 0 +/- random \begin{tikzpicture}% \draw[very thick] (\topx,0) -- (\botx,0.5);% draws line \end{tikzpicture}% } % command \nimgame takes a comma-separated list of numbers and makes Nim heaps holding those number of sticks \newcommand{\nimgame}[1]{% \begin{center}% \def\listofgames{#1}% \foreach \heap in \listofgames {% picks the numbers from the list \foreach \index in {1, ..., \heap} {% loops for this heap \drawnimstick\hspace{0.5mm}% draws a stick + 0.5mm space }% \hspace{10mm}% 10mm horizontal space between heaps }% \end{center}% }

And here are some examples of it in action:

\documentclass{article} ...(the above definitions here)... \begin{document} % examples Here is a multi-pile Nim game: \nimgame{1,3,2} Here is another multi-pile Nim game: \nimgame{10,20} Here is another multi-pile Nim game: \nimgame{2,3,4,7,6,5} \end{document}

Here is the output of the code above (of course, if you run it again, all the lines shift because the random parameters vary on run time):

]]>