5 ms·
I'm not sure I understand this, and I'm genuinely interested in why it would be. I find zero indexing logical: zero is the first natural number and is thus a f
by bograt 8y ago
I'm not sure I understand this, and I'm genuinely interested in why it would be.
I find zero indexing logical: zero is the first natural number and is thus a fine candidate for being the first ordinal.
In my experience most mathematical series lose nothing in terms of elegance or readability by being indexed from zero instead of using more traditional indexing from one.
- goatlover 8y agoYou find zero indexing logical most likely because you learned programming on languages which are zero-based. But most of the rest of the population, including statisticians, for which R is the intended audience, likely start at one and aren't used to OB1 errors.
- newen 8y agoIt seems needlessly confusing to me to refer to the first number in a series as the 0th number. 0-based indexing is only good for offset counting, which is very much based on having a mental model based on pointer arithmetic for a number sequence.
- samatman 8y agoWhich years are in the decade the Twenties?
- newen 8y agoYeah years start at 0. But that's because it measures the offset from the beginning of the calendar. You can similarly expand this to all distance based measurements. But that is completely different from counting, which shouldn't be conflated with distances. People always say the first of some sequence and only people who care about 0-based indexing tries to spread the 0th of some sequence meme.
- ako 8y agoWhich days are in a Month? You dont start with june 0th and end with june 29th?
- samatman 8y agoI would if I could!
- samatman 8y agoI may as well amuse myself here: My ideal calendar has 12 30 day months, days 0 to 29. If it's 10th June and you have an appointment for 0 August, that's 50 days from now. At the end of the year, a 5 or 6 day 'month' called Holiday. 30th December becomes Christmas Day (observed) and 0 January is still New Years. New Years Eve is either 5 or 6 Holiday. 6 Holiday would be a lot of fun. ^_^
- tnecniv 8y agoGenerally I've found you carry around fewer n +/- 1 type expressions when you index from 1. Also, most applied math papers I've read index from 1 and that makes implementing them a lot easier.
- Sean1708 8y ago> Generally I've found you carry around fewer n +/- 1 type expressions when you index from 1. I've actually found the opposite, though admittedly it doesn't come up often enough to be a major nuisance.
- dnautics 8y agoGenerally 1 is considered the first natural number, except bourbaki. The reason for this is the set {1...n} has order n, but the set {0...n} has order n+1, so you get lots of off by n+1 inelegancies or errors when order is important. It's better to be explicit at the set level when you need an {0...n-1} set, because usually the order gets passed around to later expressions and not the set element, so there's less algebra. Zero indexing is great when your index is an offset, as it is for true arrays.