nikhil.io

Numbering from Zero

Dijkstra on why numbering should start from zero.

Numbering is done with natural numbers. Let’s take zero to be the smallest natural number1. For the sequence (2, 3, 4, … ,12), using the convention (2 ≤ n < 13) is appropriate because

  • For a sequence starting with zero, like (0, 1, 2, 3), the left hand condition leaks into unnatural numbers if you use “less than”: (-1 < n).
  • For an empty sequence, the right hand also leaks into the unnatural if you use “less than or equal to”: (n ≤ 0)

And minorly, because these are the true of another convention (1 < n ≤ 12)

  • Difference between bounds (13 - 2 = 11) is the length of the sequence
  • I know that these two sequences are adjacent: (2 ≤ n < 13) and (13 ≤ n < 24)

All that’s prep for:

When dealing with a sequence of length N, the elements of which we wish to distinguish by subscript, the next vexing question is what subscript value to assign to its starting element. Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤ i < N. So let us let our ordinals start at zero: an element’s ordinal (subscript) equals the number of elements preceding it in the sequence. And the moral of the story is that we had better regard – after all those centuries!2 – zero as a most natural number.

There’s also this little nugget

I think Antony Jay is right when he states: “In corporate religions as in others, the heretic must be cast out not because of the probability that he is wrong but because of the possibility that he is right.”

  1. TIL that this can be so.↩︎

  2. Don’t know what he means here…↩︎