While we’re not massively bothered by the pricing, the articles do raise, and then completely fail to address, an interesting point: an oval pizza is harder to cut into equally sized pieces! Luckily, maths is here to save the day. I found a nice method and made a video explaining how it works:

Take a look and improve your future pizza cutting technique!

Cheesed off! Families roundly cheated by trendy oval pizzas as experts warn they are smaller in size… And how CAN you slice them into equal portions, anyway? in The Daily Mail

Why those trendy new oval pizzas you see in major supermarkets may not be worth it, in The Mirror

(Sadly, all proper newspapers have declined to comment)

]]>The film is a painstaking and at times brutally realistic depiction of the struggles faced by African-Americans, and by women, during the era of the early space missions.

It’s the first film I’ve ever seen where the BBFC certificate at the start warns, where you’d usually see “scenes of violence/nudity/strong language”, a warning for “discrimination theme” – and it’s justified, as you find yourself battered by the repeatedly unfair and horrible treatment received by the clearly brilliant and lovely main characters, and worst of all how that is completely normal and widespread for the time. Langley, where NASA HQ is located, is in Virginia, a state where segregation continued in many aspects until the Civil Rights Act of 1964 – this meant ‘coloureds’ had to use separate bathrooms, drink from separate water fountains, sit in a separate section at the back of the bus and attend separate schools, all of which (and their horrible demoralising effects) are seen clearly in the film.

It also doesn’t shy away from the discrimination received by women, which is another layer of problems these characters face – even within their own community, they encounter people with a ‘do they let women do that?’ attitude. When one character arrives in her new department to provide her mathematical expertise and is immediately handed a bin which needs emptying, it’s not clear whether it’s because she’s female or black (or both).

But you’re here for the maths, right? This is at its core a film about a mathematician, an engineer and a computer scientist and how they helped America put a man into space. The maths and science is well incorporated into the story and doesn’t feel awkward, and serves to display the brilliance of the main characters, as well as the difficulty of the work everyone at NASA was doing – it was groundbreaking, and in some cases involved inventing new mathematical techniques to solve problems nobody imagined they’d have to solve (and this aspect of the space race is even mentioned as a justification for the huge cost and effort of the programme).

In one early scene, Katherine Johnson (as a child) demonstrates her mathematical brilliance by, having skipped two grades in school, being called up to the blackboard in front of a room of older students. She demonstrates that the product of two quadratics, set equal to zero on the board, can easily be solved by noting that if a product of two things equals zero, it means one of the two terms must equal zero so you can factorise each of the two quadratics, set each of the four resulting components to zero and find four solutions. It’s a beautiful piece of maths, well explained and displayed in full, front and centre in the scene. While some filmmakers might worry about this, it completely works and demonstrates her brilliance – the looks on the other students’ faces tell the story too.

Elsewhere in the film, Katherine is required to do Analytic Geometry, studying the trajectories of the space flights and their take-off and landing. The initial calculations for the earlier low-Earth orbit flights were simpler, and it’s when they start considering the more complex orbital flights – in which the trajectory of the capsule changes from an elliptical orbit of the Earth to a parabolic trajectory as it comes down, where they needed to work out something new. Together the team realises they can use numerical integration – Euler’s Method, which has been known for a long time but hadn’t been used at NASA for years – to obtain a solution which works numerically, without having to actually solve the differential equations. Johnson’s brilliance in helping come to this realisation is clear, and anyone watching who didn’t understand the maths can maybe even get a sense of the beauty and satisfaction mathematicians find in their work, especially when it has such amazing applications.

The other main characters demonstrate their excellence in their own fields too. Mary Jackson, clearly a brilliant engineer, is encouraged by her boss to join the NASA engineer training programme, but finds her bachelor’s degree in maths and physics is insufficient; the administrator’s veiled joy in telling her she doesn’t qualify could just be a true bureaucrat relishing in the rules, but as with many of the things people do in the film it’s in line with the standards of the era, and advancement seems an impossible dream.

The third amazing role model in this film is Dorothy Vaughan, who runs the computing department (at the time, a team of human ‘computers’ who perform all the calculations by hand). She notices that the new IBM supercomputer coming in to do the calculations will make all their jobs obsolete, so she educates herself and her team, getting books on Fortran from the library and using her skills with machinery and numbers to understand how it works.

I’m glad this film exists, and I’m double glad that it’s such a well-made piece of cinema, with well-developed characters, a gripping story and emotional tugs which work regardless of whether you’re interested in maths – because it means lots of people will see it. I hope that as well as telling these women’s stories – something badly needed – and reminding us of how painfully recent these attitudes held sway (and warning us not to let them take hold again now!) this film will also help people to see the wonder of maths and science, and show that people who do these things struggle the same as everyone else, and are all part of the same world.

It looks like the film is having this effect – many people are now talking about it, and Katherine Johnson also features in this new LEGO set, recently approved, of Women Pioneers at NASA. I’d recommend going to see it, but also taking along some tissues and being prepared to come out energised and angry that people were treated this way, and, I’d hope, ready to take on injustice now.

]]>“Life moves very fast. It rushes from Heaven to Hell in a matter of seconds.”

― Paulo Coelho

