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

I’m pleasantly surprised that nobody started the discussion on whether zero is odd or even ;-) https://en.wikipedia.org/wiki/Parity_of_zero


I find it hard to understand how someone can be confused about that. But I dimly remember talking to people with this confusion in the past.


Please don’t take this as defending this thinking. I’m just guessing at how someone could get to this confusion.

I can see how you’d get there by thinking of numbers as a thing for counting. Even numbers give you piles of two without one left over. Zero fails the first condition since it gives you no piles at all. But it doesn’t leave a pile of one, so it’s not really odd, either.

If you ever find yourself confused in this way about definitions consider: is this definition serving me? Could I adopt a different definition that’s used by people really good at this sort of thing?

(Zero is even because any integer n that can be formed by 2k for integer k is even, and that can be formed by 2k+1 is odd. 2x0=0)


I am fairly certain I can split an empty pile into two empty piles, without a remainder.


Hmmm by definition an empty pile is not a pile though, is it? So there's nothing to split?

;-)


And an empty plate is not a plate, also by definition? Okay, sure.


Ah I suppose if you see an "empty pile" as still a vessel with nothing on/in it, your point stands.

But a plate is its own thing, in addition to what goes on it. A "full plate" is full of what? And a full plate is the plate plus whatever is on it, not just the stuff on it.

I think of a "pile" of stuff as being it's own thing, that being the pile itself. An empty pile is the absence of the thing.

That was my interpretation, but I see what you meant. :)


Hmm, I think that's how normal people approach the question (implicitly), and that might be how they think zero is not an even number.

At least this would explain their reasoning in terms I can understand.


well that's odd


Yes, it all boils down to definitions. Definitions that have 0 as an even number work well in math.

For most people's daily life, it doesn't really matter which category zero would fall under (as they never really eg consider dividing zero items evenly between people.) So their (implied) definitions can be all over the place.


>Even numbers give you piles of two without one left over. Zero fails the first condition since it gives you no piles at all. But it doesn’t leave a pile of one, so it’s not really odd, either.

This definition does not naively extend to negative numbers, which are anti-piles of things. You are right, of course, about definitions serving their purpose. In this case maintaining the symmetry of alternation requires 0 to be even, and that argument could even be extended to negative numbers. (Of course other numbers, like the rationals and reals, are pure fiction and can safely be ignored negative or otherwise.)


> (Of course other numbers, like the rationals and reals, are pure fiction and can safely be ignored negative or otherwise.)

I think natural numbers are already pretty fictional.

Btw, you might want to look into p-adic numbers.


Your defense boils down to people having an insufficient understanding of zero as an ordinary number, and still clinging to the concept that zero means "nothing" or is otherwise magic.

This hints at a failure of math education.

As an analogy, many (usually, but not always, weaker) programmers still have magic ideas about booleans and comparison operators, and write nonsensical stuff like if (a == true). When you ask them, it's invariably that in their mind, there's mystic connection between comparison operators and if statements.


> Your defense

I literally… never mind.


Ha ha, I didn't even realize this when I typed the answer. I hope it was clear that I didn't mean to imply this was your personal opinion.


It wasn’t clear then, but I can certainly see how you’d mean it that way. It was “mine” as in “I brought it”.


> When you ask them, it's invariably that in their mind, there's mystic connection between comparison operators and if statements.

It doesn't have to be mystic. It's perfectly fine to design a language that works like this. It wouldn't be a good language, but it would be possible.

Just like PHP didn't use to support constructs like `f(10)[2]`, that used to be a syntax error. So you needed something like `x = f(10);` first, before accessing `x[2]`.

If you saw that kind of construction with the intermediate variable, you might also accuse the programmer of imagining mystic connections.


Matlab still doesn't handle f(10)(2)... (The _(_) syntax is both function calls and indexing there.)


You are giving me flashbacks to memories I thought I had successfully repressed.


It's apparently confusing enough that if you ban odd license number plates then the cops don't want to arrest anyone whose license plate ends in 0 because they're not sure if it is even or not. At least that was the case in Paris in 1977, when they alternated between odd/even license plates every day to limit the number of cars.


Interesting. Do you have a source for that?


It looks like bans for odd/even license plates were used in Paris in 2014 [1] and 1997 [2], but not before then. However, a similar scheme was used to ration gasoline in the US during the 70s [3].

The only source I can find for the claim about police confusion is the one cited by Wikipedia [4], whose reliability I'm inclined to doubt based on the 1997/1977 discrepancy.

[1] https://www.npr.org/sections/thetwo-way/2014/03/17/290849704...

