9 ms·
Numbering should start at π (2025) (umars.edu) Seriously, it all depends on whether u're counting the items themselves (1-based) or the spaces btwn them (0-bas
by nivertech 2y ago
Numbering should start at π (2025) (umars.edu)
Seriously, it all depends on whether u're counting the items themselves (1-based) or the spaces btwn them (0-based).
The former uses natural numbers, while the latter uses non-negative integers
For instance, when dealing with memory words, do u address the word itself or its starting location (the first byte)?
The same consideration applies to coordinate systems: r u positioning urself at the center of a pixel or at the pixel's origin?
Almost 2 decades ago I designed an hierarchical IDs system (similar to OIDs[1]). First I made it 0-based for each index in the path. After a while I understood that I need to be able to represent invalid/dummy IDs also, so I used -1 for that. It was ugly - so I made it 1-based, & any 0 index would've made the entire ID - invalid
---
1. https://en.wikipedia.org/wiki/Object_identifier https://en.wikipedia.org/wiki/Object_identifier
- jacksnipe 2y agoZero is a natural number. It is in the axioms of Peano arithmetic, and any other definition is just teachers choosing a taxonomy that best fits their lesson.
- deleted 2y ago[deleted]
- jmkr 2y ago+1 for peano arithmetic club. I never realized it was controversial. I think I've always included 0 in the nat numbers since learning to count. But there are some programming books I've read, I want to say the Little Typer, or similar, that say "natural number" or "zero". Which makes actually confuses me.
- nivertech 2y agoIMO zero represents an absence of quantity and doesn't appear in Nature, so it cannot be classified as a Natural number Just like a negative numbers, it's a higher-level abstraction or a model, not a direct observation from the Nature Likewise, the digit "0" originating from the Hindu-Arabic numeral system[1] is merely a notation, not a number --- 1. https://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system https://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_s...
- feoren 2y ago> zero represents an absence of quantity and doesn't appear in Nature From one point of view, zero never appearing in nature is exactly an example of it appearing in nature! From another point of view, do you not think a prairie dog has ever asked another prairie dog, "how many foxes are out there now?" with the other looking and replying "None! All clear!"? Crows can count to at least 5, and will count down until there are zero humans in a silo before returning to it. Zero influences animal behavior! From a third point of view, humans are natural, so everything we do appears in nature. From a fourth point of view, all models are wrong, but some models are useful. Is it more useful to put zero in the natural numbers or not? That is: if we exclude zero from the natural numbers, do we just force 90% of occurrences of the term to be "non-negative integers" instead?
- nivertech 2y ago> From another point of view, do you not think a prairie dog has ever asked another prairie dog, "how many foxes are out there now?" with the other looking and replying "None! All clear!"? type PrairieDogFoxCount = NoFoxesAllClear | SomeFoxes 1..5 | TooManyFoxes type CrowCount = Some 1..5 | UpsideDown 5..1 type HumanProgrammerCount = 0..MAXINT type HumanMathematicianCount = 0..∞ My point is: "No Foxes - All Clear" is not the same thing (the same level of abstraction) as 0. > From a third point of view, humans are natural, so everything we do appears in nature. using this definition everything is Natural, including fore example Complex numbers, which is obviously incorrect, and thus invalidates yr argument > From a fourth point of view, all models are wrong, but some models are useful. Is it more useful to put zero in the natural numbers or not? That is: if we exclude zero from the natural numbers, do we just force 90% of occurrences of the term to be "non-negative integers" instead? all models are wrong, but some are really wrong If all u care is the length of the terms, i.e. "Natural" vs "non-negative integers", then what's wrong with 1-letter set names, like N, W, Z ? I think the usefulness of including 0 into the set of natural numbers is that it closes the holes in various math theories like [1,2] 1. https://en.wikipedia.org/wiki/Peano_axioms https://en.wikipedia.org/wiki/Peano_axioms 2. https://en.wikipedia.org/wiki/Set-theoretic_definition_of_natural_numbers https://en.wikipedia.org/wiki/Set-theoretic_definition_of_na...
- JadeNB 2y ago> Zero is a natural number. It is in the axioms of Peano arithmetic, and any other definition is just teachers choosing a taxonomy that best fits their lesson. It is, but it need not be. In the category of pointed sets with endofunctor, (Z_{\ge 1}, 1, ++) and (Z_{\ge 0}, 0, ++) are isomorphic (to each other, to (Z_{\ge 937}, 937, ++), and to any number of other absurd models), so either would do equally well as a model of Peano arithmetic.
- MITSardine 2y agoI may be misunderstanding your argument, but if it's that of a simple offset, then only the one starting from 0 forms a monoid (a group without an inverse to each element). Though, of course, you could redefine the + operation...
- JadeNB 2y ago> I may be misunderstanding your argument, but if it's that of a simple offset, then only the one starting from 0 forms a monoid (a group without an inverse to each element). Though, of course, you could redefine the + operation... Yes, agreed, there is other algebraic structure that can tell the difference, but Peano arithmetic by itself cannot.
- jacksnipe 2y agoI think I’m missing something here. PA defines x * 0 = 0 for all x. So while we could take (Z+, 1, ++) as a model of it, we would be imposing a completely different definition of multiplication than the usual. Would this not be simply choosing to label 1 as 0 and work from there?
- JadeNB 2y ago> I think I’m missing something here. PA defines x * 0 = 0 for all x. So while we could take (Z+, 1, ++) as a model of it, we would be imposing a completely different definition of multiplication than the usual. Would this not be simply choosing to label 1 as 0 and work from there? Despite the name, in the usual mathematical meaning of the term, Peano arithmetic does not define arithmetic at all, only the successor operation, and everything else is built from there. Once we have those, for the model (Z_{\ge 0}, 0, ++), we certainly usually do define x0 = 0 for all x; and, you're right, if for the model (Z_{\ge 1}, 1, ++) we defined x1 = 1 for all x (as no-one could stop us from doing), then we'd just be dealing with "0 by another name." But it might be equally sensible, if our model of Peano arithmetic is (Z_{\ge 1}, 1, ++), to define x1 = x for all x, in which case we recover the expected arithmetic.
- cbolton 2y agoThere is no consensus on that, and it's not just about teachers. It depends on the mathematical field and tradition. It usually starts at 1 in German, at 0 in French due to the influence of the Bourbakis, and in English I think it's more field-dependent. The original formulation of Peano started at 1.
- throwway120385 2y agoThe center of the debate is that outside of pure mathematics numbers and number systems can only be signifiers for some physical or conceptual object. It is the signified object that determines the meaning of the number and the semantics of the mathematics.
- School-Cotton 2y agoWhy do you write “you” as “u” here? I don’t want to be rude, but it’s very jarring to see juvenile txt-speak in a serious discussion.
- sunshinekitty 2y agoit’s not that serious
- deleted 2y ago[deleted]
- the_andrei 2y agou must be fun at parties
- theoreticalmal 2y ago“serious discussion” notwithstanding, I thought the “u’re” was particularly interesting. Why not “ur”? “u” is obviously easier to write, so why worry about properly contracting it? Just interesting imo
- em3rgent0rdr 2y agoAbbreviations can only be useful when they're unambiguous within their context. Maybe “u’re” is unambiguous here, but “re” might have been a step too far to still know what word writer was abbreviating.
- JadeNB 2y agoMaybe “u’re” is unambiguous here, but “re” might have been a step too far to still know what word writer was abbreviating. The question was about contracting “u’re” to “ur”, as is commonly done in text-ese, not to “re”.
- ibash 2y agoIt wasn’t clear to me what “u’re” was and I wouldn’t have understood without the comment. I’m a native English speaker.
- 01HNNWZ0MV43FF 2y agoThat makes sense for the ID system or a database, but for arrays in a language I still prefer starting at 0. It makes frame buffers easier easier to index
- nivertech 2y agoI prefer thinking from the first principles, and not according to the current computer architecture fashion. And BTW that ID system was used in the system processing PBs of data in realtime per day back in the early 2000s, so it’s not that it was super-inefficient.
- pwdisswordfishz 2y agoWell, EWD gave a solid argument from first principles, which you choose to ignore.
- littlestymaar 2y ago> The former uses natural numbers, while the latter uses non-negative integers In fact “natural numbers” is ambiguous, as it can both contain zero or exclude it depending on who uses it. See https://en.m.wikipedia.org/wiki/Natural_number https://en.m.wikipedia.org/wiki/Natural_number
- y42 2y agoI totally disagree, but it's only my opinion and probably not scientific at all. From a logical point of view I think it's totally unnatural to start at 1. You have 10 diffferent "chars" available in the decimal system. Starting at 1 mostly leads to counting up to 10. But 10 is already the next "iteration". How do you explain a kid, who's learning arithmetics, that the decimal system is based on 10 numbers and at the same time you always refer to this list from 1 to 10.
- nivertech 2y agoDecimal system is simply a notation chosen by Humans to communicate and preserve information, it’s not a Law of Nature. Also you use a circular reasoning.
- goatlover 2y agoI think it's totally natural to start counting at 1, because you start with one of something, not zero. How do you explain to a kid that although they're counting objects, the first one is labelled zero, and that when they've counted 10 objects, they use the number 9?
- patrickthebold 2y agoThe reminds me of the pain I felt seeing how the blacktop was painted at the local elementary school: They had a 6 x 6 grid with 26 letters, then the digits 1-9, then an extra X to fill in the space left over. :facepalm:
- bmacho 2y agoNumbering should start at π (2025) (umars.edu) It's funny because pi is the joke compromise between 0 and tau, the circumference of the unit circle, and the period length of the trigonometric functions.
- bmacho 2y agoI think we can pretend now that anyone talking about pi is just being sarcastic? It is such a random and useless number, a perfect candidate for a funny meme
- jonahx 2y ago> Seriously, it all depends on whether u're counting the items themselves (1-based) or the spaces btwn them I've never heard the distinction stated this way. It's clarifying.
- pfortuny 2y agoActually, the duality arises from counting (there can be 0 items) and ordering (there is only a 1st item), conceptually. Which is why the year 2000 can and cannot be the start of the 3rd millenium, for instance.
- xeonmc 2y agoFun fact: the words Ordinal and Cardinal respectively derives from Ordering and Counting. So Ordinal quantities represent the ordering of coordinates and can be negative, while Cardinal quantities describes the counting of magnitudes and must be positive. You can transform between ordinal domains and cardinal domains via the logarithm/exponential function, where cardinal domains have a well-defined “absolute zero” while ordinal domains are translation-invariant.
- jonahx 2y agoI don't follow the distinction you're making. The number line is ordered and contains a 0.... The GP's explanation seems more fitting for the year 2000 ambiguity. Are you measuring completed years (celebrate millenium on NYE 2001) or are years the things happening between 0 and 1, 1 and 2, etc (celebrate on 2000, because we're already in the 2000th "gap")?
- pfortuny 2y agoOrder as in "first, second, third", whereas counting is "none, one, two". This is not a formal distinction, it is a conceptual one for things (not mathematical models).
- jonahx 2y agoThought about this a bit more... Not sure if this is what you're saying, but the concept of "space between" I alluded to seems to arise naturally whenever you have ordered items, and vice versa. Because once you have order you have the concepts "greater than"/"less than", and once you have that you have a border between your items, and your items are between those borders. This connects back to Dijkstra's consideration of <, <=, etc....