You’ve just bought a lovely fresh haggis quiche at your local Minus 4 shop and are planning to eat it in one sitting, in your kitchen with a friend. You’ve agreed to share it in the fairest possible way: one of you cuts and the other choses. The quiche is in the usual circular shape.

A coin is tossed—rather unnecessarily, it must be said—and it is determined that your friend gets to cut. You step out of the kitchen for a moment and upon your return discover to your horror that your friend has already done the cutting, but not as you had expected. Instead of making one simple straight cut as close to a diameter as possible, the big oaf has made four straight cuts.

Despite the fact that these four cuts neatly meet at 45 degrees at a single point, everything is off-centre. The first cut is close to being a diamater, but the others are more lop-sided. The resulting eight slices are unequal in size, and the near-diameter cut clearly doesn’t bisect the quiche either.

“What have you done, Hamish?” you cry out in exasperation. “You were only supposed to make *one* cut, then I’d get to chose which piece I wanted. I was assuming you’d be smart enough to cut it into two pieces which looked so similar you wouldn’t mind which one I took for myself. That was the whole point! But now, even if we pretend you only made one of those four cuts, they’re all so skewed that it won’t seem fair, as it would be too easy for me to get four adjacent pieces that add up to more than half the quiche.”

“Sorry,” he replies sheepishly. “I thought that just two pieces would be too big. So I went for eight smaller ones. Besides, this is how I always cut deep-fried Mars bars.”

Trying to suppress the look of disbelief that has come over your face, you force Hamish to sit down for five minutes and read the Wikipedia page on fair cake-cutting.

“Now do you get it?” you ask. “With two pieces it’s easy, but with eight pieces it’s much trickier!”

“To be honest, I got lost early on reading that webpage,” Hamish confesses. Glancing over his shoulder you can see why, as the easy two-piece case is buried deep in the article.

“I’ll try to make it up to you,” Hamish offers. “Why don’t I divide these eight pieces into two piles of four, as fairly as I can, and you get to pick whichever pile you like?”

“Hmm, I guess that would work,” you reply. Then a revelation hits you. “Actually I have a better idea. Please let *me* do the division into two piles of four pieces, and you can chose whichever pile you want. Furthermore, I’ll do this with my eyes closed. You can even rotate the plate first so I don’t even know which piece is where. And I’ll bet you a tenner that I’ll do such a good job that no matter which pile you chose you won’t get much more than me! You can verify using the kitchen scales over there. You can even change your mind after you choose and weigh. You can’t ask for more than that!

It’s Hamish’s turn to be incredulous. He can’t believe his luck, being convinced that he’ll soon be £10 richer, since he doesn’t think you’ll be able to pull it off as you claim.

You close your eyes as promised, having first placed two identical clean plates on the table, one to the left of the quiche, the other to the right. Hamish spins the plate in front of you and says, “Ready? You can touch but don’t look.” You reach forward and quickly remove four pieces of the quiche and set them on the plate on the left. You open your eyes and put the remaining four on the plate on the right. Hamish picks one plate for himself, and then weighs both of them. To his astonishment he finds that he has lost the bet fair and square, even if he switches plates at this late stage. Crestfallen, he hands over ten quid.

What is it you do that guarantees your success here? This picture reveals all.

Even though your eyes are closed, it’s easy to remove four alternate slices to the plate on the left. If the four slices left behind are placed on a similar plate, and the two are weighed, they should come out more or less equal.

This works because of the little known and oft-misnamed Quiche Theorem, which asserts:

If a circular quiche is divided into

4nslices (wherenis at least 2), by making cuts at equal angles through an arbitrary internal point, then the sums of the areas of alternate slices are equal.

Okay, so that’s really a 2D result about area, but we’ve just added depth (and flavour) to it.

This applies when we have 8, 12, or 16 slices, but not if there are 4, 6, 10 or 14. Furthermore, since the crust on a quiche can be viewed as the difference between the whole quiche and a slightly smaller circle of filling, with the same centre, and each circle behaves according to the theorem, it follows that you and Hamish also get equal amounts of crust.

Curiously, in cases where the number of slices isn’t a multiple of 4, the alternate slice strategy gives one person more quiche but less crust, and vice versa.

For 8 slices, Carter & Wagon (1994) gave a disection proof of the alternating slice strategy.

Maybe you should let Hamish loose with the knife a little longer, then he could see for himself, without resorting to weighing, that the quiche can be split into two equal-weight halves consistent with his initial 4 cuts. He’d then have sixteen mostly bite-sized pieces, half of which would match up with the other half, down to the last crust.

THE END

*If you need to see the theorem in action, here’s a reproduction of Carter and Wagon’s proof without words in a GeoGebra worksheet. Drag the big blue points around to change the slices.*

Ooh, I get to break out my “holy power law, Batman” image again! Yippee!

Ctrl+F “power law” – no hits. That’s odd.

