Live data from Hacker News

1/0 = 0 (2018)

hillelwayne.com

181–190 of 245 posts

Re: 1/0 = 0 (2018)

#181
> one rule I try to follow is do not mock other programmers.

I like that. I try to live by a similar protocol.

On topic: Each context has the right to establish their own rules.

If the rules work, the context survives. If not, then the context dies.

Re: 1/0 = 0 (2018)

#182

Yes, it's all good and nice that your types are sound and you don't have panics, but I feel like this could get you in trouble in the real world (gleam also uses this division convention, and people very much use gleam for "real world" things). Suppose you took an average over an unintentionally empty list (maybe your streaming data source just didn't send anything over the last minute due to a backhoe hitting a fibe…

[deleted]

Re: 1/0 = 0 (2018)

#183
post #12

This article invents a new binary operation, calls it "division" and uses the "/" operator to denote it. But the article repeats multiple times that this new operation isn't a multiplicative inverse, so it's not actually division. For example, (a/b)*b=a isn't true for this new operation.

[deleted]

Re: 1/0 = 0 (2018)

#184

This is all well and fine, but feels like a lot of words to say "it's a matter of definition". The question is what definitions will be useful and what properties you gain or give up. Being a partial function is a perfectly acceptable trade-off for mathematics, but perhaps it makes it difficult to reason about programs in some cases. I suppose the aim of the article is to point out the issue is not one of soundness,…

[deleted]

Re: 1/0 = 0 (2018)

#185
post #69

Earlier quoted context omitted.

Saying 1/0=∞ means creating a new number system with ∞ as a number. Now you have to figure out all operations with ∞, like -1*∞, 0*∞, ∞*∞, ∞/∞, or ∞-∞. Making wrong definitions creates contradictions. With 1*x=x, ∞/∞=1, the associative property x*(y/z)=(x*y)/z, and ∞*∞=∞: ∞ = ∞*1 = ∞*(∞/∞) = (∞*∞)/∞ = ∞/∞ = 1

But why would we go from what obviously should be a very large boundless number and just replace it with 0. Our few comment discussion is why it’s undefined in a nutshell.

The main issue lies in weakening the field axioms to accommodate any strange new numbers. Instead, defining division by 0 to 0 adds no new numbers, so the field axioms don't change (x/x=1 still requires x≠0). I hope you see the value in extending field theory instead of changing field theory.

If we add new numbers like ∞, -∞, and NaN (as the neighbor comment suggests with IEEE754-like arithmetic), now x/x=1 requires x≠0, x≠∞, x≠-∞, and x≠NaN. Adding more conditions changes the multiplicative inverse field axiom, and thus doesn't extend field theory. Also, now x*0=0 requires x≠∞, x≠-∞, and x≠NaN. What a mess.

Re: 1/0 = 0 (2018)

#186

EDIT: markup broke my operators In combinatorics and discrete probability, `0**0 = 1` is a useful convention, to the point that some books define a new version of the operator - let's call it `***` - and define `a***b = a**b` except that `0***0 = 1` and then use the new operator instead of exponentiation everywhere. (To be clear, `**` is exponentiation, I could write `a^b` but that is already XOR in my mind.) So one…

In analysis, you also use 0**0 = 1 all the time. It's the only sensible convention for power series.

It's really just a bit unfortunate that (x, y) -> x**y is not continuous at (0, 0).

Re: 1/0 = 0 (2018)

#187

I've always wondered what would happen if we defined /0 as a new symbol, for example 'z'. The same as we define sqrt(-1) as 'i'. So if you can do 4*sqrt(-1)=4i, you could also do 4/0 = 4z. These two seems similar, as in taking something that should not exist, and just letting it exists in a totally different and orthogonal domain. I tried once to investigate the implications, but it quickly became far more complex th…

You might want to look into wheels (https://en.wikipedia.org/wiki/Wheel_theory).

Re: 1/0 = 0 (2018)

#188

Earlier quoted context omitted.

i would not expect 1/0 to be zero. as you divide by smaller numbers, the quotient gets bigger, so i can't understand why someone would expect /0 to be zero.

If I have five apples and were to divide them among 0 people then nobody gets anything and I can eat them all, so the proper solution would be 5.

In other words, the quotient is 0, the reminder is 5?

That's an interesting solution...

Re: 1/0 = 0 (2018)

#189

Earlier quoted context omitted.

Negative zero is equal to zero, so it's not really a distinct number, just another representation of the same value.

It's equal (as in, comparing them with == is true), but they are not the same value. At least in IEEE 754 floats, which is what most languages with floating point numbers use. E.g., in JS: > 1 / 0 Infinity > 1 / -0 -Infinity > 0 === -0 true > Object.is(0, -0) false

I think you're misunderstanding me. They are the same value, but a different representation. The equivalence of the value can be shown with math, and has nothing to do with the implementation details of IEEE 754.

Re: 1/0 = 0 (2018)

#190

Sounds legit, infinity is singular and so is 0. I think one problem is also that division isn't the only mathematical operation which can produce dubious results. E.g. sqrt(x), arctan(x) which have multiple branches which is why there is often a separate arctan2(x, y) to select the correct branch. Oh well and then there's just addition which silently overflows in almost every programming language. Without arbitrary p…

Hilbert's Hotel shows nicely that infinity can't be singular.

Yeah but this is basically about countable and uncountable sets. It's rather counter-intuitive that the rational numbers are countable. So it's possible to create even a bijective mapping between rational numbers and natural numbers. On the other hand real numbers (which number types in programming languages try to approximate) are uncountable
Post reply on HN