I just put this page here so that I could have menu items “Posts” and “Rails”, because of the double pun afforded by (blog) Posts / (rants and) Rails versus (fence) Posts / (fence) Rails.
Post and Rail problems are a class of potential out-by-one issues that occur in software. The basic idea is that for a straight fence, the number of posts required is one more than the number of rails (really, gaps between the posts),
![](https://aprendo.co.uk/interestingthings/wp-content/uploads/2020/04/straight_fence-1.jpeg)
P = 2
R = 1
P = R + 1
but on a circular track, the number of posts is equal to the number of rails.
![](https://aprendo.co.uk/interestingthings/wp-content/uploads/2020/04/circular_fence-1024x603.jpeg)
P = 18
R = 18
P = R
It’s not complicated – but then out-by-one issues are rarely complicated, they’re just surprisingly common.
Nothing whatsoever to do with these rails; although now that we’re here…
![railway lines](https://aprendo.co.uk/interestingthings/wp-content/uploads/2020/04/rails.jpeg)
P ≈ ∞
R ≈ ∞
P ≈ R
…meaning that an infinitely long straight line is pretty much the same as an infinitely big circle.
End of post!