Follow the link to the story “Ancient cities grew pretty much like modern ones, say scientists” in the Christian Science Monitor.

Ctrl+F “power law” – no hits. Hm! What could this mysterious mathematical rule be?

Follow the link to the research group’s website. Oh look, it’s the same Geoffrey B. West who said something fishy about power laws last time!

Ctrl+F “power law”…

“Many diverse properties of cities from patent production and personal income to electrical cable length are shown to be power law functions of population size with scaling exponents that fall into distinct universality classes.”

Growth, innovation, scaling, and the pace of life in cities, Luís M. A. Bettencourt, José Lobo, Dirk Helbing, Christian Kühnert, and Geoffrey B. West

(Actually, I can well believe that some of the things they looked at do follow power laws. I certainly don’t think that they *all* do.)

*Bread & Kisses* is a short film by Katherine Fitzgerald about a mathematician who discovers love – I know, I know, you’ve heard this one before – but it also contains a mathematician who moves to the Alps to get more skiing in, so it’s the most realistic film about mathematicians ever. It also features the emotion of love in a star turn as an epsilon term.

Although it contains the line, “you forgot the most important ingredient: love”, so don’t get your hopes too high.

Mr. Maths is struggling with a proof. He signs up to a baking class because an Attractive Woman tells him to. In the process, he learns to loosen up and not overthink or something.

Or, in the words of the producers:

A lonely mathematician, struggling to solve an equation finds a solution in an unexpected way – by taking baking classes.

The two women who teach him awaken his senses, rekindle his zest for life and show him the value of balancing his head with his heart.

Because maths is about balancing equations, *amirite?!?!*

It came out in 2010 but just appeared on my radar recently. Maybe it’s only just been uploaded to Vimeo. Thanks to that, you can watch it here. It’s pleasant enough.

*via Luis Guzman on Google+*

To celebrate Christopher Zeeman’s 90th birthday and their own 150th, the London Mathematical Society have opened an online archive of Sir Christopher’s work.

That’s all they’ve done – the Zeeman Archive, as far as I can see, is a simple list of every document they’ve got, linking to PDF scans. It’s searchable, by title, medium, and date. I’d like a bit more presentation and information to put stuff in context.

Disconcertingly, a few of the papers have the scary JSTOR licence page at the front. I assume the LMS has cleared their redistribution with JSTOR, but you’d think they’d arrange at least a customised cover page.

Anyway, making stuff available for free and easy to access is always a good thing — at least they haven’t gone for one of those awful museum archive systems that puts all sorts of barriers between you and the content.

I’m not particularly familiar with Zeeman’s work so I just went for a browse. There’s a fun note called “Unknotting spheres in five dimensions”, and the famous Royal Institution Christmas Lectures are all there (well, there’s a link to the corresponding pages on the Ri Channel). The photos and letters categories are currently empty; maybe someone is working away at gathering them.

**Have a dig around: **The Zeeman Archive at the LMS

The sight of bumblebees roaming around British gardens, foraging for nectar, is common and comforting. The movement of these fuzzy bees between flowers and plants can often seem deliberate yet erratic. Charles Darwin was intrigued by “humble-bee” routines^{1}, and observed them with the assistance of his six children, but always regretted not attaching strands of cotton wool to the bees so he could follow them more easily^{2}.

Within the last decade there has been renewed interest from a number of collaborating researchers into studying bumblebees’ movement between flowers and their foraging techniques. The prevailing journalistic spin on this research seems to be ‘Bees solve the Travelling Salesman Problem – a problem that mathematicians and computers cannot solve’. This is unfortunate, not least because it is gleefully misleading, confusing various meanings of ‘solve’, but also it obscures a lot of the fascinating underlying scientific investigations.

Imagine a purely mathematical bee: she sets off from her nest with a list of $N$ flowers she must visit before returning home. She wishes to minimise the total length of her flight path between the flowers, so will always fly in straight lines, and never visit the same flower twice in an outing.

Once she has found the flower order that gives the path of minimal distance, she has found *the solution to this particular instance* of the Travelling Salesman Problem, or TSP (in two-dimensional Euclidean space, which is the only version of the TSP that I’ll mention outside the footnotes).

However, every such mathematical bumblebee must solve a different problem: each has a different list of flowers, with differing numbers of flowers in different locations.

If we were to program robotic bees to pollinate specific flowers efficiently, it would be nice if they could solve the Travelling Salesman Problem in general. That would mean creating an algorithm where, given *any* list of flowers, the robot always finds the shortest path. It’s conceptually easy to create such a general algorithm: just get the robot to visit the flowers in every possible order, keeping track of the shortest circuit it has found so far. The issue is that this is horribly inefficient, taking $N!$ flights to find the TSP solution for $N$ flowers. Mathematicians don’t know whether there is an algorithm that efficiently solves the TSP in every case.^{3}

