Counting fence posts

Counting fence posts

There are some simple math problems that can stump a lot of people, like the “bat and a ball” question that I shared a few years ago. This is a related problem:

  • If you want to build a fence in a straight line that has 10 sections, how many fence posts do you need? The answer isn’t 10, but 11.
  • Or suppose you’re building that same fence with 10 sections, but this time with each end connected to a house. Now how many posts do you need? It’s just 9.

This kind of issue comes up quite a bit. For another example, suppose you want to deposit four checks at the bank, but you need to wait five minutes between each deposit. How long will it take? It’s not 20 minutes like it seems at first glance, but just 15.

This is commonly known as the fence post error, or the off-by-one error. When counting things like this, it’s easy to get off by one in either direction because we’re counting the wrong thing. This surfaced a few years ago with this meme that went around:

The teacher’s logic was counting the number of cuts, which is what was measured by time, but the number of boards was a slightly different equation.

Presh Talwalkar explains it very well in this video:

This problem shows up in computing quite frequently, because computers often start counting at 0. If you have a program that was counting 4 apples, it would have a “3” saved in that spot because counting to four goes:

0,1,2,3

It’s a super easy mistake to make in all of those scenarios, and it’s something I’ll try to keep in mind when fence post-related questions pop up in the future.

Jonathan Bill

Owner, SBS Accounting & Advisors | Transforming Small Business

4 个月

Good reminder that as business owners, we can think we have the right answer, when we don't. So, important to slow down and double check our facts.

要查看或添加评论,请登录

Mickey Mellen的更多文章

  • Using AI to prepare for meetings

    Using AI to prepare for meetings

    I recently came across an interesting AI prompt that I’ll likely start using every Friday as I look forward to the week…

    3 条评论
  • Google only uses 20% of your links

    Google only uses 20% of your links

    When Google first came on the scene back in 1998, their big innovation that changed the world was simply looking at…

    4 条评论
  • Are you eagerly sending business to your competitors?

    Are you eagerly sending business to your competitors?

    The title of this post might seem a little odd, but if your company has solid positioning then you should be turning…

    8 条评论
  • You train an animal, you teach a person

    You train an animal, you teach a person

    With the rise of AI and robotics, the need to “train” a person is fading quickly. Jobs that can be easily trained are…

    4 条评论
  • The ability to have a good day is my favorite attitude in others

    The ability to have a good day is my favorite attitude in others

    We all have some good days and some bad days, but some people tend to have more good days than others and it’s often…

    4 条评论
  • AI bots talking to each other is very inefficient

    AI bots talking to each other is very inefficient

    The podcast series “Shell Game” was quite eye-opening to me, where host Evan Ratliff created an AI bot of himself and…

    3 条评论
  • Branding is building a story

    Branding is building a story

    When people think about branding, they often think about logos and colors. Those are important aspects to a brand, but…

    4 条评论
  • What is considered spam?

    What is considered spam?

    The definition of spam and cold calls is pretty simple — it’s outreach that the recipient didn’t ask for. If you do…

    6 条评论
  • Great logos are often just brands that you admire

    Great logos are often just brands that you admire

    Think about a great logo. A truly classic logo.

  • Two more big steps in de-Googling

    Two more big steps in de-Googling

    Over the last year I’ve taken a lot of little steps to de-Google my life. I won’t be able to escape Google completely…

    4 条评论

社区洞察

其他会员也浏览了