This week, I was suddenly reminded of a fact I’d been meaning to keep track of, and I was disappointed to discover that even though I always endeavour to remember birthdays and holidays (mainly due to a system of elaborate reminders, notes and excessive list-making), I’d missed a hugely significant anniversary. Shortly after the clock struck midnight on New Year’s eve, I had passed one billion seconds old.

While not one of the usual anniversaries to celebrate, I’d been looking forward to this one – it turns out that one billion seconds works out to somewhere between 31 and 32 years (my ‘just-after-midnight’ statement assumes I know the exact time I was born, which I don’t, but I have a reasonable estimate) . If you’d like proof, here’s a breakdown:

\[ 1000000000\ \mathrm{seconds} = 1000000000 \div 60\ \mathrm{minutes}\\

16666666.\dot{6}\ \mathrm{minutes} =16666666.\dot{6} \div 60\ \mathrm{hours}\\

277777.\dot{7}\ \mathrm{hours} =277777.\dot{7} \div 24\ \mathrm{days}\\

11574.\overline{074}\ \mathrm{days} =11574.\overline{074} \div 7\ \mathrm{weeks}\\

1653.\overline{43915}\ \mathrm{weeks} =1653.\overline{43915} \div 52\ \mathrm{years}\\

= 31.\overline{796906} \ \mathrm{years} \]

This quantity may mildly surprise you – partly because humans in general can be quite bad at interpreting numbers like a million and a billion. We know what the number means, and can calculate with it, but intuition can fail us when trying to put it into context.

It turns out that a second is quite a nice way to contextualise large numbers – for example, here’s an interesting fact I heard about the number of seconds in six weeks:

\[ \begin{eqnarray}

6 \ \mathrm{weeks} &=& 6 \times 7 \ \mathrm{days}\\

&=& 6 \times 7 \times 24 \ \mathrm{hours}\\

&=& 6 \times 7 \times (8 \times 3) \ \mathrm{hours}\\

&=& 6 \times 7 \times (8 \times 3) \times 60 \ \mathrm{minutes}\\

&=& 6 \times 7 \times (8 \times 3) \times (10 \times 3 \times 2) \ \mathrm{minutes}\\

&=& 6 \times 7 \times (8 \times 3) \times (10 \times 3 \times 2) \times 60 \ \mathrm{seconds}\\

&=& 6 \times 7 \times (8 \times 3) \times (10 \times 3 \times 2) \times (3 \times 5 \times 4) \ \mathrm{seconds}\\

&=& 1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7 \times 8 \times (3 \times 3) \times 10 \ \mathrm{seconds}\\

&=& 10! \ \mathrm{seconds}\\

\end{eqnarray} \]

The number of seconds in six weeks can be expressed as a product of the numbers one to ten – that is to say, there are 10! seconds in six weeks. Large factorials like this ($10! = 3,628,800$) are similarly difficult to quantify, so this is a nice fact to have in your pocket.

A million is a more manageable number; a million seconds is just over 11 and a half days, which might be the length of a single short project you work on in your lifetime, or how long a holiday lasts, or somewhere at the long end of how long you might reasonably expect a banana to keep for (if it was really fresh when you got it).

So my 1 billion seconds = 31 years milestone makes a nice distinction between a million and a billion – a couple of weeks versus a good chunk of my life. Another reason I’m disappointed not to have properly celebrated (I mean, I was celebrating, but not necessarily this) is because this is probably the biggest power of ten I’ll reach in my lifetime. I’ll probably survive to 2 billion seconds, and if I’m lucky maybe even 3 billion, but there’s no way I’ll make it to 10 billion and certainly not a trillion.

But here’s some you might manage:

- 1 year on the planet Jupiter is about 11.86 years
- 10 million minutes (aka 10 MEGAMINUTES) is about 19.01 years
- 1000 fortnights is about 38.33 years
- 1000 months is about 83.4 years, if you’re lucky!

So raise a billion glasses for me, and celebrate your milestones in seconds not years (as long as it doesn’t make you feel too old).

]]>Having spoken at the MathsJam annual conference in November 2016 about my previous phone spreadsheet on multiples of nine, I was contacted by a member of the audience with another interesting number fact they’d used a phone spreadsheet to investigate: my use of `=MID()`

to pick out individual digits had inspired them, and I thought I’d share it here in another of these columns (LOL spreadsheet jokes).

Twin primes, which are pairs of prime numbers with a difference of two, are well-studied. It’s not known whether there are infinitely many such pairs (although we’ve made some progress on that), but it’s suspected. The gaps between pairs get larger as you go up the number line, and there’s a few interesting bits known about them, including Brun’s Theorem. Today I’m going to investigate a thing about their products.

We can start by populating a spreadsheet with a list of pairs of twin primes, starting with the classic \((3,\!5)\) and proceeding from there. This data was obtained from the amazing resource at primes.utm.edu, maintained by known prime-basher Chris Caldwell. Putting this list of primes in the first column, and populating the second column with the number two higher gives us a lovely list of twin prime pairs.

In the next column, we calculate the product of each pair:

And in the fourth column, we can use a similar `MID()`

/ `VALUE()`

based construction to find the sum of the digits in this number:

Giving the not-especially-interesting result:

Or is it? In the fifth column, we can take `=MOD(`

and see what happens:*this value*,9)

