xkcd.WTF!?

Image loading failed. try again

New Year's Eve

"Off-by-one errors" isn't the easiest theme to build a party around, but I've seen worse.

Explanation

This was the first of two New Year comics around the 2019-2020 New Year, the second being 2249: I Love the 20s.

An easy way to determine someone's age is to subtract their birth year from the current year. However, if their birthday has not happened yet that year, this calculation will predict them to be a year older than they actually are. By New Year's Eve, everybody's birthday has happened that year (or is happening, but legitimately tallied up), so this error will not occur. Cueball is excited by this, whereas most people would be more excited by the parties that typically occur around New Year's.

Off-by-one errors are commonly made in computer programming when looping over sets of objects, or when trying to count the number of items in a range. For example, suppose we have a range of integers, {10, 11, 12, ..., 98, 99, 100}. How many integers are in this set? A common temptation is to subtract the first number from the last number: 100 - 10 = 90. However, the correct answer is 91, as both endpoints are included in the set. (Or to put it another way, the sequence starts with 10, then there are 90 more numbers after that, giving a total of 91). This specific type of "off-by-one" error is called a fencepost error; as-in, a fence with ten fence segments will require eleven fenceposts to support it, but many may erroneously believe that it requires ten fenceposts (one post for each segment).

In the title text, Cueball suggests a New Year's Eve party with the theme of "off-by-one errors", saying it's challenging to build off of but that he's heard of worse. No information is given as to what such a party theme would entail, nor what could possibly be a worse party theme. (On the other hand, the parties depicted in 51: Malaria and 829: Arsenic-Based Life, based on themes of disease and poison, respectively, look much worse than an "off-by-one errors" party would likely be.)

The idea of off-by-one errors for a New Year's Eve party is inspired by the numerous discussions about the time when the next decade starts, whether 2020 or 2021. 2249: I Love the 20s also treats the subject directly.