# Start of a New Decade - Zero-based numbering and the Fence Post Problem

There is a little discussion here and there on the internet about if the new decade starts today or next year, 2021. Seems a bit on the silly side but it did cause me to look up the name for the numbering system that starts with zero.

It’s called zero-based numbering.

In the U.S the ground floor is the first floor but in Europe it floor zero. Starting with zero is also common in computer science.

There is a problem that has tripped me up several times with mile post markers and in other situations. From Wikipedia it turns out that it has a name. The Fencepost error or off-by one.

Learning How to Count (Avoiding The Fencepost Problem)

Counting isn’t easy. Suppose your boss wants you to work from 8am to 11am, and mop floors 8 to 11. Simple - it’s one floor per hour, right?

Nope! There are 4 floors to mop (8, 9, 10 and 11) but only 3 hours to work (8-9, 9-10, and 10-11).

Whoa – we count floors and hours differently? You bet. And somehow, if the boss said “Mop floors 8 to 11 on April 8th to 11th” everything would be ok.

2 Likes

And I can’t tell you the number of design reviews, program text reviews, and debugging sessions I’ve been in where somebody (including myself) has got it wrong.

Cheers,

Earl

2 Likes

The discussions are often silly (especially up to the millennium change in 2000), but the problem has a real origin.

It goes back to 523 AD when the monk Dionysius Exiguus ‘calculated’ the Nativity of Jesus and declared it as the year 1, a one-based numbering. The years before were probably ‘lost’ years and of no interest.

However, what should be and what is really are not always identical. Now, it is accepted everywhere, when the significant digit changes (the tens, hundreds or thousands) the new decade etc. begins.

Another problem subsists:

Many centuries after Exiguus, someone decided to number the BC-years too, an adjacent, negative one-based numbering. The year 0 got lost or was omitted; with our numbering the year BC 1 is followed by the year 1 AD, or written otherwise, year -1 is followed by year +1.

With the positive and negative temperatures of +1° and -1° F or C, the difference is calculated (+1)-(-1) = 2°. Our date system does not allow calculating around the BC/AD limit.

Astronomers, to calculate a historic phenomenon like an eclipse or a conjunction, used their own calendar with the year 0000 existing. Later, with the calculators, they left our dates, in the solar system they calculate with Julian Days (JD), the number of days since the start of the scale on January 1, BC 4713 at 1200 UTC.
Today, January 2, 2020, is JD 2,458,851.

3 Likes

Oh, sorry, look at the time, it’s 20200103T135916Z Unix time, sounds fascinating but I’ve got to run.

That’s UTC

In Unix it is currently 1578060396

In sundial, it’s… cloudy.

1 Like

Yes, you’re right. Should have used GPS time: 2086:482356.636

The integer part of the Julian Day is only the day count.

Including the time part in double precision we have now, January 3, 2020 at 21:00:16 UTC
= JD 2458852.37518519

With the true correction for the earth’s instable rotation speed (ΔT or delta T) we have
= JDE 2458852.37600694

Didn’t “1” used to be considered a prime number? Then it got changed? Pluto was a planet then not a planet.

The thing with the dates is it’s just a definition, not some deep truth. The fix could be to make the “first” decade 9 years. Or if that’s not acceptable than it could be years -1 through 9.

I have read the opening post several times and end up concluding it is all about defining starting points and what is being measured. Semantics can easily trip one up if common definitions aren’t used.

Mile markers go from west to east and south to north. If the highway starts at the state line, mile 0 is on the western state line, and the total length from the western state line to the eastern state line would be the mile marker close to the state line. If a highway doesn’t start at the state line, mile 0 is either the westernmost or southernmost beginning point of that highway.
The key is the unit of measure between two points and not the number of points. People count the first step after the first step is taken, not while standing still before walking.

To be honest I never really thought about this. Generally in most of the buildings I have been in the first digit is the floor identifier with regards to office number. I have been in a few buildings where in the elevators the ground floor was “L(obby)” and they counted up from there (1,2, 3 etc).

This is why semantics play important part in giving directions. The instruction “mop floors 8 to 11” could be interpreted by some (or many) as mop floors 8, 9, 10 and stop at 11. Just as when you run a race, you run to the finish line. There is no point in running after that. It would have been clearer if the boss said “mop floors 8 thru 11”.

In other words, the distinction between the cardinal number (how many/much) and ordinal number (what position).

Mixed in with a little theory of how to analyze things—step one, establish and apply a coordinate system—including an origin (0) and a unity (increment=1). Want to say a decade ends after the 9th year, whatevs…

And if you thought the issue of whether 1 is prime(it isn’t) was annoying then wait till you consider factorials. 2 factorial (2!) =2x1, 3!=3x2x1=6

0!=1

The linked Wikipeida is good on the Off-by-one error. It is partly a problem of semantics but the root of the problem is that while it is in fact a simple problem the error is made by assuming it is so simple it requires no effort, only simple intuition.

If you build a straight fence 30 meters long with posts spaced 3 meters apart, how many posts do you need?

The naive answer 10 is wrong. The fence has 10 sections, but 11 posts.

No difficulty if you think about it a bit.

A straight fence with n sections has n+1 posts.

1 Like

A full grasp of zero’s importance would not arrive until the seventh century A.D. in India. There, the mathematician Brahmagupta and others used small dots under numbers to show a zero placeholder, but they also viewed the zero as having a null value, called “sunya.” Brahmagupta was also the first to show that subtracting a number from itself results in zero.