Live data from Hacker News

1/0 = 0

hillelwayne.com

331–340 of 593 posts

Re: 1/0 = 0

#331
post #266

Earlier quoted context omitted.

> The whole point is that the proof shows you any way you define division by 0 is going to compromise your definition of a field, or it's going to make fields with nonzero elements impossible. But it does neither. All field theorems pertaining to inverses/division take the form `x ≠ 0 ⇒ ... x⁻¹ ...` None of them is compromised. > In fact, the modern, axiomatic definition of a field explicitly excludes the unit 0 from…

> The whole problem is one of formalization. "Undefined", as it's used in mathematics, is very much informal. It is used to say that a certain expression, 1/0, while "grammatically" correct, is meaningless. Formal systems simply cannot do that: the expression 1/0 must either be ill-formed (can be done with dependent types but is often inconvenient) or it must mean something in the semantic domain of the language. Dif…

> But you're going to "infect" everything that 42 touches in the process

How so? Remember that, e.g. ∀x . 0x ≠ 1 still holds, and it is not true that 0((1/0)(1/42)) = 1 because associativity doesn't apply, because associativity for division stems from the existence of a multiplicative inverse exists, and none does even though 1/0 = 42.

> You won't compromise arithmetic, but you will compromise the definition of a field.

Not at all. Formal systems of mathematics define fields (in general, not just in arithmetic) specifically with 1/0 = 0. Can you show a single field axiom or theorem that would be affected by this?

Perhaps you could if you insisted on stating a theorem by using an informal term such as "wherever foo is defined," but 1/ those theorems can always be stated in more precise terms that don't make use of the informal notion of definedness, and 2/ very few formal systems formalize definedness in a way that means an undefined value must not be 42 (i.e. where you can actually prove 1/0 ≠ 42 or where 1/0 is ill-formed) -- see Feferman https://math.stanford.edu/~feferman/papers/definedness.pdf -- and AFAIK, such systems are very, very rarely used in practice.

Re: 1/0 = 0

#333

> Lawrence Paulson: > > These things are conventions, exactly the same as announcing that x^-n = 1/x^n and that x^0 = 0. Say what? x^0 is 1, and not by convention, other than in the 0^0 = 1 case.

I was thrown by that too, maybe it was a typo?

Re: 1/0 = 0

#334
post #122

Earlier quoted context omitted.

It’s common for 1/0 = 0 to be exactly what you want. Array average for example. That said raising exception would be the only consistent behavior if a language supports that.

It is not valid to extrapolate an average of 0 from no data at all. For example, if we examine a sample of zero elephants, then we end up estimating the average elephantine mass as being zero. This shows to be wildly off as soon as we upgrade our statistical wherewithal to work with a sample size of one. A center of mass is a kind of average. If we have an empty object made of no particles of matter at all, can we ar…

This is probably beside the point, but shouldn't the center-of-mass of a massless object be everywhere simultaneously? With no reason to prefer any location, over any other?

Re: 1/0 = 0

#335
This is a case of poor abstraction. Many commenters in this thread explain why, in their application, 0 is a good fallback for division by zero.

But, falling back to 0 is not the correct error handling result for all situations. In other situations, an error is the correct result. The language designers should include proper division, and this style of division should be labeled a "safe" division; or, a division that throws an error should be labeled an "unsafe" division.

I have serious doubts about a language if it chooses one-size-fits-all error handling like this.

Re: 1/0 = 0

#336

I consider it infinity because the limit as the denominator goes to 0 is infinity. I see this with investments that have infinity ROI. If you get into an investment using only other people's money (OPM) and you make a profit then you have made x / 0. Saying I made an infinity return makes more logical sense than I made 0 return. There's a saying about the difference between a mathematician and an engineer. If there i…

> I consider it infinity because the limit as the denominator goes to 0 is infinity.

Note that this only works if the denominator approaches 0 from a positive side. Otherwise it's 0. This is the idea behind the extended real numbers.

Re: 1/0 = 0

#338

Earlier quoted context omitted.

> correctly state the undefined nature of 1/0 Erm, when we say it's "undefined" we mean it literally -- standard mathematical systems of arithmetic do not define a value for that division. If you make another system of arithmetic you can define it how you want and be consistent with "regular maths" for the operations in which things are defined. It's an extension. > We have "NaN" for a reason Funnily enough, IEEE754…

Standard mathematical systems of arithmetic do not permit a reasonable definition of 1/0. Mathematicians define equality of fractions by stating that a/b = c/d if and only if a·d = b·c. This means that if we define 1/0 = 1 then 0 = 1. To be fair, this is perfectly consistent, except everything in our system is equal to zero.

> Mathematicians define equality of fractions by stating that a/b = c/d if and only if a·d = b·c. This means that if we define 1/0 = 1 then 0 = 1.

That's not implied, so far as I can tell.

a / b = 1 / 0, thus

a * d = b * c => 1 * d = 0 * c => d = 0

So all you can say is that d = 0, or at most that c / 0 = 0. Is there some extra step you're taking?

Re: 1/0 = 0

#339

Earlier quoted context omitted.

Except that 0 could actually be the result of a valid computation. NaN, undefined, or Infinity can not.

And you mean that as saying that it is then better? Or that it is not? (Sorry, I'm not sure which way you mean it)

It seems straightforwardly better to me, because the programmer/user gets an immediate "you messed up" signal, instead of silently returning the wrong values until someone eventually (hopefully) notices.

Re: 1/0 = 0

#340
post #296

Earlier quoted context omitted.

The problem this and the other replies miss is that the standard definition of division is multiplication by the inverse. The entire argument rests on a notational slight of hand. The property that held before -- that _when defined_ division has the inverse property -- no longer holds. Thus many equational identities that otherwise would hold do not hold.

Look at it this way... Standard definition of division function, d: d(x, y) = x * y⁻, for all x and y EXCEPT 0 Author's modified, piecewise ( https://en.wikipedia.org/wiki/Piecewise ) definition: d(x, y) = x * y⁻, for all x and y EXCEPT 0 d(x, y) = 0, for y = 0 He's just adding 0 to the domain of d(x, y) to extend the definition, and deliberately not using xy⁻ for that particular element of the domain. No inverse nee…

I know what he's doing. The problem is when you make it a different function (even by just extending it) then you change its equational properties. So equational properties that held over the whole domain of the function no longer hold over the extended domain. This is repaired by modifying the equational properties. But the modified equational properties mean that you now have a different system than before. So the whole thing is just playing around with words.
Post reply on HN