With the exception of the first row, and let’s be honest the first one’s always weird anyway, you’ll see that all of these numbers have the value $8$ modulo $9$.

For an explanation of this, done in a bar after a few pints of course, we can thank sometime Aperiodical contributor and general maths guy Colin Beveridge, who contributes the following; if you’d like to try and work it out yourself, we’ve made these bullet points appear one at a time when you click, so you can use as many as you need and work the rest out.

- All twin prime pairs other than $(3,5)$ are of the form $6n +1$ and $6n – 1$ (it says it on Wikipedia so it must be true; left as a pleasing exercise for the reader)
- The product will therefore be of the form $36n^2 – 1$ (classic difference of two squares)
- This means the first part of this number will be divisible by $9$, as $36$ is divisible by $9$
- The whole thing must therefore be congruent to $8$ modulo $9$, as it’s a multiple of $9$ minus one.
- This means the sum of the digits of the number will also be $8$ modulo $9$.

A fun diversion for everyone. Thanks to Simon Allen, who sent me the email, and to Colin for his neat explanation, relayed via Simon.

If you’ve seen any nice number facts I can investigate using a spreadsheet on my phone, please send them in!

]]>We’re all (hopefully) aware that a pleasing property of numbers that are divisible by nine is that the sum of their digits is also divisible by nine.

It’s actually more well known that this works with multiples of three, and an even more pleasing fact is that the reason three and nine work is because nine is one less than the number base (10), and anything that’s a factor of this will also work – so, in base 13, this should work for multiples of 12, 6, 4, 3 and 2. Proving this is a bit of fun.

Once when I was thinking about this fact, an interesting secondary question occurred.

When thinking about the multiples of nine, I started to wonder: exactly which multiple of nine will you get when you add the digits together? Obviously, for all the small multiples of nine (less than, say, 81) they all add to $1 \times 9$, but once you reach 99 you have a sum of $18 = 2 \times 9$; and obviously bigger multiples of nine like 248426 have larger sums. So, how does this increase, and is there a pattern?

Since this struck me while I was out at dinner, and not equipped with my usual laptop/MS Excel combo, phone spreadsheets came to the rescue! I launched Google Sheets and created a quick table of values. Putting in a few early multiples of nine, highlighting down and using Auto-Fill created a list of multiples:

I then used the second column to work out the digit sum; my preferred method for this is using the `MID()`

function, which will return a sub-string of a sequence of letters or numbers. It takes three inputs – the thing you want a substring of (in this case, the cell to the left), the starting point, and the number of characters. I whipped up a quick formula which would find the first digit, and add it to the second, third and fourth digits (even though Google Sheets only gives you 1000 rows in a spreadsheet, so I wouldn’t ever need this many).

I also needed to add in the `VALUE()`

function, since `MID()`

returns text strings which it doesn’t always recognise as things you can add together, so I needed to convert them back to numbers before adding. This then gave me the list of digit sums for the multiples of 9. A quick final modification to the formula to divide this result by 9 gave me the information I was after – mostly, a string of 1s with a blip 2 at 99, then back to 1s again. How does this pattern progress?

You can see that the pattern alternates between 1s and 2s, increasing the number of 2s until it’s all 2s, then there’s the one 3 and it returns to the pattern, but this time starting slightly later on; then two 3s, and repeat, and the number of 3s increases until it’s all 3s, and then I assume we’d get a 4 (but my spreadsheet doesn’t have enough rows to actually see this).

This information looks nice in a table, but could probably be better represented in a graph, so I created a graph to display this data and make it more visible. It was around this point that the bill arrived, and my fellow diners started to get annoyed that I was just playing on my phone (and even though I offered to show them the graph, they weren’t interested). Here’s the graph:

You can see this number varying between 1 and 2, and the increasing and decreasing width of the segments until there’s a spike, which then increases in width too and the pattern continues. A more powerful package (and probably a bigger screen) could undoubtedly bring more clarity, but this was an interesting starting point and satisfied my curiosity – there IS a pattern, it IS quite pretty, and numbers are cool.

]]>Another name for a Rubik’s cube is ‘the Magic Cube’ – and Dr James Grime wondered if you could make a Magic Cube which incorporates its 2D friend, the Magic Square.

Several designs were considered for such a puzzle cube – early ideas included a cube with the numbers 1-54, each face being a normal magic square using the numbers 1-9, with a different multiple of 9 added to give a range for each face. After some searching and testing James settled on one particular type of magic square to make it work.

The Grime Cube is based around the **perimeter magic square** – an arrangement of the numbers 1-8 such that the three numbers on each edge sum to the same total. For example:

The square above has all four edges adding to 12 (and of course any rotation or reflection of this arrangement will also have this property). One nice interesting maths fact about such constructions is that only six valid perimeter magic squares exist for the numbers 1-8 (obviously, you can just add the same thing to each value to get another one, but that’s not as elegant).

What James Grime discovered was that you could use a Rubik’s cube, where the centres are fixed, to implement a puzzle involving such squares – since the centre of each face is fixed and only the edges move, you could try to arrange the pieces so that they add up to a number given in the centre. There only being six makes this an ideal thing to do on the faces of a cube, and the six squares pair up with each other as complements – so if you overlay two and sum them, the squares in the same place all add to 9.

