The Universe of Discourse


Fri, 17 May 2019

What's the difference between 0/0 and 1/0?

Last year a new Math Stack Exchange user asked What's the difference between !!\frac00!! and !!\frac10!!?.

I wrote an answer I thought was pretty good, but the question was downvoted and deleted as “not about mathematics”. This is bullshit, but what can I do?

I can repatriate my answer here, anyway.


This long answer has two parts. The first one is about the arithmetic, and is fairly simple, and is not very different from the other answers here: neither !!\frac10!! nor !!\frac00!! has any clear meaning. But your intuition is a good one: if one looks at the situation more carefully, !!\frac10!! and !!\frac00!! behave rather differently, and there is more to the story than can be understood just from the arithmetic part. The second half of my answer tries to go into these developments.

The notation !!\frac ab!! has a specific meaning:

The number !!x!! for which $$x\cdot b=a.$$

Usually this is simple enough. There is exactly one number !!x!! for which !!x\cdot 7=21!!, namely !!3!!, so !!\frac{21}7=3!!. There is exactly one number !!x!! for which !!x\cdot 4=7!!, namely !!\frac74!!, so !!\frac74\cdot4=7!!.

But when !!b=0!! we can't keep the promise that is implied by the word "the" in "The number !!x!! for which...". Let's see what goes wrong. When !!b=0!! the definition says:

The number !!x!! for which $$x\cdot 0=a.$$

When !!a\ne 0!! this goes severely wrong. The left-hand side is zero and the right-hand size is not, so there is no number !!x!! that satisfies the condition. Suppose !!x!! is the ugliest gorilla on the dairy farm. But the farm has no gorillas, only cows. Any further questions you have about !!x!! are pointless: is !!x!! a male or female gorilla? Is its fur black or dark gray? Does !!x!! prefer bananas or melons? There is no such !!x!!, so the questions are unanswerable.

When !!a!! and !!b!! are both zero, something different goes wrong:

The number !!x!! for which $$x\cdot 0=0.$$

It still doesn't work to speak of "The number !!x!! for which..." because any !!x!! will work. Now it's like saying that !!x!! is ‘the’ cow from the dairy farm, But there are many cows, so questions about !!x!! are still pointless, although in a different way: Does !!x!! have spots? I dunno man, what is !!x!!?

Asking about this !!x!!, as an individual number, never makes sense, for one reason or the other, either because there is no such !!x!! at all (!!\frac a0!! when !!a≠0!!) or because the description is not specific enough to tell you anything (!!\frac 00!!).


If you are trying to understand this as a matter of simple arithmetic, using analogies about putting cookies into boxes, this is the best you can do. That is a blunt instrument, and for a finer understanding you need to use more delicate tools. In some contexts, the two situations (!!\frac00!! and !!\frac10!!) are distinguishable, but you need to be more careful.

Suppose !!f!! and !!g!! are some functions of !!x!!, each with definite values for all numbers !!x!!, and in particular !!g(0) = 0!!. We can consider the quantity $$q(x) = \frac{f(x)}{g(x)}$$ and ask what happens to !!q(x)!! when !!x!! gets very close to !!0!!. The quantity !!q(0)!! itself is undefined, because at !!x=0!! the denominator is !!g(0)=0!!. But we can still ask what happens to !!q!! when !!x!! gets close to zero, but before it gets all the way there. It's possible that as !!x!! gets closer and closer to zero, !!q(x)!! might get closer and closer to some particular number, say !!Q!!; we can ask if there is such a number !!Q!!, and if so what it is.

It turns out we can distinguish quite different situations depending on whether the numerator !!f(0)!! is zero or nonzero. When !!f(0)\ne 0!!, we can state decisively that there is no such !!Q!!. For if there were, it would have to satisfy !!Q\cdot 0=f(0)!! which is impossible; !!Q!! would have to be a gorilla on the dairy farm. There are a number of different ways that !!q(x)!! can behave in such cases, when its denominator approaches zero and its numerator does not, but all of the possible behaviors are bad: !!q(x)!! can increase or decrease without bound as !!x!! gets close to zero; or it can do both depending on whether we approach zero from the left or the right; or it can oscillate more and more wildly, but in no case does it do anything like gently and politely approaching a single number !!Q!!.