For most purposes, in practice, you don’t need to know how to find the minimal solution efficiently in every case: it’s enough to have strategies or *heuristics* that help you find *approximate solutions *that are short and may be close to minimal — for instance, if you looked at each flower in turn and took the minimal distance to any other flower, and summed these lengths up, that would give you a lower bound for the distance of all circuits. So by finding a circuit with a length close to this lower bound, you would know you were even closer to the actual solution. This would be the case with our mathematical bumblebee visiting a list of flowers: the reward in an evolutionary sense is for finding a decent approximate solution without expending too much effort searching. Reducing the distance travelled by that final millimetre to the absolute minimum, while rewarding for mathematicians, doesn’t make much difference to the bees.

So far we’ve been talking theoretically. Real bees aren’t equipped with lists of flowers they must visit. There’s an extremely wide choice of suitable flowers and bees aren’t restricted in which they can choose. Not all flowers are equal, having all sorts of different properties, such as their colour, scent, and the varying amounts of nectar they produce, as well as changing over time. Bees don’t have perfect knowledge of all flowers or the distances between them, and are quite limited in brain power and memory. Also, bumblebees don’t necessarily fly in straight lines.

Having said all this, we could still reasonably expect that whatever heuristics bees develop or have hard-wired into their brains^{4} to solve their own routing problems might also do quite well at solving the Travelling Salesman Problem. Even if the TSP doesn’t model the bees’ problems in an ideal way, at least the TSP describes a precise problem, and is used in experiments with other animals. Therefore, using the TSP allows comparison of results between species with wildly different environments and behaviours.

So how might you go about designing an experiment to convince bees to follow the rules and solve a Travelling Salesman Problem? For starters, you can restrict the number of flowers available to the bees by performing the experiment in a greenhouse, or in a field otherwise lacking in flowers.

Another strategy is using artificial flowers, to control how much nectar (or rather sugar syrup) each provides. It is good practice here to get an initial baseline measurement of how much a bumblebee’s crop can hold, and then set each of the $N$ artificial flowers to supply $1/N$ of the total nectar the bumblebee requires. This removes variation between flowers, and encourages the bumblebees to visit each flower at least once. As for the problem of bumblebees visiting flowers more than once in a trip, in practice it turns out that usually the bee returns to the most recently visited flower, and these revisits can be ignored.

Finally, we shouldn’t expect the bumblebees to perform well while they are getting used to the layout of the flowers, but we should allow them to perform many foraging flights over the same arrangement to give them a chance to learn.

Bumblebees will often settle upon particular routes between a chosen set of food sources. This behaviour, known as trapline foraging, is shared by other creatures such as hummingbirds, bats, wagtails and capuchin monkeys^{5}. If the traplining bee has reliable and renewing sources of nectar, why bother searching for new ones? Visiting in the same order during each foraging flight reduces variation in the time between successive visits, and so the amount of sugary reward is more predictable. Regularly revisiting flowers reduces the benefits received by any competitors interloping onto the bee’s patch. However, the inevitable trade-off is that visiting the same flower too frequently also caps the rewards enjoyed by the foraging bee herself.

A couple of studies approximately following the above design were set up to test whether bees might follow a *nearest-neighbour* strategy. Following the nearest-neighbour strategy would mean the bees always head next to the closest flower they haven’t yet visited.

The nearest-neighbour strategy is an instance of the *greedy algorithm*, which means always taking the option at each stage that gives the greatest immediate reward. Specifically, the greedy algorithm involves no planning ahead, and depending on the situation, might not necessarily result in the greatest overall reward. Sometimes it goes completely wrong. In the Euclidean Travelling Salesman Problem, the greedy algorithm typically gets reasonably close to the optimal solution.

As an example of the greedy algorithm, when a UK cashier is handing you back change (1p, 2p, 5p, 10p, 20p, 50p, £1, £2), they can simply choose the largest possible coin not greater than the amount of change needed, subtract it off the total, and do the same with the next. This simple greedy strategy will always result in the smallest possible number of coins handed back.

That the greedy strategy works in this case depends on the values of the coins. The same wouldn’t hold if the cashier were handing back 6p using a selection of historic currency, namely pennies, threepennies (3p) and groats (4p). The greedy strategy here would lead to handing back three coins (4p, 1p, 1p), instead of the optimal two (3p, 3p).

A prime example of where the greedy algorithm fails is the board game Reversi (also marketed as Othello). It’s tempting to be greedy and each turn choose a move that flips over the greatest number of your opponent’s pieces to your own colour. This turns out to be a terrible strategy, especially near the start of the game. You can pit yourself against a silly computer opponent (“Simple Bot”), which uses a version of this strategy.

A greedy approach will fail in many strategy boardgames because human opponents can exploit such a simplistic and predictable strategy, and make short-term sacrifices to improve their long-term position. Equally, if the greedy algorithm is ever optimal, the game won’t be strategic or much fun, and can easily turn into a boring mechanistic chore.

