January 2, 2020

Welcome to the '20s

When does a decade begin and end? Answer: whereas a decade can reference any ten years, THE decade is a period spanning years "xxx0" to "xxx9". In fact, a new decade has just begun. But some confuse the beginning and ending years. If so, they are usually victims of a very common logic error.

Welcome to the '20s

Published January 02, 2020 || Updated January 09, 2020

Happy New Year! Happy New Decade!

Humans are stupid

More correctly: humans are too smart for their own good.

When we logically divide something—a distance, a length, a period of time, etc.—the human brain will often second-guess itself when, (a) counting the boundaries defining the divisions, (b) counting the divisions (sections, intervals), and (c) sensibly labeling (indexing) both the boundaries and intervals. This second-guessing often leads to an error where the index or count are off by one—sometimes by more, but most often off by one. This logic error is common enough there's a name for it.

The Off-by-One Error

Answer this question:
If you build a straight fence 30 meters long with posts 3 meters apart, how many posts do you need?

A common answer would be, "10 of course!" But 10 is how many "intervals" or "sections" there are, not how many "boundaries", i.e., the number of required fence posts. The question is asking about boundaries and not intervals: there are 11 boundary points (posts).

In computer-science we call this a off-by-one error and it leads to all kinds of issues, bugs, and security problems.

The 60s, 70s, and 80s

For whatever reason, there was a small debate on social media recently about when a decade ends. I believe, if I parsed the 'debate' correctly, the statement was that we are still in—as of 2020—the previous decade. This is nonsense of course, but let me explain why.

The debater proclaimed that the context could be that decades begin on years ending in 1 (2011) and end on years ending on 0 (2020). This made most everyone's brain hurt as you would probably expect. The '60s were from 1960 to 1969, and certainly not 1961 to 1970. Similarly, the last decade began at midnight, Jan 1, 2010 and extended through to 11:59, Dec 31, 2019. The arrival of 2020 at midnight Jan 1 ended the decade. 2020 is not part of the previous decade.

This brain-freeze happens because people confuse intervals with boundaries and counts with indexes: counting between the fence posts versus referencing the fence posts themselves (or vice versa). Confusing count with index (or vice versa) can quickly lead you to second-guess yourself.

This particular social media 'debate' was rather silly, ended with some embarrassed mumbling and people wandering about confusedly scratching their heads, but I thought the dialogue illustrated an interesting topic. The concept of a decade is generally not where most people trip over the off-by-one error, but there are plenty of other cases where we run into this problem.

We reinforce this error when we design things

Ever get into an elevator and see 1G instead of just 1 or G? The designers of elevators in the United States generally label the ground floor as the first floor. But since the designers recognize (probably subconsciously) that the number scheme doesn't quite make sense, they have to add the G. Otherwise there is not enough context when just glancing at the buttons.

Outside of the United States, where societies have adopted measurement standards that are a bit more sane (the metric system, for example) elevators are far more likely to have the first floor labeled as floor 0, with a default meaning that this floor is the ground floor. Floors below ground are negatively numbered and floors above ground are positively numbered. This sort of labeling (indexing the floors) is far simpler and adds so much clarity. If no other context is required (if, for example, there are 2 ground floors and some parking decks) then 0 means ground floor by default. Once you see it, the meaning becomes obvious.

My hypothesis is that the braindead floor labeling in US elevators is a by-product of legacy design choices. The elevator was not invented in the US, but people-moving elevators really got their start here (in New York, actually). I suspect that design inertia from those early elevators is the reason for the same poor design becoming so prevalant in the United State (i.e., 'cuz that's the way it has always been done). Nearly every elevator in the United States has all the floors reflecting this "off by one" logic error in design. Due to this faulty context, more labeling is therefore required to compensate. Newer elevators are slowly fixing this issue, but the majority of elevators in the United States are still labeled as such. Also, consider the collateral effects: if you label floor 0 as the 1st floor in the elevator, what do you number the rooms on that floor? 0xx or 1xx?

Let's talk time!

The 16th century refers to the 1500s, i.e., the years 1500 to 1599. What the heck?

The 16 in "16th" is an example of the count and not the index of the century along the timeline. The 1500s is century number 15 (the index), but is also the 16th century (the count). Similarly, year 0000 to year 0099 represents century number 0 (the index), but also the 1st century (the count). It is almost always clearer to state the index (the 1500s, century 15, or century number 15) instead of the count (the 16th century), depending on your audience. Most people have to actively do the translation in their head when they encounter "the 16th century" label instead.

If we did something similar with decades, the 60s (1960 to 1969) could be referenced as the 7th decade of the 20th century. But it usually isn't spoken of in this way simply because that's just not how we talk about those eras.

A note about year number 0000: for our (all of humanity's) calendaring system, we follow an international standard called ISO 8601. It is a refinement of the Gregorian Calendaring System we used to follow. One of the biggest changes the standard made to the Gregorian model was adding a year 0000 to the timeline. The Gregorian Calendar started the common era at year 0001 and had no concept for the 0th year.

Additionally, the ISO 8601 refers to years prior to year 0000 in the negative context: -0001, -0002, -0003, etc. The Gregorian Calendar refers to years prior to year 0001 as BC: 0001 BC, 0002 BC, and years including and after 0001 as AD: AD 0001, AD 0002, etc. As the Gregorian Calendar spread around the globe in years past, the more secular BCE (Before Common Era) and CE (Common Era) have replaced BC and AD.

We may have moved on to ISO 8601, but BC, AD, BCE, and CE are still used rather prevalently. Too much so IMHO, but we rarely have to be truly precise about whether we are talking about the same moment when we say "11 BCE" and "year -0010".

Let's talk time: midnight!

A day starts off at midnight and ends right prior—but not at—midnight the next day. How many times have you stated "Oh! Last night at 2am I did blah blah blah"? Or how many times have you responded to the question "What time did you go to bed yesterday?" with the answer "3am" but not meaning yesterday, and instead meanting today? If an alien were listening in, they would infer you meant "3am" the previous morning. But what you really meant was "Ugh! I didn't get to bed until 3am this morning." Or "Ugh. I finally got to bed at 3am today."

Midnight starts for any new day. At midnight, it the next day begins even though we may have not gone to bed yet and it may feel like the previous day has not ended yet. By extension, at precisely midnight, on January 1, the prior year ends and the new year begins.

When that speakers (or writers) make reference to these timeframes colloquially, we generally understand their intent and automatically correct for the imprecision in expression. It's when our activities span intervals and boundaries that we begin to second-guess ourselves, especially when the context is imprecise enough that the meaning could equally err one way or another.

We are all prone to this logic error

Let's discuss some of my construction projects. I can't tell you how many times I have had (for example) to divide lumber evenly 5 ways but instead mis-calculated and ended up with either too few or too many pieces (4 or 6 instead of 5). Compound that with a 2x4 piece of lumber instead having dimensions ~1.5x~3.5-inches, and you can quickly make many errors.

Answer this question:
How many cuts are needed to divide an 8 foot rope into four equal lengths?

You are tempted to say two. But the answer is three: There are two ends and three places to cut (five fence posts), resulting in four segments of rope.

Off-by-One. The next time you have to make a decision or express yourself based on how something is divided, make sure you double-check your work because we all trip over this off-by-one logic error from time to time.

Whew! I am sure that was far more than you wanted to read on the topic, but I hope you found some of it interesting. Cheers!

Hey! Get out there and celebrate! Today is January 2nd, 2020. Welcome to the '20s! . . . the NEW '20s.

Please add todd+ruminations[at]errantruminant.com to your contacts and