This nice complement property meant that the cube could be designed to have opposite individual cubies (single chunks of cube) have their faces complement each other – so where there’s a 4 on one face of the cube, the opposite square will be a 5. Dr Grime also worked out a way to arrange six colours on the cube, so that each pair of mini-faces not only sum to 9, but are the same colour – and only one instance of each number/colour (e.g. red 5) occurs anywhere on the cube.

The final coup de grace for James was discovering a way to arrange the faces on the cube so that these colours could also be solved as a normal Rubik’s cube – an alternative arrangement where each face contains a single colour. This makes it a double puzzle – it can be solved so that either the magic squares work, and the opposite pairs match up, (left) or so that the colours on each face are all the same and there’s still 1-8 on each face (right).

As part of the testing process, I’ve had several goes at solving the cube and found it actually pretty pleasing – with my knowledge of how to solve a Rubik’s cube, I know how to put a particular edge or corner piece in a particular place, so I’ve found that very useful. I could find a pair of edge cubies that sit opposite each other (because e.g. the red 4 is always opposite the red 5) and then try other pairs until I get an arrangement that doesn’t use anything disallowed and lets me arrange the rest of the face so the totals are all the same. Then I can figure out which face I’ve just made, arrange it around the right centre face, and start working on the other faces around it. Others may have their own methods but I like how much it makes me think – not just blindly solving the colours, but also having to do sums and deduction along the way.

There’s another outstanding question about the cube, which Grime doesn’t know a good answer to yet – from the solved-for-magic-squares state, there should be a sequence of moves which translates it to the solved-for-colours state (and the maths tells us that this can be done in fewer than 20 moves, aka God’s Number). So far, James has found a path which takes 70 moves, but who will be the first to find the optimum path?

**The Grime Cube is on sale at MathsGear.co.uk for £14.99, and limited stock is available. **The last ordering date for delivery before Christmas in the UK is **19th December**, and more stock should be available in the New Year.

]]>

Q for my maths tweeps – recommendations wanted for Maths Journals suitable for a bright and engaged Sixth Form student. Suggestions?

— Colin Wright (@ColinTheMathmo) November 24, 2016

It led to a flurry of interesting replies, and here’s some of them.

Run by a group of students based at UCL, Chalkdust comes out four times a year and has editorials, fun features, interesting articles, cartoons and a prize crossword. It’s also available in a print version if you ask nicely and pay for postage.

Based at the University of Cambridge’s Millennium Maths Project, Plus has been a free online maths magazine for a good while – almost 20 years, with articles dating back as far as 1997. Plus has articles on diverse related topics, news, reviews, interviews and puzzles.

MAA’s Mathematical Monthly and MAA’s Math Horizons

The Mathematical Association of America has two regular journals, both requiring MAA membership to read online, but there are discounted student membership rates.

The Mathematical Association is a UK maths teachers’ organisation, and its magazine SYMmetry Plus, part of its Society of Young Mathematicians, is aimed at 10-18 year olds, with issues coming out three times a year. SYM members get a free copy, and it’s also available by subscription, costing around £20 for three issues.

Run by publishers Springer, the Mathematical Intelligencer is a proper journal, and while some articles require a subscription they have a subset of them available as open access.

The Royal Statistical Society runs this monthly stats-focused mag with a subscription or RSS membership, and online articles appearing a year after publication.

]]>

Here’s our annual round-up of what’s happening in sums/thinking at this year’s Manchester Science Festival. If you’re local, or will be in the area around 20th-30th October, here’s our picks of the finest number-based shows, talks and events.

**Saturday 22nd October, 7pm-9pm, Manchester235 Casino**

** Tickets £6; 18+**

Dust off your tuxedos and cocktail dresses for a night at the casino… in the name of science. This cabaret-style show explores the different scientific aspects of gambling, like the probability of winning and the psychology of body language. Plus, what happens to your brain when you gamble?

Psychologist **Paul Seager** explores deception and bluffing within the game of Poker. He talks about the use of verbal and non-verbal behavioural cues (‘tells’, in Poker parlance) in figuring out whether or not your opponents are trying to pull the wool over your eyes and steal all your chips.

Mathematician **Katie Steckles** (that’s me!) reveals the probability of drawing particular cards and dice rolls, and how you can use statistics to your advantage.

Neuroscientist **Nicola Ray** explores why gambling (in its non-addictive form) is so much fun. She’ll talk about how important brain regions are “hijacked” by the games played during gambling: the same regions that are responsible for ensuring we eat, procreate and fall in love are also the ones that ensure we keep playing even when we’re losing.

Casino Royale-style black-tie dress is optional, but warmly encouraged.

**Monday 24th-Sunday 30th October, 10am-5pm, Museum of Science and Industry**

** Drop in any time; main activities over 29th-30th weekend**

Manchester MegaPixel is part of the 2016 Manchester Science Festival, during which **I **and maths ninja **Matt Parker** will be building a gigantic pixel image display by colouring individual pixels using red, green and blue pens. This will model the way computer LCD screens use red, green and blue light to display photographs and images, but on a much larger scale!

The finished pixels will be arranged inside a large window at the museum, and will be on display for people to see the completed image. The finished MegaPixel will be over 10 metres high, and consist of around 8000 individual pixels, each of which has 300 coloured segments.

