Live data from Hacker News

1/0 = 0

hillelwayne.com

461–470 of 593 posts

Re: 1/0 = 0

#461
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 "…

Since the "1/0 = 0" is only defined for integer division then I'd argue that the chosen constant should be MAX_INT. (or MIN_INT in case of signe values and negative numerator)

Re: 1/0 = 0

#462
post #238

> But is Pony doing something unsound? Absolutely not. It is totally fine to define 1/0 = 0. Nothing breaks and you can’t prove something false. Everybody who was making fun of Pony programmers for being ‘bad at math’ doesn’t actually understand the math behind it. This is playing semantic games. A whole lot does break: / no longer has its usual properties, and if you use those usual properties you can certainly prov…

What usual properties does 1 / 0 = 0 break?

That dividing by a number means a multiplicative inverse for that number exists. That a * (b / c) is always equal to b * (a / c). All the things the article goes through.

Re: 1/0 = 0

#463

Earlier quoted context omitted.

My comment from when this came up on Reddit, slightly edited for context: `/`-by-0 is just an operation and it tautologically has the semantics assigned to it. The question is whether the specific behaviour will cause bugs, and on glance that doesn't sound like it would be the case. Principally, division is normally (best guess) used in cases where the divisor obviously cannot be zero; cases like division by constant…

An example well-defined use case is if you want to compute a harmonic mean, e.g. x = 2/(1/a +1/b) This is a form of average where you are giving increased importance to the smaller number. It frequently pops up in science/engineering, e.g. in hydrology when you are computing flow of water underground. In this case, it's "obvious" that when e.g. a is zero, you want 1/a to be zero so you simply return b. There's typica…

"In this case, it's "obvious" that when e.g. a is zero, you want 1/a to be zero so you simply return b"

b obviously isn't what you want from this harmonic mean when a is 0. And in any case x will be 2b if 1/a is 0, not b.

Re: 1/0 = 0

#464

> 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."

Wrong. Division is not part of the field axioms, it is a defined function, and changing its definition has absolutely no bearing on the consistency of your equational theory.

Re: 1/0 = 0

#465
post #72

My problem with "1/0 = 0" is that it's essentially masking what's almost always a bug in your program. If you have a program that's performing divide-by-zeroes, that's almost surely something you did not intend for. It's a corner case that you failed to anticipate and plan for. And because you didn't plan for it, whatever result you get for 1/0 is almost surely a result that you wouldn't want to have returned to the…

It happens in scientific computing with zero bounded signals fairly regularly. Sometimes values hover close enough to zero that the computation results in a/0. It's not desired but the only alternative is a guard that invariably adds a performance penalty. There are other ways around it, such as normalization, but they're not trivial depending on the problem and can actually add other sources of bugs/errors. I unders…

1/a when a is close to zero is very large. 1/0 == 0 violates the limit and is just bad math.

Re: 1/0 = 0

#466

Earlier quoted context omitted.

Take the limit as x goes to 0 of (17*x)/(x). Both numerator and denominator go to 0, so this is a representation of 0/0. The limit is then equal to 17.

This just means that 0/0 = 1. It doesn’t mean that any number / 0 tends to 17.

But think about what a limit is. Think of X and Y as their own functions. so something more like X(g) / Y(g). As g increases, X and Y can take any path across the plane that they want. We get to arbitrarily choose what X and Y are. All we are doing is describe how our limit behaves as we slide along the scale towards infinity. Just because g increased by went from 10 to 11 doesn't mean that X and Y behaved the same way. We can arbitrarily choose X and Y such the limit as g approaches infinity is 0 for both, but the way that X and Y are changing is different. Like the example above, if we choose X and Y such that X(g)/Y(g) is 17 for all g, but the X and Y both approach 0 as g approaches infinuty, then as g approaches infinity X and Y go to 0, but X / Y (0 / 0), goes to 17. It's not a true 0/0, because the functions we chose got to 0 at different rates.

Re: 1/0 = 0

#467
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 like your point here. I think 1/0 = Infinity+ is a satisfying expression. Its a clear concept which can be visualized in a simple graph. I think 0/0 is a different concept than 1/0. It's a different expression. 0/0 doesn't explicitly express a particular "path" on the graph. We can call it (0/0) different names if we want. They can say 0/0 = "undefined". I am currently satisfied with 0/0 simply equals to 0/0, or si…

> I think 1/0 = Infinity+ is a satisfying expression. Its a clear concept which can be visualized in a simple graph.

Not for integers.

Re: 1/0 = 0

#468

Earlier quoted context omitted.

x=170, y=10 x=17, y=1 x=1.7, y=0.1 x=0.17, y=0.01 The answer keeps being 17, even as x and y both get vanishingly close to zero. I encourage you to play around with a 3D graphing calculator and see all the different paths you can take along that surface to reach the singularity. They all "reach" it at different heights.

you are explaining why 0 / 0 can approach 17, this is much less controversial, and is often considered the bottom element...

17 is a bottom element?

Re: 1/0 = 0

#469

Earlier quoted context omitted.

but with floating point units, 1.0/0.0 is infinity.

That's not correct mathematically though. You can't divide something 0 times and get any number. Adding zero + zero + zero infinite times does not equal 1.

"That's not correct mathematically though."

Yes, certainly it is.

"You can't divide something 0 times and get any number. Adding zero + zero + zero infinite times does not equal 1."

The discussion is about mathematics, not elementary school arithmetic.

Re: 1/0 = 0

#470

Earlier quoted context omitted.

Maybe all this talk about fields is a distraction? Integer arithmetic isn't a field anyway. Other than 1 and -1, no integer has a multiplicative inverse that's an integer. Integer division just isn't the same operation as division on rationals or reals. The same laws don't apply. (For floats, division by zero can return Inf, -Inf or NaN and there's no reason to define it differently.) It looks like the theorem-provin…

Yes! Exactly, it's a distraction. There are reasonable, well-intentioned reasons to argue that division by 0 should be an acceptable operation in a computational setting. Computational settings need not admit all the rigor of theoretical math. I wish the author had not tried to involve field theory and programming like this because it detracts from the point :)

[deleted]
Post reply on HN