4 ms·
Ever heard someone talk about their zeroth kid, without making a programming joke? English counts objects one two three. I've never heard of a natural language
by improbable22 7y ago
Ever heard someone talk about their zeroth kid, without making a programming joke? English counts objects one two three. I've never heard of a natural language doing otherwise, we would surely translate what they say when pointing at two apples as "two".
Mathematicians of course label objects however suits the problem at hand. It's extremely common to write say c_0 + c_1 x + c_2 x^2 + ... for a taylor series starting with a constant, or start at -1 or -n if that's tidier.
- Aardwolf 7y agoNo, but mathematics is not spoken language... the origin of the number line happens to be at 0, not at 1. If you start indexing at 1, you're missing a piece. That may not be noticeable if all you do is index a fixed size thing with a manually chosen index, but as soon as you need to compute with the indices themselves, you notice it, and it's not pretty. I'm not going to say "zeroeth" in spoken language, but for any serious computation, you're going to be indexing variable sized things and need to compute the indices themselves. And I don't want to make code or formulas less readable due to shifts by 1.
- improbable22 7y agoLike I said, what's most readable is problem-dependent. Sometimes it's about modular arithmetic, but sometimes it's about not having to say Γ(n+1) too often. The number line concerns real numbers, not elements.
- userulluipeste 7y agoThis discussion provided me some food for thought. You (and the Matlab, and many other like-minded individuals) have chosen is to work with natural numbers¹ as indexes as these provide the most value for the amount of hassle. Having a 0 based index model is not really a choice the moment where one gets forced to work with the indexes themselves. That is especially when there are negative indexes to be considered, like we happen to encounter in the real world. What is the chance to go on past the integers, having a proportion or some irrational number² like π as index? ¹ https://en.m.wikipedia.org/wiki/Natural_number https://en.m.wikipedia.org/wiki/Natural_number ² https://en.m.wikipedia.org/wiki/Irrational_number https://en.m.wikipedia.org/wiki/Irrational_number