We’ll be colouring and building the pixel from **Monday 24th October**, finishing on **Sunday 30th, **and will also have other activities going on at the Museum of Science and Industry during the week, so you can learn about how image displays work, and help create the MegaPixel.

**Wednesday 26th October, 7pm-10.30pm, Pub/Zoo**

** Tickets £5; 18+**

From the brains behind Bright Club and Science Showoff comes Engineering Showoff, a chance to hear the funny side of building and looking after the structures, technology and ideas that surround us. Engineers from the north west’s universities and businesses take to the stage as stand-up comedians, sharing jokes and anecdotes from their professional lives. The gig is hosted by comedian and self-professed nerd Steve Cross.

**Thursday 27th October, 7pm-10.30pm, Museum of Science and Industry**

** Tickets free; 18+**

The Festival celebrates its 10th birthday this year – which is a very fine excuse to throw a party. Grab a slice of cake and:

Find out the scientific (mathematical tho) way to cut a cake with the Guardian’s **Alex Bellos**. Decorate your own cake and learn how to avoid a soggy bottom with **MetMunch**. Discover the secret science (maths tho) behind magic tricks with magician and ex-atomic physicist **Matt Pritchard. **Explore the psychology of why we love or loathe clowns with **Ginny Smith. **Discover the maths of chocolate fountains with **Adam Townsend. **Punch a bowl of custard and play musical chairs with **Science Made Simple. **Blow up a giant DNA double helix made of balloons with the **Museum of Science and Industry’s Explainers. **Embrace your inner child with some science-inspired face painting, and get ready to bust some moves at the **#HookedOnMusic silent disco.**

Party food will be served from the Warehouse Restaurant and the bar will be open all night.

**Friday 28th October, 6.30pm-7.30pm, Portico Library**

** Tickets £5/6/7; concessions available**

**Dr Jonathan Swinton** talks about a 1949 seminar in which pioneering mathematician Alan Turing discussed artificial intelligence (AI). It was during this seminar that some of the world’s first scepticisms about AI were raised. Can a machine think? Can it love? You’ll also hear a rare recording from 1976 by Max Newman, which discusses Turing and his work.

The participants in this Mancunian conversation were a remarkable mixture of economic migrants, asylum seekers and local talent. What combinations of thought and love attracted these thinkers to the soot-black, war-weary city? And why was Turing’s tale for so long unwritten in Manchester’s own history?

**Saturday 29th October, 7pm-10pm, Museum of Science and Industry**

** Tickets £9.50; 18+**

Miss the fun bits of your school science lessons? Then you’ll be pleased to hear that *After School Science Club* is back. Join **that** **Katie Steckles** and some colourful science stars for an adults-only evening of demonstrations and interactive fun. Plus a bar. And no homework (hurrah!).

**That Matt Parker**, television’s **Andrea Sella**, BBC Naked Scientists’ **Ginny Smith** and atmospheric scientist **Sophie Haslett** will also be there to talk to you about the science of rainbows, the rainbows of science and the maths behind colour TV. There’ll also be competition prizes, a giant painting wall and live experiments. It will (100% guaranteed) be spectrum-tacular.

**Friday 28th October – Saturday 19th November, 7.30pm & 2.30pm matinees, Royal Exchange Theatre, tickets from £16.50**

**Lecture on Saturday 29th October 5pm, free, Royal Exchange Theatre**

Can machines think? Is it possible to build a machine that thinks for itself? This classic play by **Hugh Whitemore** is set in the leafy surroundings of Bletchley Park at the height of the Second World War, where a brilliant young mathematician named Alan Turing was creating a machine to secure victory for Britain.

In the aftermath of victory, Turing arrived in Manchester with an even bigger task in mind – the development of the modern computer. It would be a task he left unfinished, publicly humiliated and destroyed by the revelation of his sexuality and prosecution for indecency. Turing’s most heroic hour is intertwined with the story of his betrayal and neglect by the nation he had helped in its darkest hour. Sheffield Theatres new Artistic Director **Robert Hastie** directs BAFTA winner **Daniel Rigby** in this major revival.

`1`

) and no glitter (`0`

) to encode binary messages in your nail varnish. We also posted an accompanying puzzle, stated as:
**Suppose I want to paint my nails on one hand differently every day for a month – so I need to use all 31 combinations involving glitter. Assuming that a nail painted with plain varnish can have glitter added, but a nail with glitter needs to be nail-varnish-removed before it can become a plain nail again, what order do I apply the different combinations so that you minimise the amount of nail varnish remover I’ll need to use?**

Here’s our take on the solution.

First of all, there’s a slightly subtle point to note – there’s a similar question you can ask, to which there is an easy and well-known answer. If instead we were asking how to minimise **the number of times I need to change a nail**, either from glitter to no glitter or back again, that’s the same as asking how to minimise the number of flips from 0 to 1 or from 1 to 0. The answer to this is to use a *Gray code*.

A Gray code – sometimes known as reflected binary code, and named after its creator Frank Gray – is an ordering of numbers such that each successive pair of numbers differ in only one bit (binary digit). Patented in 1947, it was originally designed to minimise errors in mechanical switching systems – if more than one switch has to flip to change between two numbers, they might not flip at exactly the same time, so the output might temporarily read or print out a number unintentionally. In the conventional order, binary numbers sometimes involve flipping multiple bits – such as going from 3 (`011`

) to 4 (`100`

), in which all three bits flip; the Gray code is an alternative ordering that can be worked out for any set of numbers $0 \ldots 2^n-1$ to ensure each switch is only one digit – for example, the numbers 0 to 7 can be written in the following order with only single bit-flips:

0 | `000` |

1 | `001` |

3 | `011` |

2 | `010` |

6 | `110` |

7 | `111` |

5 | `101` |

4 | `101` |

In fact, the binary combinations above are referred to as the *Gray code* for the numbers 0 to 7, in that order, so Gray code for 2 is 011 (even though that’s 3 in binary).

A Gray code for an $n$-bit sequence can be constructed from the $(n-1)$-bit Gray code, in quite a pleasing way. To go from 2-bit to 3-bit, take the sequence for 2-bit:

`00`

, `01`

, `11`

, `10`

Add a reflected version of this same string to the end:

`00`

, `01`

, `11`

, `10`

, `10`

, `11`

, `01`

, `00`

Then prefix the first half with `0`

s and the second half with `1`

s:

`000, `

`001`

, `011`

, `010`

, `110`

, `111`

, `101`

, `100`

This process can be repeated to generate the 4-bit sequence, and so on.

Since its creation, the Gray Code has been used in error correction and digital logic, and it can also be used to solve the Towers of Hanoi puzzle. As far as I know, the present work is the first application to personal grooming.

So, if I were to use the Gray Code ordering for my nails, I’d get the following sequence:

Order | Gray Code | Decimal equivalent | Order | Gray Code | Decimal equivalent | Order | Gray Code | Decimal equivalent |
---|---|---|---|---|---|---|---|---|

0 | `00000` |
0 | 11 | `01110` |
14 | 22 | `11101` |
29 |

1 | `00001` |
1 | 12 | `01010` |
10 | 23 | `11100` |
28 |

2 | `00011` |
3 | 13 | `01011` |
11 | 24 | `10100` |
20 |

3 | `00010` |
2 | 14 | `01001` |
9 | 25 | `10101` |
21 |

4 | `00110` |
6 | 15 | `01000` |
8 | 26 | `10111` |
23 |

5 | `00111` |
7 | 16 | `11000` |
24 | 27 | `10110` |
22 |

6 | `00101` |
5 | 17 | `11001` |
25 | 28 | `10010` |
18 |

7 | `00100` |
4 | 18 | `11011` |
27 | 29 | `10011` |
19 |

8 | `01100` |
12 | 19 | `11010` |
26 | 30 | `10001` |
17 |

9 | `01101` |
13 | 20 | `11110` |
30 | 31 | `10000` |
16 |

10 | `01111` |
15 | 21 | `11111` |
31 |

Each time I change from one nail to the next, I’m changing exactly one nail – either adding glitter, or removing it, and this is undeniably the most efficient way. But the question we asked in our puzzle was slightly different – since it’s much more effort to remove nail glitter than to add it, can we minimise the number of glitter removals, i.e. changes from 1 to 0?

If you’d like to try and work it out for yourself, go and do that now.

The first question you might ask is, is Gray Code the answer here too? In the list given above, there are 15 instances of switching from a 1 to a 0. But it can be done in fewer!

Our first breakthrough here was to find a solution more efficient than the Gray Code ordering, and we did find an ordering which takes 14 removes (for the record, it was 0, 2, 3, 1, 5, 4, 6, 7, 11, 10, 8, 9, 13, 12, 14, 15, 23, 22, 20, 21, 17, 19, 18, 16, 24, 26, 27, 25, 29, 28, 30, 31). But can we do any better?

It’s actually possible to prove that the lower bound on this — the fewest removals any valid solution can have — is 13. Let’s assume that each move consists of removing or adding exactly one nail’s glitter, and note that there are 31 ‘steps’ to achieve all 32 positions. If you start with no nails glittered and finish with all five glittered, the difference between the number of moves adding and removing glitter must be at most five, and therefore the minimal solution in terms of removals must have 18 adds and 13 removes making up the 31 steps.

All we need now is to actually find a way of doing it with only 13 removals. Ooh, here’s one:

Order | Binary | Decimal Equivalent | Order | Binary | Decimal Equivalent | Order | Binary | Decimal Equivalent |
---|---|---|---|---|---|---|---|---|

0 | `00000` |
0 | 11 | `01000` |
8 | 22 | `10010` |
20 |

1 | `00001` |
1 | 12 | `01010` |
10 | 23 | `10011` |
22 |

2 | `00011` |
3 | 13 | `01011` |
11 | 24 | `10111` |
23 |

3 | `00010` |
2 | 14 | `01111` |
15 | 25 | `10101` |
21 |

4 | `00110` |
6 | 15 | `01110` |
14 | 26 | `10001` |
17 |

5 | `00111` |
7 | 16 | `11110` |
30 | 27 | `10011` |
19 |

6 | `00101` |
5 | 17 | `11100` |
28 | 28 | `11011` |
27 |

7 | `00100` |
4 | 18 | `11000` |
24 | 29 | `11001` |
25 |