Because the greedy nearest-neighbour strategy is simple and works quite well at routing problems, it seems a reasonable hypothesis that bees might use it. However, while flowers aren’t setting out to trick navigating bees, researchers are.

The diagram below depicts two arrangements of artificial flowers (black circles) and two possible routes the bees could decide to take starting and ending at their nest box (white circle). The top row shows the shortest circuit around the flowers, the lower row shows the greedy route a theoretical bumblebee subscribing to the nearest-neighbour strategy would take in each case. In Arrangement 1, the nearest-neighbour route is the shortest. In Arrangement 2, the distance between the two rows of flowers has been decreased so the optimal and greedy routes no longer coincide.

These arrangements were both used in the greenhouse laboratory tests described in the paper “Trapline foraging by bumble bees: IV. Optimization of route geometry in the absence of competition”^{6}. The results weren’t conclusive. In Arrangement 1, the bumblebees mostly followed the optimal greedy route. But in Arrangement 2, while the bees didn’t follow the optimal route, they ended up taking a ‘noisy’ variety of suboptimal routes (and not just the greedy one). While this doesn’t point to any particular strategy on the part of the bumblebees, it does suggest that their approach worked well in the arrangement where being greedy paid off, but was more confused when this wasn’t the case.

A later paper, fronted by insect cognition researcher and bee TSP veteran Mathieu Lihoreau, dispels the notion that bumblebees are purely greedy beasts. A flower arrangement was chosen that more severely punished any bees that acted out of strategic greed. Most (6 out of 8) of the bees being tested used the shortest route as their main route (20% of the time), while the other two bees used it as their second most common route. None of the bees used the purely greedy route more often than by chance.

One thing that was clear from this set of experiments is that the bumblebees learnt to take shorter routes over time, each continuously reducing the total length of its route over the 80 trips. The picture below shows the paths taken by one of the six bees that took the shortest route more frequently than any other route.

Lihoreau and two other researchers attempted to mimic the behaviour of bees with computer simulations. Their best attempt led to an algorithm that essentially suggested the bees experiment with different paths between flowers, but prefer hops that had previously lowered the overall distance travelled. The initial probabilities assigned to moving between two flowers in their simulation, the *transition probabilities*, were inversely proportional to the squared distance between the flowers. This means that the greedy route would initially be the most probable before any learning took place. Each time the bee happens upon a shorter route, all the transition probabilities that went into making up this route are multiplied by a number known as a *learning factor* (1.1 worked well for them) and then normalised so the probabilities sum to 1. Thus the shortest transitions between flowers start off as the most highly weighted, but when the bee finds a shorter route, the hops between flowers on this route are more likely to be used in future.

Another property of this heuristic is that it is *scale invariant*: if all the distances between the flowers were multiplied by a constant factor, the model bee would act no differently. Since real bees are going to expend more energy taking suboptimal routes over larger distances, we would expect them to be incentivised to learn more quickly. To account for this, the learning factor can be increased. Increasing the learning factor won’t always lead to improved performance; it simply lowers the amount of risk-taking. If the learning factor is increased too much, the heuristic degenerates into an ‘order of discovery’ rule of thumb, an easy-to-falsify hypothesis that the bees just visit flowers in the order that they discovered them.

Using an increased learning factor of 2, the model did still fit larger scale data collected by Lihoreau and his collaborators when they took the experiments out of the greenhouse laboratory and into a field in Hertfordshire. Attaching tiny radar transmitters to the bumblebees’ backs, the researchers were able to more accurately map out the bumblebee paths. Using radar data, one can depict precise paths between the flowers, dropping the assumptions about direct flights. For instance, initial flights were extremely wiggly, with lengths of about 2000m, while still missing and repeating some of the artificial flowers. Before 30 trips were over though, one bee had optimised its route to 365m, just over the minimum of 312m, visiting flowers in the ideal order and in almost straight lines.

This model, unlike the real bees, will eventually settle permanently on one particular route. Though bumblebees are generally creatures of habit and can be easily tricked into taking suboptimal routes^{7}, they do occasionally try out a radically different route, and the converging computer model fails to capture this behaviour. A bee’s thirst for exploration makes sense when faced with a changing environment.

Recreating Lihoreau et al’s algorithm, I’ve generated one possible set of paths that one such simulated bee would take, learning with the same set of flowers as the real bee over the course of 80 foraging trips. At first glance, other than the fact that the simulated bee always visits all the flowers, the paths look quite similar. Both the real and virtual bee visit the optimal route early on, and by the end of the experiment are predominately using it.^{8}

One difference I see is that the simulated bee seems predisposed to use the greedy path more frequently in this flower arrangement than the actual bee. The greedy path only differs here by one ‘choice’ from the clockwise optimal route. You can also observe in these cases that, unlike the computer-generated bee, the real bumblebee is still experimenting with different routes in the final row, even though it’s been using the optimal route more by that point.

