Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

how conditioned the mankind is that they call the "0th" ordinal number by the name "first"

It really isn't. How many elements does a collection have, if it only has a 0th element? Is it 0? What about the size of a collection [0th, 1st, 2nd]? Or [0th .. 100th]? In language, we use 1-based indices for collections because we enumerate the elements based on counting them. A zeroth element doesn't exist, because if we had 0 elements, the collection would be empty.

Indexing of natural collections is based on cardinality, not ordinality.



> Indexing of natural collections is based on cardinality, not ordinality.

You are exactly right. But does it make sense? I'm not sure. "if it only has a 0th element" isn't in my mind, a relevant question in the context of cardinality, since the answer is the same if it only has the "1th" or "2th" or "3th" element. (Sorry, picked up the habit of "misusing" "th" from another post in this thread.) The base case of indexing is "the start of the list" whereas the base case of cardinality is "empty collection". But should you define the concept of indexing by making an equivalence between cardinality and indexing by "cardinality of collection of elements from the start of a list to the current element (inclusive)" is, in my mind, something that doesn't _necessarily_ make sense.

I admit that it's awfully lot about choices and habits, but at least I find "unpacking" the arguments this way interesting and educational.


Can a collection both exist and be empty at the same time?


Yes, when your collection is whatever is inside a box.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: