Live data from Hacker News

1/0 = 0

hillelwayne.com

101–110 of 593 posts

Re: 1/0 = 0

#101
post #60

Some people say "oh, that's easy, 1/0 is +Infinity". So the real fun is at 0/0. The limit of x/y as x and y go to zero depends on which path across the xy plane you take towards the singularity. Along one approach, the limit is 0, along another approach the limit diverges to infinity, along yet another the limit is 17. I'm not kidding! Go to https://www.geogebra.org/3d and enter "x/y" and spin the graph around. The "…

I always thought division by zero was, at best, + and - infinity, depending on the path, which is why we leave it undefined.

How would a path lead to 17?

Re: 1/0 = 0

#102
post #80

> We’ve now established that if we choose some constant C, then defining division such that x/0 = C does not lead to any inconsistencies. There is no proof in this post that 1/0 = 0 maintains consistency. Rather, it contains refutations of one or two arguments that claim inconsistency, along with appeals to authority.

You're right. It really would've been nice for the author to offer a direct proof.

However, while I'm a bit rusty, I think it basically has to be true. For there to be an inconsistency, 1/0 = 0 must either

a) imply the negation of some previous theorem of arithmetic or

b) imply that 1/0 = x, for x != 0.

I think a) can only be true by way of b), since no existing theorem of arithmetic involves the expression y/0 for any y. I confess, I don't know the right way to prove that b cannot be a consequence, but it doesn't look like one.

Edit: I think it's just trivial to take a model of the existing axioms, then add n/0 = 0 to the division relation.

Re: 1/0 = 0

#103
Hi,

I'm on the Pony core team. I will be writing in more detail about this decision. A few short notes until then:

1) no one on the team has ever been happy with ending up here, understanding why the decision was made involved understand how partial functions (one that can produce errors like division by zero) are handled in Pony and interesting ergonomic issues that can result that is a large part of what my post will be about.

2) this applies only to integer division wherein division by zero is undefined. 1.0/0.0 uses the available Infinity value.

3) Partial function math is coming to Pony that includes 1/0 as partial (ie error producing) as well as handling integer overflow and underflow for operations: `+`, `-`, and `*`.

4) It's very straightforward even without that those operations to define your own division that will be partial (ie return an error) for division by zero.

Edit to include link to the comment below because it contains a good bit of the decisions that have to make when dealing with integer math:

https://news.ycombinator.com/item?id=17736637

Which is part of what I will touch on in my post about the decision process that Pony went through to reach to state we are currently at (which I want to highlight, is one we intend to improve- see #3 above).

Re: 1/0 = 0

#104
post #28

> But is Pony doing something unsound? Absolutely not. It is totally fine to define 1/0 = 0. Nothing breaks It actually does break something, the symmetry between division and multiplication and the many pieces of code that assume that (x / y) * y equals x. Here is a naive and non practical example, but it is not impossible to find a real world example where this simplified code manifests itself accidentally or by de…

What if number types were Optionals after any operation that could result in any kind of unusual number (sqrt(-1), Infinity, NaN)? Or maybe after every operation, since any operation could overflow the type. Do any languages do that? Seems more consistent (if way more hassle) than giving a mathematically false result out of pragmatism. At least in a strictly typed language.

JavaScript does that…

Re: 1/0 = 0

#105

This article grinds my gears. He quotes a number of mathematicians that correctly state the undefined nature of 1/0. Then proceeds to interpret that this means that we can choose any specific value to represent as 1/0 that we want. NO. We have "NaN" for a reason and it is an important signal to the programmer that a mistake was made. The language that assigns it to 0 silently is bunk as is this article.

IMHO I think the problem here is that most people focus on the "wrong side" of 1/0. I mean, what the mathematical definition of division says is not that 1/0 is indeed something and that that something is "undefined" or "NaN" or anything else really. What it says is "I cannot do 1/0, the division operation a/b does not apply when b is 0". So 1/0 is not a thing in itself in mathematics; it's something which cannot be…

The practical downside is that it might make equations go slightly wonky, rather than completely wonky if a non-number is returned.

For example, say if a zero divide happens with normalized values. Meaning the immediate result is only off by one at most. Odds of catching that are probably low. Meanwhile, a NaN will infect all numbers that come into contact with it, bubbling up faster...

Under this system, programs are easier to debug if they use bigger numbers... That property does not seem like a win to me.

If I attempt to open a file, but an access fault occurs, I'd rather be told the fault and given a chance to recover than receive an empty file.

Re: 1/0 = 0

#106

> We’ve now established that if we choose some constant C, then defining division such that x/0 = C does not lead to any inconsistencies. No, you haven't. You've merely failed to locate any. You've said "I'm not going to prove that this works. I'm going to assume that it does and act as if it did, and place the burden on you to prove otherwise."

Absolutely correct. That said, proof assistants are being used. Here's a quote from TFA:

> Lawrence Paulson, professor of computational logic and inventor of Isabelle: > > [...] This identity holds in quite a few different proof assistants now.

Re: 1/0 = 0

#107

My math is rusty but 1 / 0 := 0 implies that 0 * 0 := 1. This contradicts the definition of a binary field [1], let alone a field of real numbers. [1] https://en.wikipedia.org/wiki/GF(2) > "It is totally fine to define 1/0 = 0." No, it's not, at least not useful. If you define it that way, you will not have a field . Then you don't have +, -, *, and / operations with the commonly assumed behavior. However, it is defi…

> However, it is definitely possible to define some operation such that 1 `op` 0 := 0, just not the inverse operation of multiplication.

If you read the post this is actually exactly what the OP is saying.

Re: 1/0 = 0

#108

This article grinds my gears. He quotes a number of mathematicians that correctly state the undefined nature of 1/0. Then proceeds to interpret that this means that we can choose any specific value to represent as 1/0 that we want. NO. We have "NaN" for a reason and it is an important signal to the programmer that a mistake was made. The language that assigns it to 0 silently is bunk as is this article.

Are we reading the same FA? In the section titled "The Real Mathematicians" the author has quotes of mathematicians saying that defining division by zero as zero is OK.

Re: 1/0 = 0

#109
I think a principled mathematical way to say it is that the multiplicative structure of a field is a group object in the monoidal category of pointed sets and the smash product (with 0 as the point). So the multiplicative inverse of 0 really is 0.

Re: 1/0 = 0

#110
post #60

Some people say "oh, that's easy, 1/0 is +Infinity". So the real fun is at 0/0. The limit of x/y as x and y go to zero depends on which path across the xy plane you take towards the singularity. Along one approach, the limit is 0, along another approach the limit diverges to infinity, along yet another the limit is 17. I'm not kidding! Go to https://www.geogebra.org/3d and enter "x/y" and spin the graph around. The "…

I always thought division by zero was, at best, + and - infinity, depending on the path, which is why we leave it undefined. How would a path lead to 17?

Take the path (x,y)=(17a,a) as a goes to zero one dimensionally.
Post reply on HN