8 | `01100` |
12 | 19 | `11010` |
26 | 30 | `11101` |
29 |

9 | `01101` |
13 | 20 | `10010` |
18 | 31 | `11111` |
31 |

10 | `01001` |
9 | 21 | `10000` |
16 |

One obvious way to find the most efficient solution is to crunch it all through a computer: generate all the possible orderings, and count how many removals you need in each case. Of course, this would take a huge amount of computer time – the number of possible orderings is 32!, which is 263130836933693530167218012160000000, and as you can see below in the results of a simulation of 126,000 randomly-chosen orderings in R, only a tiny proportion achieve fewer than thirty removals, let alone thirteen.

So instead of relying on luck, we used a bit of *maths thinking*. The standard Gray Code that will solve you the Tower of Hanoi looks like this

\[1213121412131215121312141213121\]

where each digit represents the nail you change at each step (or which disk you move to a new peg). The problem with the standard solution for our purposes is that, starting with five unglittered nails, it doesn’t end with all fingers glittered — it ends with only digit 5 glittered. Fortunately, it’s easy to modify the sequence to change this.

Consider the simpler case of a three-fingered mathematician. They can imagine their nail-painting journey as a trip round the edges of a cube visiting every corner, with forwards and backwards movemement in each of the three dimensions correpsonding to glittering and unglittering each of the three nails. The picture below shows how the standard Gray Code solution can be modified to create a minimal-removals, no-glitter to all-glitter, solution, which on the cube corresponds to a path starting and ending at opposite corners.

Switching 1s for 2s and vice versa in the second 121 subection has done the trick here, but for the five-nails case it’s a bit more complex. It’s hard to visualise a trip round a five-dimensional hypercube, so let’s return to the digit sequence. Starting and ending at opposite corners happens if and only if each digit appears in the sequence an odd number of times (an even number of changes puts you back where you started). In the longer five-digit sequence we can still switch 1s and 2s in a 121 subsequence, but we can also switch around the 1s, 2s and 3s in a larger 1213121 subsequence, or even the 1s, 2s, 3s and 4s in one of the two big 121312141213121 chunks. A brief bit of faffing around before too long delivered this sequence:

\[1213121413121315232423212324232\]

where we’ve switched 2s with 3s in the second 1213121 chunk, and changed the 1s to 2s, 2s to 3s, 3s to 4s and the 4 to a 1 in the second 121312141213121 chunk. This sequence of digit-changes contains each digit an odd number of times, and gives the full sequence of nails tabulated above.

Having found this one solution, any equivalent solution made by permuting the five columns of binary digits will also only involve 13 removals; plus there are other tweaks you can make to the ordering using the method above. So, this solution generates hundreds of potential other 13-remove solutions. We’ve not ascertained whether all solutions that take exactly 13 can be found in this way from this one, or whether there are multiple classes out there, but this is pretty satisfying.

As always, CL-P has done his usual trick and built an interactive version of this problem, so you can play around with it for yourself and see if you can find a different solution with 13 removals:

“Principia Mathematica”, published in three volumes in 1910, 1912 and 1913, was a major work by mathematician and philosopher Bertrand Russell, with help from Alfred North Whitehead. The book contains a proof, starting from very basic axioms, that 1+1=2 – which takes over **360 pages**! It might seem excessive, but they work from only the most basic assumptions, and have to define firstly what they mean by ‘1’, ‘2’, ‘plus’, and ‘equals’. It’s all done in formal logic, and must surely be one of the longest proofs relative to the length and complexity of the statement it’s proving.

**PROOF SIZE: 0.1148 tennis courts**

- Principia Mathematica, on Wikipedia
- Russell and Whitehead, on The Story of Mathematics
- Restatement of the proof in more modern notation, at MetaMath Proof Explorer
- The proof starts on page 362 of Principia Mathematica Vol. 1

Famously one of the first proofs that required so many fiddly cases to check that its authors resorted to a computer, the Four Colour Theorem simply states that any diagram (or equivalently, any graph) drawn on a flat piece of paper can be coloured using at most four colours, so that any two adjacent parts are different colours. The original problem was stated in 1852, and while purported proofs were published in the 1880s, they were later found to be incorrect.

The first real proof, given by Appel and Haken in 1977, roughly consisted of finding a set of 1,936 minimal reducible structures that any diagram/graph that might not be four-colourable could be made up from, then checking each one by computer. Checking the maps one by one took over **1000 computer hours**, and accompanied a hand-checked component of the proof on **400 pages of microfiche**.

A shorter proof, involving a mere 633 reducible structures, was produced in 1996, and that proof was formalised in 2005 using the COQ computer proof assistant, which means it’s less reliant on cases checked by computer.

**PROOF SIZE: 1.8 times the area of an olympic swimming pool plus 370.4 watches of the film Avatar**

- Four Colour Theorem, on Wikipedia
- The Four Colour Theorem, at NRICH
- Formal Proof – The Four-Color Theorem, an article explaining the shorter COQ proof by Georges Gonthier in the Notices of the AMS (PDF)

‘The Enormous Theorem’ is always given as an alternative name for the classification of finite simple groups, but of course nobody actually ever calls it this in their work.

The classification of the finite simple groups — otherwise known as ‘CFSG’ or simply **The Enormous Theorem** — is a bit different to the other massive proofs listed here. It’s not a single work from one person or team, but rather a joint effort among dozens of mathematicians through the (nineteen-) eighties and nineties, a patchwork of results published in separate articles which together constitute the overall theorem.

A *group* is roughly speaking the set of interlocking symmetries of some concrete or abstract object, and the simple ones are those that are not ‘made by’ mashing two smaller symmetry groups together. The CFSG states that any finite simple group must be either a member of one of a set of precisely-defined infinite families of groups, or one of 26 specific outliers: the sporadic simple groups.

Wikipedia reckons that the aggregated length of the papers contributing to the proof is around **10,000 pages**. Work on a consolidated ‘second-generation’ proof, led by Daniel Gorenstein, is ongoing and is expected to result in an eleven-volume proof a mere 5,000 pages long. In fairness to the competition, it should be pointed out that these page counts are for the full articles/books, including all exposition as well as the bare proofs.

**PROOF SIZE: 1.4 basketball courts**

- Classification of finite simple groups, on Wikipedia
- An enormous theorem: the classification of finite simple groups, by Richard Elwes at Plus Magazine
- Rewriting the enormous theorem, by Rachel Thomas at Plus Magazine
- The Status of the Classification of the Finite Simple Groups, by Michael Aschbacher (PDF)

Kepler Conjecture/FLYSPECK

The Kepler Conjecture, originally posited in the 17th century by Johannes Kepler, relates to the density of spheres packed in 3D space. Kepler conjectured that the ‘cubic close packing’ (the one where you put a hexagonal grid of spheres on a flat surface and then stack another one on top, but offset so the balls are over the gaps) is the most efficient way to pack spheres in 3D space – the one with the least empty space left in between.

While it was long suspected to be true, nobody managed to formally prove it until Thomas Hales in 1998. Hales’ proof involved around **300 pages of notes** and **3 gigabytes of computer programs, data and results**. It was a ‘proof by exhaustion’ which involved checking many individual cases. Referees on the proof said they were ‘99% certain’ the proof was correct, and hence that this was the most efficient 3D packing.

But that wasn’t enough for Thomas Hales – as we covered here when it was completed, the FLYSPECK project (named as it is a Formal Proof of the Kepler conjecture, and ‘flyspeck’ is a word that contains all of those letters in that order, but it’s not as good as the word ‘flapjack’) was a further project undertaken to formalise and check the previous proof. It took from its start in 2003 until September 2014 to complete, and used proof assistants Isabelle and HOL Light.

**PROOF SIZE: 1.43 downloads of the film Titanic in HD, plus about 0.94 Harry Potter and the Prisoner of Azkabans**

- The Flyspeck project is complete: we know how to stack balls!
- Git Repo for FLYSPECK
- The Kepler Conjecture, on Wikipedia

Another recent bit of maths that’s made headlines by having a massive proof was the Erdős Discrepancy problem – back in February 2014, a proof using an SAT solver by Boris Konev and Alexei Lisitsa of the University of Liverpool hit the headlines because it was ‘the size of Wikipedia’ (around 13 gigabytes).

The problem asks whether it’s possible to come up with an infinite sequence of +1s and -1s and a ‘target’ number in such a way that you can never get past the target by adding together regularly-spaced terms from the sequence. (Going lower than minus-the-target-number also counts, in case you thought you had trumped the proof with your clever sequence of just -1s.) James Grime has explained the problem in a video with snakes and a cliff. The proof showed that in fact you can’t always make the required sequence.

Luckily, Terence Tao came to the rescue in September 2015, with a smaller hand-crafted proof developed in collaboration with the Polymath project.

**PROOF SIZE: around 3,250 holiday snaps taken on a 10 megapixel camera**

- A SAT Attack on the Erdős Discrepancy Conjecture by Boris Konev and Alexei Lisitsa
- Erdős’s discrepancy problem now less of a problem
- New Wikipedia sized proof explained with a puzzle – James Grime on YouTube
- Terence Tao has solved the Erdős discrepancy problem!

Claiming to be the ‘largest proof ever’, the Boolean Pythagorean Triples theorem relates to the question of whether it’s possible to split all numbers into two groups, neither of which contains a complete Pythagorean triple. For example, 3, 4 and 5 form a triple, and to find a valid split they would have to not all be in the same half – but then 5 couldn’t also be in the same half as 12 and 13, and so on.

It’s much better explained by Evelyn Lamb in her post in Nature, but a team of researchers have shown that not only is it not possible to do this, it’s not even possible to split the numbers 1 to 8000 in this way without getting stuck. It might not sound like ground-breaking mathematical knowledge we need right now, but it ties in to Ramsey Theory and other combinatorial questions. Proving it took 2 days for a computer running 800 parallel processors, and generated **200 terabytes of data**.

**PROOF SIZE: Amount of data generated by CERN every 2.92 days**

- Solving and Verifying the boolean Pythagorean Triples problem via Cube-and-Conquer by Marijn J. H. Heule, Oliver Kullmann and Victor W. Marek
- Two-hundred Terabyte maths proof is largest ever, by Evelyn Lamb at Nature
- Boolean Pythagorean Triples theorem on Wikipedia