[2] https://www.wired.com/1997/09/paris-smog/

[3] https://www.npr.org/sections/pictureshow/2012/11/10/16479229...

[4] https://en.m.wikipedia.org/wiki/Odd%E2%80%93even_rationing#D...


The wikipedia article matched my vague recollection of the event, but if they got the year wrong then it may as well just be a rumour at this point.


Thanks!


One might even say it's odd.


The thing that gave me pause the first time I thought about it (it was during a test so I couldn’t ask or check) was that if zero is even, that means (despite numbers being infinite) there’s one more even number than odd numbers.

I also knew that 1 is not prime, even if logically it should be. Its definition specifically states a prime number needs to be greater than 1. So that means mathematics sometimes has exceptions for numbers inside a definition.

Given that, it’s not immediately obvious that zero would be even. It wouldn’t be odd either, that was out of the questions, but it could be neither.


> The thing that gave me pause the first time I thought about it (it was during a test so I couldn’t ask or check) was that if zero is even, that means (despite numbers being infinite) there’s one more even number than odd numbers.

Thanks to Hilbert's Hotel you can re-arrange the numbers to have an arbitrarily larger or smaller overhang of even or odd numbers.

https://en.wikipedia.org/wiki/Hilbert%27s_paradox_of_the_Gra...

> I also knew that 1 is not prime, even if logically it should be. Its definition specifically states a prime number needs to be greater than 1. So that means mathematics sometimes has exceptions for numbers inside a definition.

The definition I use is that a prime number needs to have exactly two distinct divisors. No need for any special cases in this definition.

(The motivation for this somewhat strange definition is so that factoring any positive number, including 1, into a multiset of her prime factors is unique.

If you redefine the prime numbers to include 1, prime factoring is not unique. Of course, you could still make everything work out in the end: you just need to declare that your new-prime factoring is unique up to the multiplicity of 1s.

Just like eg standard decimal numbers don't change if you add leading 0s, new-prime factoring would not change if you add factors of 1.

You can do math with almost any arbitrary definitions, if you add enough exceptions and explanations in your theorems to work around the rough edges in your definitions.)


> Thanks to Hilbert's Hotel

That makes no difference to the numbers that exist, it only changes which ones you count for the duration of that thought experiment.

> The definition I use is that a prime number needs to have exactly two distinct divisors. No need for any special cases in this definition.

You’re still making up a special case with the explicit goal of excluding a particular number. It’s a roundabout definition that requires more thought and will be lost on most people which don’t already know the regular one.


I always found it funny that this is printed as a reminder text on Magic the Gathering cards that care about even or odd values: https://scryfall.com/card/iko/88/extinction-event?utm_source...

But thinking about it, I have no doubt that Wizards found out this confusion is somewhat widespread during playtesting, and printing a short reminder was an easy fix.


I particularly liked this bit

> Not only is 0 divisible by 2, it is divisible by every power of 2, which is relevant to the binary numeral system used by computers. In this sense, 0 is the "most even" number of all.

in the arena of even one-up-man-ship, zero wins.


Is that article about the IEEE 754 positive zero, or negative zero, or both?


When I was a junior developer fresh out of college, another junior and I noticed a bank sign with the temperature showing to be -0 degrees. We made a few comments about Two's Complement and felt a bit smug in our superiority over the manufacturer of the sign. Decades later I read an article about how -0 degrees is a standard in civil meteorology for "below freezing but rounded up to zero". Though it took a while to learn, it was a good lesson in making assumptions about standards in other domains.


I asked a few LLMs whether zero is an even or odd number to see how they fared on such a widely misunderstood question:

LLAMA 2 7B: 3x even, 2x neither

LLAMA 2 13B: 1x even, 4x neither

LLAMA 2 70B: 1x even, 4x neither

GPT 3.5: 20x even despite trying to trick it

Mistral 7B: 1x even, 3x neither, 1x even+neither?!

Mixtral 8x7B: 8x even, 2x neither


It seems that it is not a matter of size or processing power, but a fundamental problem of bad training data that bakes these misconceptions into the model. OpenAI is probably using a better filtered dataset and may even be able to remove some of the more common errors through alignment and fine-tuning.

I experimented a bit more and it seems that Mixtral is better than Mistral when it comes to common misconceptions. There has probably been some improvement in the training data.


This is the kind of discussion that matters only for the very theoretical edge cases or for the pop-math inconsequential discussions

0 is even

I mean, it is the first phrase on the linked fine article:

> In mathematics, zero is an even number.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: