You have from 1 pm to 4 pm to work on homework assignments for subjects #1 to #4. If you complete one assignment per hour you should get them all done on time. Yes or no?

Now how about if you have from 1 May to 4 May to complete them? Can you get away with completing one assignment per day?

These kinds of problems lead to more questions [1]. Why are hours and days counted differently? Where should we start counting from anyway? Applying what we learn in school is never as simple as it seems – even with something as simple as counting.

To set things straight, let's go back to preschool. We learned to count starting from one, two, three … and we also learned that this counting process lets us know how many things there are – pencils, houses, or days. To save time we can just let the labels do the counting for us: The days of the month in June are labelled 1 to 30, so there are 30 days [1].

When we get to subtraction, the teacher holds up six pencils and takes four of them away one by one to demonstrate that 6 – 4 = 2. Subtraction is an arithmetic operation, meaning an action ("operation") is applied to change the number of objects: In this case, the act of taking a pencil away. Now we are considering a slightly different concept, the span between two numbers. This isn't the same as the numbers themselves! Once we are introduced to the number line, we get to represent the subtraction 6 – 4 = 2 as four arrows bumping down from 6 to 2:

It's clear that this refers to the four "spans" between 2 and 6. But the operation actually "touches" five numbers: 2, 3, 4, 5, 6.

The discrepancy between four and five is the fencepost error. Suppose on the way to preschool you pass by an eight-metre fence with posts every two metres [2]. How many fenceposts are there? You might do the mindless division operation and think this means there are four fenceposts in the fence. But in an ordinary fence, with fenceposts at each end, there are actually five. (Is your fence really ordinary? We'll return to this later.)

What went wrong? There are two possible things you can count in this problem: the number of segments of fence between posts, or the number of posts. When you do the division, you start with the total length of the fence (eight metres) and divide by the length of a segment. That will give you an answer of the number of segments of fence. But the question was about the fenceposts, not the fence segments. That means that when dealing with these kinds of problems, the important question is whether you need to count the numbers or the spans [1].

Once you can distinguish between fence segments and fenceposts, it's quite easy to see the oddities in everyday counting conventions. In music theory, a third denotes an interval of three notes: C-D-E is a third, and so is E-F-G [2]. When you put them together you get C-G, a fifth. In other words, two thirds make a fifth. This is the same as making a longer fence out of two existing fences: You'll find that there is an extra post left over since the "post" E has been counted twice. The issue is that thirds and fifths refer to the spans between notes but are named for the number of notes they contain: They count the posts instead of the segments [3].

Similarly, fence segments can be disguised as fenceposts. When you celebrate your birthday what you’re actually celebrating is the number of years you were alive [2, 3]. You can even see it in the wording that most people use: On the first birthday you celebrate, you turn one year old. The years are the fence segments; the birthdays are the fenceposts.

In our original problems, you have four assignments to complete and what you need to do is match them with four time spans in which you can complete them. That means you have to consider the fence segments in the problem. In the wording of the problem, the times 1 pm, 2 pm, 4 pm are markers of time (fenceposts) while the days 1 May, 2 May, 4 May are time spans (fence segments) [4]. One gives a span of three hours, the other a span of four days. That's why your cramming session can fit into one schedule but not the other.

A related problem that this also raises is whether your count starts at zero or one [3]. We all know that the first floor can refer either to the ground floor or the floor above it depending on what country you are in. You have ten fingers, but it is possible to count 11 numbers with your fingers: Everyone forgets to include zero fingers [3]. But these are mostly linguistic conventions. More interestingly, think about labelling a series of fence segments #1, #2 … and so on and consider the question of how to label the fenceposts: It naturally requires a fencepost somewhere marked #0. (If you think of the fence segments as timespans spent alive, in years, and the fenceposts as birthdays then this all becomes a version of our birthday discussion above, in which the day of birth can be considered as the zeroth birthday.) This is where many of the problems of confusing fenceposts and fence segments come into play. For this reason, if you reread our original problems about the eight-metre fence, you can see that the question of whether to start counting from zero is tied to whether you want to count fence segments or fenceposts. Counting fence segments is easy. Counting fenceposts requires you to remember that extra zero – zero fingers, the zeroth floor, the zeroth birthday – and add one accordingly [1].

So once again it's very important to know the context of your question: Should you count the numbers or the spans; fenceposts or fence segments? What kind of fence are you dealing with? Just to leave you with something to think about, suppose the eight-metre preschool fence actually stretches between two walls and doesn't need posts at either end. Or maybe it closes up to form an enclosure. How many posts are needed now?


  1. Azad, K. (2009, April 28). Better Explained: Learning How to Count (Avoiding the Fencepost Problem). Retrieved from
  2. Propp, J. (2017, November 16). Mathematical Enchantments: Impaled on a fencepost. Retrieved from
  3. Parker, M. (2019). Humble Pi: A Comedy of Maths Errors. London, UK: Allen Lane.
  4. Lamb, E. (2016, May 10). Roots of Unity: How to Confuse a Traveling Mathematician. Retrieved from

Author: Peace Foo, Student Editor, Science Focus, The Hong Kong University of Science and Technology
Design: Samantha Ng, Graphic Designer, Science Focus, The Hong Kong University of Science and Technology
Translation: Daniel Lau, Managing Editor, Science Focus, The Hong Kong University of Science and Technology

June 2023