Book Read Free

Humble Pi

Page 9

by Matt Parker


  The idea behind the design is to represent the development of technology through the ages but it is not directed at doing this in a literal way. The artist wanted to convey this theme symbolically and so the number of cogs in one of the rings of the design was not a key consideration in his mind.

  – The Royal Mint

  This all seems like a straightforward closed case. I can accept that, when it comes to an artistic decision, checking that something works physically is not an artist’s top priority. I don’t complain that Picasso’s works are biologically implausible or send Salvador Dalí angry letters about the melting point of clocks.

  But still, my curiosity about how these sorts of trivial mistakes happen tugged away at me. I thought I’d just quickly research the artist and see if I could politely enquire whether the physical functionality of the design had even crossed their mind.

  What I found shocked me. On Bruce Rushin’s website is the original design which won the competition back in the late 1990s: it has twenty-two cogs. It would have worked! Somewhere in the design process, three cogs fell out.

  The centre of Bruce’s original design with the three cogs now missing from the actual coin.

  I spoke to Bruce, and he had actually been worried about the number of cogs, even though he did not think it was that important. He made his design mechanically correct not because he thought that was better but, rather, to avoid angry emails. When the Royal Mint turned Bruce’s plate-sized design into an actual coin only 28.4 millimetres across, they had to lose some of the finer details, and three cogs were the victim of this simplification.

  I did think about it, in that if one cog turns in a clockwise direction, the adjacent cogs will turn in an anticlockwise direction. However, as, after all, it is a design, not a working blueprint, it didn’t really matter. I did guess that someone out there might notice so I stuck to an even number.

  It also seems to me to sum up the difference between artists and engineers. I have artistic licence!

  I can’t decide whether I’m pleased or embarrassed that Bruce had to check the implications of his artistic vision because he knew he would get complaints otherwise. I’m a pretty big supporter of the notion that constraints help encourage creativity, so, on balance, I’m okay with it. There is always room for creativity to flourish. Even if it is pedants creatively complaining about trivial problems.

  FIVE

  You Can’t Count on It

  Counting is, arguably, the easiest thing to do in mathematics. It’s where maths started: with the need to count things. Even people who claim they are bad at maths accept that they can count (albeit on their fingers). We’ve already seen how complicated calendars can get, but we can all count and agree how many days there are in a week. Or can we?

  One of the greatest internet arguments of all time started with a simple question about going to the gym and ended with a virtual shouting match over how many days there are in a week.

  On the discussion board of Bodybuilding.com someone with the username m1ndless asked how many times a week it was safe to do a full-body workout. It seems they used to do their upper- and lower-body workouts on alternate days but now, due to a lack of time, they wanted to know if there was any risk in doing it all on the same day, making for fewer trips to the gym. I know how they feel: I split my days between geometry and algebra.

  The general advice from users all pro and Vermonta seemed to be that most beginner bodybuilding routines involved three full-body workouts a week, so that should be fine at a more advanced, strenuous level. M1ndless seemed happy with this advice and had only the one follow-on point that they work out every second day so that meant they ‘will be at the gym four to five times a week’. User steviekm3 pointed out that ‘There are only seven days in a week. If you go every other day, that is 3.5 times a week,’ and all seemed to be well with the world.

  We never hear from m1ndless again.

  Because then in walked TheJosh. They were clearly not happy with steviekm3’s statement that every other day corresponds to 3.5 times a week. In their experience, training every second day would mean they would find themselves in the gym four times a week.

  Monday, Wednesday, Friday, Sunday. That is 4 days.

  How do you go 3.5 times? Do a half-workout or something? lol

  – TheJosh

  Before steviekm3 could defend himself, Justin-27 came sweeping in to the rescue, pointing out that the correct answer was indeed 3.5 times a week on average: ‘7× in 2 weeks = 3.5 times a week, genius.’ And he chipped in that three workouts a week should be fine – the last bit of bodybuilding advice we were to see in this thread.

  TheJosh was not happy with newcomer Justin-27 disagreeing with him and he decided to spell out exactly how every other day is four times a week. Steviekm3 did briefly reappear to back up Justin-27 and defend his original statement, but he left again in a hurry. Then TheJosh and Justin-27 proceeded to argue about how many days there are in a week. Soon new people joined the argument (amazingly, from both sides) and it sprawled over five pages’ worth of message board. Five of the funniest pages on the internet.

  But how can something as obvious as the number of days in the week spawn such vitriol across five pages, 129 posts and two days of constant arguing? Well, it does, and it is spectacular. The language is also highly creative and contains many well-known expletives (and some new ones, created via the clever mash-up of classic swear words), which is why I cannot quote much of it here. Reading it online is not for the faint-hearted.

  As with all the greatest online arguments, deep down, I suspect that TheJosh is a troll, stringing Justin-27 along for the fun of seeing just how irate he can get. For a long time TheJosh doesn’t break character, before a quick ‘You took me way too serious’ rant. Then he seamlessly goes back into his earnest argument. So we cannot rule out the possibility that he was genuine. I’d like to believe he was.

  Troll or genuine: either way, TheJosh has taken a perfect stance, which is wrong yet supported by enough plausible misconceptions that it is possible to argue about it at length. Which he does, utilizing two classic maths mistakes: counting from zero and off-by-one errors.

  Counting from zero is a classic behaviour of programmers. Computer systems are often being used to their absolute limit, so programmers are sure not to waste a single bit. This means counting from zero instead of one. Zero is, after all, a perfectly good number.

  It’s like counting on your fingers, which is indeed the mascot of the easiest maths possible. But people still find it confusing! When asked what number you can count to on your fingers, most people would say ten. But they’re wrong. You can count eleven distinct numbers with your fingers: zero to ten. And this is without cheating, for example by using different number systems and holding your fingers in ridiculous positions. If you go from holding none of your fingers up to holding all ten up normally, there are eleven distinct positions your fingers can be in.

  The only downside is that you break the link between the number you are using to keep track of your counting with the number of things you are counting. The first object corresponds to zero fingers, the second to one finger and all the way up to the eleventh object being represented with ten fingers.

  If you work out on the 8th, you wouldn’t start counting the days til the 9th, because that is one day, then the 10th would be two days, and so on until you get to the 22nd, which is 14 days.

  – TheJosh (post #14)

  That is counting from zero in disguise. TheJosh has taken the 8th of the month as day zero, which makes the 9th of the month the first day he is counting. In which case, yes: the 22nd of the month is the fourteenth day to be counted. But that does not mean it is a total of fourteen days. Counting from zero breaks the link between what you’ve counted to and what the total is. Counting from zero to fourteen is a total of fifteen.

  This type of mistake is so common that the programming community has a name for it: OBOE, or off-by-one errors. Named after the symptom and not th
e cause, most off-by-one errors come from the complications of convincing code to run for a set number of times or count a certain number of things. I’m obsessed with one specific species of off-by-one error: the fence-post problem. Which is the second weapon in Josh’s arsenal.

  This mistake is called the fence-post problem because it is quintessentially described using the metaphor of a fence: if a 50-metre stretch of fence has a post every 10 metres, how many fence posts are there? The naive answer is five, but there would actually be six.

  Five sections of fence require six posts.

  The inbuilt assumption is that, for every section of fence, there is a matching fence post, which is true for most of the fence but ignores the extra fence post needed to put one at each end. It’s such a crisp example of our brains jumping to a conclusion which can be easily disproved by maths; I’m always looking out for interesting examples. Once I was coming up the escalator at a Tube station in London and I saw a sign which caught my eye. It was a real-world fence-post problem!

  There is always some part of the Tube under repair and Transport for London try to put up signs explaining why your journey is even more unpleasant than usual. On this particular morning I gave the sign on the closed escalator a glance as I had to walk up the hundreds of stairs next to it. It said that most escalators on the Tube are refurbished twice, which gives them ‘twice the life’. This is perfect fence-post-problem territory: something is alternating (escalator is used, escalator is refurbished, repeat) and it must begin and end with the same thing (escalator being used). If an escalator is refurbished twice, then it will be in use for three times as long compared to if it was never refurbished at all. The people who run the Tube forgot to mind the gap.

  Two refurbishments allow for three sections of use.

  Off-by-one errors also explain a struggle I always had with music theory. Moving along piano keys is measured in terms of the number of notes encompassed: hitting C on a piano, skipping D and then hitting E is an interval called a third, because E is the third note on the scale. But what really matters is not how many notes are used but the difference between them. This is the reverse-fence-post problem: music intervals count the posts when they should count the fence!fn1

  So, when playing the piano, going up a ‘third’ means going up two notes and going up a ‘fifth’ is going up only four notes. Put together, the whole transition is a ‘seventh’, giving us 3 + 5 = 7. Counting the dividers and not the intervals means that the note between the transitions is double-counted. It is also why an ‘octave’ of seven notes (and seven intervals) is named ‘oct’ for eight. The upside is that I can blame my terrible lack of musical ability on the numbers not behaving normally.

  When it comes to measuring time, we use a weird mix of counting posts and counting the sections of the fence. Or we can look at it in terms of rounding. Age is systematically rounded down: in many countries, a human is age zero for the first year of their life and increments to being one year old only after they have finished that whole period of their life. You are always older than your age. Which means that when you are thirty-nine you are not in your thirty-ninth year of life but your fortieth. If you count the day of your birth as a birthday (which is hard to argue against), then when you turn thirty-nine it is actually your fortieth birthday. True as that may be, in my experience, people don’t like it written in their birthday card.

  Days and hours are also done differently. I love the example of someone who starts work at 8 a.m. and by 12 p.m. they need to have cleaned floors eight to twelve of a building. Setting about cleaning one floor per hour would leave a whole floor still untouched come noon. And other countries might designate their floors differently from the way your country does it. Some countries count building floors from zero (sometimes represented by a G, for archaic reasons lost to history) and some countries go for 1. And days are counted in a different way to hours: if floors eight to twelve have to be deep-cleaned between 8 December and 12 December, there would be enough time for one floor per day.

  This problem has been going on for a very long time. It is why, two thousand years ago, the new leap years introduced by Julius Caesar were put in after three years rather than four. The pontifices in charge were using the start of the fourth year. It’s as if you need to leave some beer to ferment for the first four days of the month and you stop it on the morning of the fourth day. It has only been going for three days! The pontifices did the same thing, but with years instead of beers. If you start counting from the beginning of year one instead of year zero, then the start of year four is only three years later. Coincidentally, if you drink my homebrew beer, you will also feel like a year of your life is missing (I call it ‘leap beer’).

  This is certainly not the only maths mistake from the classical era. People two thousand years ago were just as good at making maths mistakes as we are, it’s just that most of the evidence has since been destroyed. And I think that’s what modern mistake-makers would like to see happen as well. But, digging through old records, some mistakes do come to light, including what is believed to be the oldest example of a fence-post error.

  Marcus Vitruvius Pollio was a contemporary of Julius Caesar and we know of him largely through his extensive writing about architecture and science. Vitruvius’s works were very influential in the Renaissance, and Leonardo da Vinci’s Vitruvian Man is named after him. In the third book of his ten-book series De architectura he talks about good temple building (including always using an odd number of steps, so when someone places their dominant foot on the first step they will use the same foot when they reach the top). He also talks about an easy mistake to make when positioning your columns. For a temple twice as long as it is wide, ‘those who built twice the number of columns for the temple’s length seem to have made a mistake because the temple would then have one more intercolumniation than it should.’

  In the original Latin, as well as having the columns as columnae, Vitruvius talks about the intercolumnia, or the spaces between the columns. Doubling the length of the temple does not need twice as many columns but, rather, twice as many between-column spaces. Vitruvius is warning those building a temple not to make a fence-post mistake and end up with one column too many. If anyone can find an older example of a fence-post or any off-by-one error, I’d love to hear about it.

  The problem continues to inconvenience people. At 5 p.m. on 6 September 2017 mathematician James Propp was in a Verizon Wireless phone shop in the US buying a new phone. It was for his son and, thankfully, it came with a no-questions-asked refund policy if returned within fourteen days. As it turns out, the phone was not what his son was after so, two weeks later, on 20 September, Propp senior went back to return it. But despite it being less than fourteen days since he had bought the phone, the store could not complete the return as it was now technically day fifteen of the contract.

  It seems that Verizon started counting at day one and not at day zero and they used the day number as a way to measure the passing of time. So as soon as James received the phone Verizon already figured he’d owned it for a whole day. By the start of day two, in Verizon’s system he’d had the phone for two days, even though he’d only received it about seven hours before, and so on and so on, eventually leading to James holding a phone he’d had for less than fourteen days and Verizon claiming he’d owned it for fifteen.

  In the store, there was nothing the manager could do because the Verizon system considered James to be on day fifteen of his contract and had blocked any option to return the product. But when James went home and looked through the contract small print he found that there was no wording to indicate that the first day of the contract would count as day one. Some of his relatives who were lawyers pointed out that this problem had happened before and that, legally, it is important to remove the day-zero ambiguity. In their home state of Massachusetts, the court system has to deal with this problem when it comes to court orders and so it has defined:

  In computing any period of time prescr
ibed or allowed by these rules, by order of court, or by any applicable statute or rule, the day of the act, event, or default after which the designated period of time begins to run shall not be included.

  – Massachusetts Rules of Civil Procedure, Civil Procedure Rule 6: Time, Section (a) Computation

  James appreciated that there had probably not been enough people falling foul of Verizon’s abuse of the number zero to get a class-action lawsuit together. In his case, he was able to argue the mathematics (and threaten to cancel his other contracts) until they were worn down enough to credit his account accordingly. But not everyone has the mathematical confidence or the spare time to argue their case. James proposes a day-zero rule which would mean that all contracts are required to acknowledge day zero – an initiative I fully support.

  But I don’t think it is a change we will see. Off-by-one errors have been a problem for thousands of years and I suspect they will continue to be a problem for thousands more. Much like the thread on bodybuilding.com (which looks like it was eventually locked down), I’m going to give the final word to TheJosh:

  My point was proved by smarter people. If you take a single week, not two weeks, just a single week, and work out every other day, you can work out 4 days a week, the end, stop bitching.

  – TheJosh (post #129)

  Combo breaker!

  Counting combinations can be a daunting task because the options add up very quickly and produce some astoundingly big numbers. Since 1974 Lego has claimed that a mere six of their standard two-by-four bricks can be combined an astounding 102,981,500 different ways. But to get that number, they had to make a few assumptions and one mistake.

  Their calculation assumes that all the bricks are the same colour (and also identical in every other way) and that they are stacked one on top of each other to make a tower six bricks high. Starting with a base brick, there are forty-six different ways to place each subsequent brick on top for a total of 465 = 205,962,976 towers. Of those towers, thirty-two are unique, but the other 205,962,944 pair up into copies of each other. Any of those towers can be spun around to look just like another tower. Half of 205,962,944 plus 32 gives a grand total of 102,981,504. The one mistake is that the 1974 calculator this was crunched on was not able to handle that many digits, so the answer was rounded down by four.

 

‹ Prev