More on this book
Community
Kindle Notes & Highlights
by
Matt Parker
Read between
July 1 - July 15, 2022
What the Microsoft, air-traffic control, and Boeing systems all had in common is that they were 32-bit binary-number systems, which means the default is that the largest number they can write down is thirty-two 1s in binary, or 4,294,967,295 in base-10.
It’s believed Boeing’s system used such “signed numbers,” so, with the first spot taken,* they only had room for a maximum of thirty-one 1s, which translates into 2,147,483,647. Counting only centiseconds rather than milliseconds bought them some time—but not enough.
Thankfully, this is a can that can be kicked far enough down the road that it does not matter. Modern computer systems are generally 64-bit, which allows for much bigger numbers by default. The maximum possible value is of course still finite, so any computer system is assuming that it will eventually be turned off and on again. But if a 64-bit system counts milliseconds, it will not hit that limit until 584.9 million years have passed. So you don’t need to worry: it will need a restart only twice every billion years.
And now for a niche fact. There is an oft-repeated statement that the Julian calendar years of 365.25 days were too long compared to the Earth’s orbit. But that is incorrect! The Earth’s orbit is 365 days, 6 hours, 9 minutes and 10 seconds: slightly more than 365.25 days. The Julian calendar is too short compared to the orbit. But it is too long compared to the seasons. Bizarrely, the seasons don’t even exactly match the orbital year.
As the Earth orbits, the direction it is leaning also changes, going from pointing directly at the sun to pointing away every 13,000 years. A calendar perfectly matching the Earth’s orbit will still swap the seasons every 13,000 years.
The movement of the Earth’s tilt buys us an extra 20 minutes and 24.43 seconds per orbit. So the true sidereal (literally, “of the stars”) year based on the orbit is longer than the Julian calendar, but the tropical year based on the seasons (which we actually care about) is shorter. It’s because the seasons depend on the tilt of the Earth relative to the sun, not on the actual position of the Earth.
Thankfully, if there’s one thing a pope can do, it’s convince a lot of people to change their behavior for seemingly arbitrary reasons.
Luigi’s breakthrough was to keep the standard every-fourth-year leap year of the Julian calendar but to take out three leap days every four hundred years. Leap years were all the years divisible by four, and all Luigi suggested was to remove the leap days from years which were also a multiple of 100 (except those that were also a multiple of 400). This now averages out to 365.2425 days per year; impressively close to the desired tropical year of around 365.2422 days. Despite it being a mathematically better calendar, because this new system was born out of Catholic holidays and promulgated by
...more
When the English forces landed on Île de Ré on July 12, 1627, as part of the Anglo-French War, the French forces were ready to fight back on July 22. That is, on exactly the same day. At least, for both armies, it was a Thursday.
This means that our current Gregorian calendar will drift a whole day once every 3,213 years. The seasons will still reverse once every half a million years. And you will be alarmed to know that there are currently no plans to fix this!
But astronomy does give Julius Caesar the last laugh. The unit of a light-year, that is, the distance traveled by light in a year (in a vacuum) is specified using the Julian year of 365.25 days. So we measure our current cosmos using a unit in part defined by an ancient Roman.
3:14 a.m. on Tuesday, January 19, 2038, many of our modern microprocessors and computers are going to stop working.
This is one of many popular internet memes claiming that something happens only every 823 years. I have no idea where the number 823 came from. But for some reason, the internet is rife with claims that the current year is special and that this specialness will not be repeated for 823 years. Now you can safely reply and say that nothing in the Gregorian calendar can happen less frequently than once every four hundred years. JUST FOR FUN. And, given that there are only four possible month lengths and seven different starting days, there are actually only twenty-eight possible arrangements for
...more
In February 2007, six F-22s were flying from Hawaii to Japan when all their systems crashed at once. All navigation systems went offline, the fuel systems went, and even some of the communication systems were out. This was not triggered by an enemy attack or clever sabotage. The aircraft had merely flown over the International Date Line.
In the mid-1990s, a new employee of Sun Microsystems in California kept disappearing from their database. Every time his details were entered, the system seemed to eat him whole; he would disappear without a trace. No one in HR could work out why poor Steve Null was database kryptonite.
But there is one thing Excel is not, and that is a database system. Yet it is frequently used as one.
For a start, just because something walks like a number and quacks like a number does not mean it is a number. Some things that look like numbers are just not. Phone numbers are a perfect example: despite being made from digits, they are not actually numbers. When have you ever added two phone numbers together? Or found the prime factors of a phone number? (Mine has eight, four distinct.) The rule of thumb should be: if you’re not going to do any math with it, don’t store it as a number.
But a phone number has important digits all the way down. I would be happier if we called them “phone digits” instead of “phone numbers,” because, I repeat, I don’t think they are numbers. If you’re ever not sure if something is a number or not, my test is to imagine asking someone for half of it. If you asked for half the height of someone 180 centimeters tall, they would say 90 centimeters. Height is a number. Ask for half of someone’s phone number, and they will give you the first half of the digits. If the response is not to divide it but rather to split it, it’s not a number.
As well as converting non-numbers into numbers, Excel will sometimes take things that are numbers and convert them into text. This applies mainly to unusual numbers that go beyond our normal base-10 counting system.
When they ran out of digits, mathematicians realized that letters were a perfect source of more symbols and already have an agreed order. So they conscripted them into number service, much to the confusion of everyone else. Including Excel. If you try to use a letter as a digit in Excel, it reasonably assumes you’re typing a word, not a number.
If computers are obsessed with binary numbers, their next love is base-16 numbers. It’s really easy to convert between binary and base-16 hexadecimal numbers, which is why hexadecimal is used to make computer binary a bit more human-friendly; the hexadecimal 4C47 represents the full binary number 0100110001000111 but is much easier to read. You can think of hexadecimal as binary in disguise. It was used in the SQL injection example before, to hide computer code in plain sight.
came out, Microsoft was asked for comment, and a spokesperson said, “Excel is able to display data and text in many different ways. Default settings are intended to work in most day-to-day scenarios.” Such a great quote. It comes with a heavily implied “gene research is not a day-to-day scenario.”
I like to imagine the Microsoft spokesperson delivering their reply in a press conference while someone behind the scenes has to physically restrain the Microsoft Access team, which is an actual database system. Through the walls can be heard muffled cries of “Tell them to use a real database LIKE AN ADULT.”
This tragedy led to a numerical quirk of the Apollo missions. Even though the spacecraft never launched, the mission with Gus Grissom, Edward White II, and Roger Chaffee was retrospectively named Apollo 1 out of respect for them, rather than keeping its codename, AS-204. Officially, the first actual launch should have been named Apollo 1, but AS-204 was declared to be the first official Apollo flight, despite the fact that it “failed on ground test.” This had a weird follow-on effect because, now, two previous crewless launches (AS-201 and AS-202; AS-203 was a payloadless rocket test and so
...more
On this last, broken level, the mutant fruit has obliterated loads of the dots, so Pac-Man can never eat the required 244 dots and is doomed to wander what is left of his broken maze until boredom sets in and he succumbs to the ghosts pursuing him. Which, coincidentally, is almost exactly how a lot of programmers feel as they try to finish writing their code.
Because of the limitations of binary, computers are consistently close, but not quite. Like any food product with “diet” in the title, it’s always a bit off.
In September 1997, the cruiser USS Yorktown lost all power because its computer control system tried to divide by zero. It was being used by the navy to test their Smart Ship project: putting computers running Windows on warships to automate part of the ship’s running and reduce the crew by around 10 percent. Given that it left the ship floating dead in the water for over two hours, it certainly succeeded in giving the crew some time off.
The prevalence of military examples of math going wrong is not because the armed forces are particularly bad at mathematics. It’s partly because the military is big on research and development, so they are at the bleeding edge of what can be done, which tends to invite mistakes. Moreover, they have some level of public obligation to report on things that go wrong. Obviously, a lot of undoubtedly fascinating math mistakes never get declassified, but within private companies, even more mistakes are completely hushed up. I’m largely limited to talking about mistakes that have been openly reported
...more
you want something unlikely to occur, you simply need the patience to create enough opportunities to allow it to happen. Or, in my case, patience, a coin, a lot of free time, and the kind of obsessive personality that keeps you sitting in a room flipping a coin by yourself, despite the desperate pleas of your friends and family to stop.
I have an uneasy relationship with probability. There is no other area of mathematics where I am as uncertain about my calculations as I am when I’m working out the chance of something happening.
This only serves to confirm my theory that everything is better with an Undo button.
It seems the first human whose name has been passed down through millennia of history was not a ruler, a warrior, or a priest . . . but an accountant.
But which part of city living is recorded in our longest-surviving mathematical documents? Brewing beer. Beer gave us some of humankind’s first calculations. And beer continues to help us make mistakes to this very day.
It was shut down within an hour, but once the dust had settled, Knight Capital had made a one-day loss of $461.1 million—roughly as much as the profit they had made over the previous two years.
One theory is that the main trading program accidentally activated some old testing code, which was never intended to make any live trades—and this matches the rumor that went around at the time that the whole mistake was because of “one line of code.”
Knight Capital had to offload the stocks it had accidentally bought to Goldman Sachs at discount prices and was then bailed out by a group including investment bank Jefferies in exchange for 73 percent ownership of the firm. Three-quarters of the company gone because of one line of code.
And They Would Have Gotten Away with It Too, If It Weren’t for the Meddling Laws of Physics
The fastest times possible for data to travel from the Fed building, as allowed by the laws of physics, are 3.18 milliseconds to Chicago and 1.09 milliseconds to New York. Which makes it mighty suspicious that trades happened in both Chicago and New York simultaneously at 2:00 p.m., when the Federal Reserve’s data was released on September 18, 2013.
but between 1992 and 2001, the median CEO pay for companies in the S&P 500 Index in the US rose from $2.9 million a year to $9.3 million (inflation-adjusted to 2011 dollars)—a threefold real increase in a decade. Then the explosion stopped. A decade later, in 2011, the median CEO pay was still around $9 million a year.
The massive CEO pay packages still awarded today are a fossil of when company boards didn’t do the math.
It seems that, if the Trump administration couldn’t change the ACA itself, it was going to try to change how it was interpreted. It’s like trying to adhere to the conditions of a court order by changing your dog’s name to Probation Officer.
The ACA had laid down very clear guidelines stating that insurance companies could not charge older people premiums that are more than three times the premiums paid by young people. Theoretically, medical insurance should be a game of averages, the goal being that everyone should share the burden equally. The ACA tried to limit how much insurance companies could stray from that ideal. It seems the Trump administration wanted to allow insurance companies to charge their older customers up to 3.49 times as much as younger people, using the argument that 3.49 rounds down to 3. I’m almost
...more
But just because a number can be rounded to a new value does not make it the same number. They might as well have crossed out thirteen of the twenty-seven constitutional amendments and claimed nothing had changed, provided you rounded to the nearest whole constitution.
Even when the market seemed to be doing great, the Vancouver Stock Exchange Index continued to drop. By November 1983 it closed one week at 524.811 points, down by almost half its starting value. But the stock market had definitely not crashed to half its value. Something was wrong. The error was in the way that computers were doing the index calculations. Every time a stock value changed, which happened about three thousand times a day, the index would be used in a calculation to update its value. This calculation produced a value with four decimal places, but the reported version of the
...more
Overnight, in November 1983, the index jumped from the incorrect 524.811 up to the newly recalculated 1098.892. That is an increase of 574.081 overnight*
If there are enough numbers being rounded a tiny amount, even though each individual rounding may be too small to notice, there can be a sizable cumulative result. The term “salami slicing” is used to refer to a system by which something is gradually removed one tiny unnoticeable piece at a time. Each slice taken off a salami sausage can be so thin that the salami does not look any different, so, repeated enough times, a decent chunk of sausage can be subtly sequestered.
And I’d like to make it clear I’m not just trying to get the phrase “functional sausage” into this book to win a bet.
One embezzler within a bank wrote software to take twenty or thirty cents out of accounts at random, never hitting the same account more than three times in a year. Two programmers in a New York firm increased the tax withheld on all company paychecks by two cents each week but sent the money to their own tax-withholding accounts so they received it all as a tax refund at the end of the year. There are rumors that an employee of a Canadian bank implemented the interest-rounding scam to net C$70,000 (and was discovered only when the bank looked for the most active account to give the owner an
...more
So while increases in accuracy give us correct world records for the hundred meters, increases in precision give us more records.
But the rumor is that Sikdar’s original number was 29,000 feet exactly. In this case, all those zeros were significant figures—but the public would not see them as such. They would assume the value was “about 29,000 feet.” And people might not accept a new claim for title of tallest mountain on the planet if the calculations looked insufficiently precise. So an extra two fictitious feet were added. At least, that is how the story goes. The official recorded height in 1856 was definitely 29,002 feet, but I cannot find any evidence that the initial calculations gave 29,000 feet exactly. Or even
...more