It’s easy to find criticisms of any specific algorithm modelling the way bees choose paths between flowers. After all, bee brains are very dissimilar to our mechanical, designed computers and the programs that run on them. But what Lihoreau et al. have shown is that a simple algorithm will adequately capture many aspects of a bumblebee’s behaviour, without attributing any particular sensory or computational superpowers to them. In the end, you could conclude ‘OK, it’s probably not *this* algorithm that bees are using, but something that feels a bit like it’.

**Apiological Part 1: **Honeycomb geometry

**Apiological Part 2: **Estimating nest volumes

- Bumblebees were generally known as “humble-bees” until the modern term really caught on in the 1890s.
- Freeman,
*Charles Darwin on the Routes of Male Humblebees* - There probably isn’t an efficient general algorithm: the 2D Euclidean TSP and wider classes of travelling salesman problems with other metrics, or non-complete graphs are
*optimisation problems,*and they are NP-hard. Informally, it’s hard even to check whether a suggested solution to a particular problem is minimal. These should not be confused with*decision problem*variants, also confusingly known as travelling salesman problems: find out whether a particular finite graph has a Hamiltonian circuit; does a graph have a Hamiltonian circuit shorter than some given distance $d$. These decision problems are NP-complete, as it’s easy to check whether a proposed solution meets the requirements (ie. in polynomial time). For instance, in the second decision problem you need only to check whether the length of the circuit suggested as a solution is greater or less than the given distance $d$. - Note the mathematical non-exclusive ‘or’ – bees might be hard-wired to later develop certain heuristic behaviours in some environments.
- Ohashi, Thomson:
*Trapline foraging by pollinators: its ontogeny, economics and possible consequences for plants* - Trapline foraging by bumble bees: IV also tested whether bees might be biased to moving in straight lines – they weren’t.
- Another experiment showed that when the last flower in a learnt optimal circuit was rigged to give more nectar, the bumblebees would sensibly prioritise this highly-rewarding flower, though at the expense of taking a longer route – even though they could have both achieved the same route length and visited the highly-rewarding flower first, by simply flying their original route backwards.
- Behold! Using my computer I’ve solved the Travelling Salesman Problem, a problem that even mathematicians with computers are unable to… oh wait, there might be a flaw in the newspaper logic used here.

The Carnival rounds up maths blog posts from all over the internet, including some from our own Aperiodical. See our Carnival of Mathematics page for more information.

]]>Oo, my second effort at estimating π came to 3.14151, correct to 0.003%! cc @aperiodical pic.twitter.com/2vuvys0mka

— Colin Beveridge (@icecolbeveridge) March 10, 2015

Viewed on its own, that’s probably a bit mysterious, so I thought I’d write a little article to explain what was going on, and explore some of the maths behind it.

The first thing I did, after watching the video, was think about (read: Google) what other strategies one might use to approximate π. I thought about measuring a cylinder (too much work); I thought about something to do with the Catalan numbers (would involve research); and I finally settled on a geometric method that relies on a cool *almost-identity*:

\[x \approx \frac{3 \sin(x)}{2 + \cos(x)} \]

There are two immediate questions:

- Why does that work?

and - How does it help?

Why it works is fairly simple: a good approximation for $\sin(x)$ is $x – \frac{1}{6}x^3 + \frac{1}{120}x^5 – …$, and a good approximation for $\cos(x)$ is $1 – \frac{1}{2}x^2+ \frac{1}{24}x^4 – …$. That means the fraction becomes:

\[ \frac{x\left(3 – \frac{1}{2}x^2 + \frac{1}{40}x^4 – …\right)}{3 – \frac{1}{2}x^2 + \frac{1}{24}x^4 – …} \]

Ignoring the $x$, the rest of the numerator and denominator only differ in the $x^4$ term (and onward), which, for a small angle, makes for a very small error.

How does it help? Well, sine and cosine are circular functions, which means they can be measured off of a circle. Given a pair of perpendicular axes and a circle centred on them, any point on the circumference is $R \sin(\theta)$ above the horizontal axis and $R \cos(\theta)$ to the right of the vertical axis, assuming the circle has radius $R$ and the point forms an angle $\theta$ with the horizontal axis.

That means, if you construct an angle of, say, $\frac{\pi}{6}$, you should be able to construct and measure $\frac{3R \sin(\theta)}{2R + R\cos(\theta)}$, which is approximately $\theta$.

So, I drew that kind of circle. I constructed perpendiculars. I extended lines. I measured them. And I did some simplification.

If I wanted an estimate for π, I’d need to multiply everything by 6; meanwhile, I’d measured *double* $R\sin(\theta)$, the chord of the circle (**AB** in the diagram), so I’d need to multiply that number — 74mm — by 9 to get 666. Oooo!

On the bottom, I’d extended my horizontal chord (**CA**) by two radii to get $2R + R\cos(\theta)$, which I measured to be 212mm (**CG**). Then I did some tedious long division to get 3.14151, which isn’t bad for something knocked up on the sofa with a borrowed geometry kit. It’s almost too good to be true.

Estimates of π that are good to nearly five significant figures don’t pop off of such pages, at least, not without a great deal of preparation. For example, an unscrupulous geometer might fire up Desmos, draw the line $y = \pi x$, and see where it falls unusually close to a lattice point. (Better mathematicians than me would use a continued fraction to get the best estimate possible — although I did consider $\frac{355}{113}$, I couldn’t make it look natural. That was my first attempt.)

I found that $\frac{333}{106}$ was pretty much bang on the money — certainly, good enough for this. However, I needed the top to be a multiple of 18; it’s already a multiple of 9, so doubling it would work. I also know that $\sin\left(\frac {\pi}{6}\right) = \frac{1}{2}$, giving me a radius of $\frac{666}{18} = 74\text{mm}$.

From there, all that remained to do was fudge the horizontal chord marks ever so slightly so they coincided with the 212mm I’d pre-measured, and boom! A natural-looking, but ever-so-good estimate of π.

]]>You may have noticed that here at The Aperiodical, we’ve been posting exciting π-related items all week – and here’s a list of them all, collected into one handy place. Enjoy!

We began by listing approximately τ ways you can celebrate π day, from eating tasty pie to getting an ill-advised tattoo.

Seven mathematicians; π hours; one transcendental number. How close will they get? Watch this video and find out.

Jumping on the bandwagon, stand-up mathematician Matt Parker has also attempted to find π by measuring the real world.

Author Simon Singh has picked out his top three π references in the world’s favourite cartoon comedy series.

Occasional guest author Andrew Taylor has been looking for π in slightly awkward places, and has found it somewhere you’d never expect…

Short but sweet, Alex sent us a little something towards our celebratory π day post-fest.

Regular guest author and pendulum-wielder Paul Taylor spends a lot of time at work using MS Excel, and has dug into its deepest darkest corners to find a function he can’t immediately explain.

Aperiodical editor Katie Steckles doesn’t believe the hype, and reckons that while today’s date is exciting, we can do better.

Friend of the site Colin Wright has found π in yet another place – when balls collide.

Katie explores the world of making your English homework arbitrarily more difficult for no reason.

Christian’s Interesting Esoterica column, always a trove of intriguing finds, has gone π-themed, with typically fascinating results.

Christian’s obsession with purchasing novelty domains turns π-shaped.

Peter joins in the π approximating fun, using a Maclaurin series.

]]>You may have noticed that the first paragraph of this article was immensely poorly written, and didn’t sound like good writing at all. And you’d be right – except writing it wasn’t easy as you’d think. I’ve written it under a constraint – that is, I’ve picked an arbitrary rule to follow, and have had to choose my words carefully in order to do so.

Now, you might think “Isn’t this supposed to be a maths website? This is surely more about English than Maths!” – and you’d again be right, except for two things. One is that the constraint I’ve chosen above, one which others have used before, is very mathematical, as I will shortly explain. And secondly, isn’t choosing arbitrary constraints to work under, making things much more difficult for yourself, and then seeing what happens, part of mathematics we all know and love?

The first paragraph was written in what’s come to be known as Pilish – a particular type of constrained writing in which the length of each word in letters corresponds to a digit in our much-hallowed circle constant, π. So, the first word has three letters, then one, then four, then one and so on. You can probably see now why it sounded like I’d temporarily forgotten how to write. (Equally, you may be thinking the same about these following paragraphs, but that would just be mean. And, excepting some spectacular statistical coincidence, they don’t have word lengths corresponding to the subsequent digits of π).

In fact, if anyone was paying attention, one of our celebratory Piπ Day guest posts this week, by Alex Bellos, was written entirely in Pilish. Did you notice?

You might be familiar with some other examples of Pilish, or pi-length words – common mnemonics for remembering the first few digits of π include such classics as ‘How I wish I could calculate Pi’, ‘May I have a large container of coffee’ (attributed to Martin Gardner), and the boozer’s favourite ‘How I need a drink, alcoholic in nature after the heavy lectures involving quantum mechanics’. This kind of aide-memoire comes under the umbrella of ‘piphilology’, and is sometimes referred to as a ‘piem’ (a pi poem). In fact, our own Peter Rowlett wrote briefly about it after a talk at the BSHM in 2010.

In fact, people have gone much further than this – a version of Edgar Allan Poe’s ‘The Raven’, called “Poe, E: Near A Raven” has been ‘translated’ into Pilish, and encodes 740 digits of pi. The same author, mathematician and wordplay fan Mike Keith, has published a whole book, ‘Not A Wake‘, which includes 10,000 words, each encoding one of the first 10,000 digits of pi. The book contains poetry, short stories, haiku, two crosswords and an entire film screenplay, among other writing styles.

This type of ‘constrained writing’ is something fans of words and the mucking about with thereof are often engaged in.

As well as constraining words using digits, word fans think up many kinds of writing involving various constraints – such as lipograms: books which go wholly without using a particular glyph (much as this paragraph has).

Author Georges Perec famously wrote an entire French novel, ‘La Disparition‘, without using the letter *e* – especially a challenge since it’s the most common letter in French. It’s also the most common letter in English, which is why it’s especially impressive that the whole work was translated into English by Gilbert Adair, again without using the letter *e*, and published as ‘A Void’^{1} It’s since also been translated into at least nine other languages, again without using the letter most common in that language.^{2}

Perec was a member of Oulipo – a collection of French writers and mathematicians who play with constrained writing – founded in 1960, and with many well-known authors as members, they use constraints to inspire more interesting stories. They deal in lipograms, palindromes, restrictions on word length, vowel sounds and many other types of constraint – including some based on mathematical puzzles, like knight’s tours or particular number sequences.

Given π’s popular symbol status, it’s no surprise that it’s been used for constraining text – but what about other mathematical constants? Wouldn’t the ultimate constraint be a book written using word lengths matching the digits of $e$, without using the letter *e*, written while under the influence of e? I’d read that.

- Perec also later wrote another novella, ‘Les Revenentes’, using only the vowel e – which has been translated into English by Ian Monk as ‘The Exeter Text: Jewels, Secrets, Sex’.
- The story, brilliantly, is a mystery novel in which the letter e has gone missing and nobody knows where it’s gone.

In case you’re new to this: every now and then I encounter a paper or a book or an article that grabs my interest but isn’t directly useful for anything. It might be about some niche sub-sub-subtopic I’ve never heard of, or it might talk about something old from a new angle, or it might just have a funny title. I put these things in my Interesting Esoterica collection on Mendeley. And then when I’ve gathered up enough, I collect them here.

In this post the titles are links to the original sources, and I try to add some interpretation or explanation of why I think each thing is interesting below the abstract.

Some things might not be freely available, or even available for a reasonable price. Sorry.

Rabinowitz and Wagon present a “remarkable” algorithm for computing the decimal digits of π, based on the expansion $\pi = \sum_{i=0}^{\infty} \frac{(i!)^2 2^{i+1}}{(2i+1)!}$. Their algorithm uses only bounded integer arithmetic, and is surprisingly efficient. Moreover, it admits extremely concise implementations.

I find the spigot algorithms for π just endlessly fascinating, for some reason. Even more fascinating is the next paper…

We give algorithms for the computation of the $d$-th digit of certain transcendental numbers in various bases. These algorithms can be easily implemented (multiple precision arithmetic is not needed), require virtually no memory, and feature run times that scale nearly linearly with the order of the digit desired. They make it feasible to compute, for example, the billionth binary digit of $\log {(2)}$ or $\pi$ on a modest work station in a few hours run time. We demonstrate this technique by computing the ten billionth hexadecimal digit of $\pi $, the billionth hexadecimal digits of $\pi ^{2}$, $\log (2)$ and $\log ^{2}(2)$, and the ten billionth decimal digit of $\log (9/10)$. These calculations rest on the observation that very special types of identities exist for certain numbers like $\pi $, $\pi ^{2}$, $\log (2)$ and $\log ^{2}(2)$. These are essentially polylogarithmic ladders in an integer base. A number of these identities that we derive in this work appear to be new, for example the critical identity for $\pi $:

\[\pi = \sum _{i=0}^{\infty }\frac {1}{16^{i}}\bigr ( \frac {4}{8i+1} – \frac {2}{8i+4} – \frac {1}{8i+5} – \frac {1}{8i+6} \bigl ). \]

You can calculate any single digit at any point in the decimal expansion of π without computing any of the previous ones! Isn’t that just *incredible*?

The well-known needle experiment of Buffon can be regarded as an analog (i.e., continuous) device that stochastically “computes” the number $2/\pi \approx 0.63661$, which is the experiment’s probability of success. Generalizing the experiment and simplifying the computational framework, we consider probability distributions, which can be produced perfectly, from a discrete source of unbiased coin flips. We describe and analyse a few simple Buffon machines that generate geometric, Poisson, and logarithmic-series distributions. We provide human-accessible Buffon machines, which require a dozen coin flips or less, on average, and produce experiments whose probabilities of success are expressible in terms of numbers such as, $e^{-1}$, $\log 2$, $\sqrt{3}$, $\cos(1/4)$, $\eta(5)$. Generally, we develop a collection of constructions based on simple probabilistic mechanisms that enable one to design Buffon experiments involving compositions of exponentials and logarithms, polylogarithms, direct and inverse trigonometric functions, algebraic and hypergeometric functions, as well as functions defined by integrals, such as the Gaussian error function.

Buffon’s needle experiment is a decent way of generating an approximation of π manually (it was the winner in Katie’s π calculation challenge). In this paper, Philippe Flajolet generalises the idea to experiments which produce other numbers.

At the time of its writing in 1995, this composition in Standard Pilish, a retelling of Edgar Allan Poe’s “The Raven”, was one of the longest texts ever written using the π constraint, in which the number of letters in each successive word “spells out” the digits of π (740 digits in this example).

Midnights so dreary, tired and weary.

Silently pondering volumes extolling all by-now obsolete lore.

During my rather long nap – the weirdest tap!

An ominous vibrating sound disturbing my chamber’s antedoor.

“This”, I whispered quietly, “I ignore”.

In MTAC, v.2, p.143-145 we noted various formulae which had been used for calculating π to many places of decimals. These included that of MACHIN (1706)

\[ \frac{\pi}{4} = 4 \tan^{-1} \frac{1}{5} – \tan^{-1} \frac{1}{239}, \]

which was used by WILLIAM SHANKS (1812-1882) to compute π to 707D. The accuracy of this computation to 500D was verified by an independent calculation completed and published in 1854. No one appears to have checked the later figures until 1945, when Mr. D. F. FERGUSON, now connected with the Department of Mathematics of the University of Manchester, undertook the task.

The only famous maths person from my native County Durham that I know of, William Shanks, set a ridiculous record for calculating π entirely by hand. The sad thing is that just about two hundred years later, major-league buzzkill D.F. Ferguson of Manchester (*spit!*) decided to try out his new mechanical calculator by checking Shanks’ figures and discovered he’d made an error at the 528th place, so the last 180 digits were wrong. Over the course of a few papers and corrigenda published in *Mathematical Tables and other Aids to Computation*, Ferguson and various correspondents eventually computed the first 808 digits of π. The final paper, A new approximation to π (conclusion), is of gloriously little use if you haven’t read all the preceding correspondence.

For no easily-explained reason, access to this four-page paper from almost 70 years ago will cost you \$34. Access to the one-side “conclusion” paper also costs, bafflingly, \$34.

Some well-known and little-known appearances of π in a wide variety of problems.

So it’s like this column, but with more words. \$12.

This is really remarkable and I only just found it – a magic square 144 numbers wide, where every number is a seventh power and the sum of each row and column is 3141592653589793238462643383279502884197169399375105 – that is, the first 52 decimal digits of π!

If π day is for anything, it’s for approximating π, so I have to include these two papers:

In 1953 K. Mahler gave a lower bound for rational approximations to π by showing that

\[ \left\lvert \pi – \frac{p}{q} \right\rvert \geq q^{-42} \]

for any integers $p$, $q$ with $q \geq 2$. He also indicated that the exponent 42 can be replaced by 30 when $q$ is greater than some integer $q_0$. This result is based on the classical approximation formulae to the exponential and logarithmic functions due to Hermite. Our aim is to improve the knowledge of approximations by rational numbers of the classical constants of analysis such as $\pi$ and $\pi/\sqrt{3}$.

Counting collisions in a simple dynamical system with two billiard balls can be used to estimate π to any accuracy.

I recently calculated an integer sequence using π that wasn’t already in the OEIS – no mean feat, since there are absolutely tons of π sequences already.

You can find the really good Pi sequences by searching using the “nice” keyword, which the OEIS editors award to particularly interesting sequences.

Got to start with the classic. You might think there isn’t much point in looking at this entry, but the references are packed full of interesting stuff – that’s how I found out about that amazing magic square mentioned above.

Only eight numbers are listed in this entry! That’s because the ninth one has 3057 digits, as recorded in A121267 – Number of decimal digits in A047777(n). I don’t know if it’s surprising or not that you can go so long without reading a prime.

I didn’t know what this meant, but a comment in the entry helpfully explains:

For a real number $x$ ($0<x<1$), there is always a unique increasing positive integer sequence $(a(i))_{i>0}$ such that $x = \frac{1}{a(1)} – \frac{1}{a(1)/a(2)} + $\frac{1}{a(1)/a(2)/a(3)} – \frac{1}{a(1)/a(2)/a(3)/a(4)} \ldots$

This expansion can be computed as follows: let $u(0)=x$ and $u(k+1)=u(k)/(u(k)-\lfloor u(k) \rfloor$; then $a(n)=\lfloor u(n) \rfloor$.

This is the *real* π sequence – forget that base-10 nonsense. There’s a serious computation deficit for this sequence – while 13.3 trillion decimal digits have been calculated, the OEIS only has 15 billion terms of the continued fraction expansion! Ladies and gentlemen, this is a *travesty*.

a.k.a. the solution to the “where is my telephone number in π” problem.

I like this a lot! Interestingly, it doesn’t grow *too* quickly.

Finally, here’s my π sequence. It doesn’t look like it, but it might be finite – if there’s an $a(k)$ that is followed by at least $a(k)$ zeros, that means $a(k+1)=0$ and there’s no next term! I tried a few other bases to see if this happens, but only found base 2, which goes $11, 001, 0$.

]]>