Timeline for Why is 0 false?
Current License: CC BY-SA 3.0
25 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 2, 2017 at 19:16 | history | edited | Deduplicator | CC BY-SA 3.0 |
added syntax-highlighting
|
| May 16, 2013 at 21:33 | comment | added | artem | @NeilG because it's convenient to associate set with a number that equals to the number of elements contained in the set. Makes remembering rules much easier :-) | |
| May 16, 2013 at 16:21 | comment | added | Giorgio | @Robert Harvey: Maybe we mean the same: Whatever names you use, the moment you have a set with two elements and the operations from boolean algebra (OR, AND, NOT) you will always get the same structure. This is why the bits in bitwise operations and the truth values have the same behaviour. | |
| May 16, 2013 at 15:52 | comment | added | Robert Harvey |
@Giorgio: 0 | 1 = 0 is bitwise math. It's the way every processor on the planet calculates it. It doesn't require an assumption that 0 is false and 1 is true, although in practice that is the usual interpretation.
|
|
| May 16, 2013 at 12:51 | comment | added | Peter Taylor |
This argument just about works for abusing bitwise | as a Boolean operator but it breaks down for & and ^ because of the existence of distinct non-zero values.
|
|
| May 16, 2013 at 12:29 | comment | added | Giorgio |
"FALSE OR TRUE is TRUE, because 0 | 1 is 1": I do not quite understand this: 0 | 1 is set to be equal 1 once we decide that 0 is FALSE, 1 is TRUE, and | is OR. That's why they are the same. Or how do you define | otherwise?
|
|
| May 16, 2013 at 8:32 | comment | added | shambulator | @NeilG Good point; I suspected I'd missed something important :P | |
| May 16, 2013 at 8:30 | comment | added | Neil G | @shambulator: In your example, you would have had the same problem with the regular correspondence; does True or True = False? The regular definition is 1: True, 0: False, Or: Saturating addition, And: Multiplication. In the reversed definition, we flip both pairs of labels. | |
| May 16, 2013 at 8:24 | comment | added | shambulator |
@NeilG How does your reversed definition extend to the OP's question, which considers any nonzero value to represent true? If 0 is true and anything else is false (which seems to me a more accurate mirror image of the original question), am I missing something when I write 1 + (-1) == 0, therefore false and false == true? Or is it just a case of having to choose operators with different semantics? And if it is, does that not get closer to answering why 0 is historically "false" - because the other way around requires "special" operators?
|
|
| May 16, 2013 at 6:13 | comment | added | Neil G | @artem: Why not associate 1 with the empty set, and with False? | |
| May 16, 2013 at 1:56 | comment | added | artem | @Neil G. No, not because of convention. How many elements are in empty set? | |
| May 16, 2013 at 1:20 | comment | added | Giorgio | @Morwenn: Maybe not by all programmers, but by programming language designers. | |
| May 16, 2013 at 0:50 | comment | added | Neil G | @artem: "does not seem natural" …because of convention. :) | |
| May 15, 2013 at 23:34 | comment | added | artem | @Neil G When OR is associated with addition, 0 corresponds to empty set. Choosing otherwise just does not seem natural. | |
| May 15, 2013 at 21:59 | comment | added | phant0m | @Robert It'd be great if you could spell out the "mathematical underpinnings" in your post. | |
| May 15, 2013 at 21:56 | comment | added | Neil G | Why couldn't you define OR so that it corresponds to multiplication and AND so that it is a saturating addition? | |
| May 15, 2013 at 21:52 | comment | added | Robert Harvey | @NeilG: The rules aren't abitrary; there's a mathematical underpinning to them. | |
| May 15, 2013 at 21:51 | comment | added | Neil G | Exactly: the math works both ways and the answer to this question seems to be that it is purely conventional. | |
| May 15, 2013 at 21:49 | comment | added | Robert Harvey | @NeilG: I can call spaghetti macaroni, but it's still spaghetti, even though both are pasta. | |
| May 15, 2013 at 21:49 | comment | added | Neil G | I don't see why the math doesn't work the other way if you merely change all of the definitions so that AND is + and OR is *. | |
| May 15, 2013 at 21:19 | comment | added | HLGEM | @Morwenn, I would hope the people who designed the orginal languages understood the math. In fact I would bet on it since computer science came from the field of mathematics. People like this designed the orginal languages (note her mathematics experience) en.wikipedia.org/wiki/Grace_Hopper | |
| May 15, 2013 at 20:04 | history | edited | Robert Harvey | CC BY-SA 3.0 |
deleted 1 characters in body
|
| May 15, 2013 at 20:03 | comment | added | user4828 | @Morwenn, it goes back to the 19th century and George Boole. People have been representing False as 0 and True as !0 for longer than there have been computers. | |
| May 15, 2013 at 19:57 | comment | added | Robert Harvey | The languages are designed like that because the math makes sense. That came first. | |
| May 15, 2013 at 19:52 | history | answered | Robert Harvey | CC BY-SA 3.0 |