But if !!f(0) = 0!!, the answer is more complicated, because !!Q!! (if it exists at all) would only need to satisfy !!Q\cdot 0=0!!, which is easy. So there might actually be a !!Q!! that works; it depends on further details of !!f!! and !!g!!, and sometimes there is and sometimes there isn't. For example, when !!f(x) = x^2+2x!! and !!g(x) = x!! then !!q(x) = \frac{x^2+2x}{x}!!. This is still undefined at !!x=0!! but at any other value of !!x!! it is equal to !!x+2!!, and as !!x!! approaches zero, !!q(x)!! slides smoothly in toward !!2!! along the straight line !!x+2!!. When !!x!! is close to (but not equal to) zero, !!q(x)!! is close to (but not equal to) !!2!!; for example when !!x=0.001!! then !!q(x) = \frac{0.002001}{0.001} = 2.001!!, and as !!x!! gets closer to zero !!q(x)!! gets even closer to !!2!!. So the number !!Q!! we were asking about does exist, and is in fact equal to !!2!!. On the other hand if !!f(x) = x!! and !!g(x) = x^2!! then there is still no such !!Q!!.

The details of how this all works, when there is a !!Q!! and when there isn't, and how to find it, are very interesting, and are the basic idea that underpins all of calculus. The calculus part was invented first, but it bothered everyone because although it seemed to work, it depended on an incoherent idea about how division by zero worked. Trying to frame it as a simple matter of putting cookies into boxes was no longer good enough. Getting it properly straightened out was a long process that took around 150 years, but we did eventually get there and now I think we understand the difference between !!\frac10!! and !!\frac00!! pretty well. But to really understand the difference you probably need to use the calculus approach, which may be more delicate than what you are used to. But if you are interested in this question, and you want the full answer, that is definitely the way to go.


[Other articles in category /math] permanent link

How a good organization handles stuff

We try to push code from development to production most days, and responsibility for overseeing this is given to a “pushmeister”. This job rotates and yesterday it fell to me. There are actually two pushmeisters, one in the morning to get the code from development to the staging environment and into the hands of the QA team, and then an afternoon pushmeister who takes over resolving the problems found by QA and getting the code from staging to production.

ZipRecruiter is in a time zone three hours behind mine, so I always take the morning duty. This works out well, because I get into work around 05:30 Pacific time and can get an early start. A large part of the morning pushmeister's job is to look at what test failures have been introduced overnight, and either fix them or track down the guilty parties and find out what needs to be done to get them fixed.

The policy is that the staging release is locked down as soon as possible after 09:00 Pacific time. No regular commits are accepted into the day's release once the lockdown has occurred. At that point the release is packaged and sent to the staging environment, which is as much as possible like production. It is automatically deployed, and the test suite is run on it. This takes about 90 minutes total. If the staging deployment starts late, it throws off the whole schedule, and the QA team might have to stay late. The QA people are brave martyrs, and I hate to make them stay late if I can help it.

Since I get in at 05:30, I have a great opportunity: I can package a staging release and send it for deployment without locking staging, and find out about problems early on. Often there is some test that fails in staging that wasn't failing in dev.

This time there was a more interesting problem: the deployment itself failed! Great to find this out three hours ahead of time. The problem in this case was some process I didn't know about failing to parse some piece of Javascript I didn't know about. But the Git history told me that that Javascript had been published the previous day and who had published it, so I tracked down the author, Anthony Aardvark, to ask about it.

What we eventually determined was, Anthony had taken some large, duplicated code out of three web pages, turned it into a library in a separate .js file, and written a little wrapper around it. He didn't know why this would break the deployment. But he suggested I talk to the font-end programmers. They did understand: they had a deployment-time process that neither Anthony nor I knew about, which would preprocess all the .js files for faster loading. But it only worked on JS version 5 code, not on JS version 6 code. Anthony's code partook of JS6 features, but neither he nor I knew enough about the differences to know what to do about it.

After a couple of attempts to fix Anthony's code myself, I reverted it. 09:00 came, and I locked down the staging release on time, with Anthony's branch neatly reverted. The deployment went out on time and I handed things over to the afternoon pushmeister with things in good order.

The following day I checked back in the front-end Slack channel and saw they had had a discussion about how this problem could have been detected sooner. They were reviewing a set of changes which, once deployed, will prevent the problem from recurring.

What went right here? Pretty much everything, I think. I had a list of details, but I can sum them all up:

A problem came up, everyone did their job, and it was solved timely.

Also, nobody yelled or lost their temper.

Problems come up and we solve them. I do my job and I can count on my co-workers to help me. Everyone does their job, and people don't lose their tempers.

We have a great company.


[Other articles in category /tech] permanent link