Fencepost error
Math & Computing
Category: Math & Computing
In short
Confusing the number of intervals with the number of dividers and counting one too many or one too few.
The story
To build a 10-meter fence with a post every meter, you need 11 posts, not 10. In programming this one-off mistake is extremely common, and it’s called a fencepost error, after fence posts, or an off-by-one error. Japanese schoolchildren drill exactly this trap in “tree-planting arithmetic” word problems.
The lens
How many days is it from the 3rd to the 5th? Climb the stairs from the 1st floor to the 10th, and how many flights is that? Off-by-one traps lurk throughout daily life. Maybe that’s why we learn these puzzles in school.
Drop it casually
“A business trip from the 3rd to the 5th means two nights, and I booked three. A fencepost error.”