Division by zero
In mathematics, division by zero, division where the divisor (denominator) is zero, is a unique and problematic special case. Using fraction notation, the general example can be written as , where is the dividend (numerator).
The usual definition of the quotient in elementary arithmetic is the number which yields the dividend when multiplied by the divisor. That is, is equivalent to By this definition, the quotient is nonsensical, as the product is always rather than some other number Following the ordinary rules of
, and situations where division by zero might occur must be treated with care. Since any number multiplied by zero is zero, the expression is also undefined.As an alternative to the common convention of working with fields such as the real numbers and leaving division by zero undefined, it is possible to define the result of division by zero in other ways, resulting in different number systems. For example, the quotient can be defined to equal zero; it can be defined to equal a new explicit point at infinity, sometimes denoted by the infinity symbol ; or it can be defined to result in signed infinity, with positive or negative sign depending on the sign of the dividend. In these number systems division by zero is no longer a special exception per se, but the point or points at infinity involve their own new types of exceptional behavior.
In computing, an error may result from an attempt to divide by zero. Depending on the context and the type of number involved, dividing by zero may output positive or negative infinity or a special not-a-number value,[1] generate an exception, display an error message, or crash or hang the program.
Elementary arithmetic
The meaning of division
The division can be conceptually interpreted in several ways.[2]
In quotitive division, the dividend is imagined to be split up into parts of size (the divisor), and the quotient is the number of resulting parts. For example, imagine ten slices of bread are to be made into sandwiches, each requiring two slices of bread. A total of five sandwiches can be made (). Now imagine instead that zero slices of bread are required per sandwich (perhaps a lettuce wrap). Arbitrarily many such sandwiches can be made from ten slices of bread, as the bread is irrelevant.[3]
The quotitive concept of division lends itself to calculation by repeated subtraction: dividing entails counting how many times the divisor can be subtracted before the dividend runs out. Because no finite number of subtractions of zero will ever exhaust a non-zero dividend, calculating division by zero in this way never terminates.[4] Such an interminable division-by-zero algorithm is physically exhibited by some mechanical calculators.[5]
In partitive division, the dividend is imagined to be split into parts, and the quotient is the resulting size of each part. For example, imagine ten cookies are to be divided among two friends. Each friend will receive five cookies (). Now imagine instead that the ten cookies are to be divided among zero friends. How many cookies will each friend receive? Since there are no friends, this is an absurdity.[6]
In another interpretation, the quotient represents the ratio [7] For example, a cake recipe might call for ten cups of flour and two cups of sugar, a ratio of or, proportionally, To scale this recipe to larger or smaller quantities of cake, a ratio of flour to sugar proportional to could be maintained, for instance one cup of flour and one-fifth cup of sugar, or fifty cups of flour and ten cups of sugar.[8] Now imagine a sugar-free cake recipe calls for ten cups of flour and zero cups of sugar. The ratio or proportionally is perfectly sensible:[9] it just means that the cake has no sugar. However, the question "How many parts flour for each part sugar?" still has no meaningful numerical answer.
A geometrical appearance of the division-as-ratio interpretation is the
Inverse of multiplication
Division is the inverse of multiplication, meaning that multiplying and then dividing by the same non-zero quantity, or vice versa, leaves an original quantity unchanged; for example .[13] Thus a division problem such as can be solved by rewriting it as an equivalent equation involving multiplication, where represents the same unknown quantity, and then finding the value for which the statement is true; in this case the unknown quantity is because so therefore [14]
An analogous problem involving division by zero, requires determining an unknown quantity satisfying However, any number multiplied by zero is zero rather than six, so there exists no number which can substitute for to make a true statement.[15]
When the problem is changed to the equivalent multiplicative statement is ; in this case any value can be substituted for the unknown quantity to yield a true statement, so there is no single number which can be assigned as the quotient
Because of these difficulties, quotients where the divisor is zero are traditionally taken to be undefined, and division by zero is not allowed.[16][17]
Fallacies
A compelling reason for not allowing division by zero is that allowing it leads to
When working with numbers, it is easy to identify an illegal division by zero. For example:
- From and one gets Cancelling 0 from both sides yields , a false statement.
The fallacy here arises from the assumption that it is legitimate to cancel 0 like any other number, whereas, in fact, doing so is a form of division by 0.
Using
This is essentially the same fallacious computation as the previous numerical version, but the division by zero was obfuscated because we wrote 0 as x − 1.
Early attempts
The
A positive or negative number when divided by zero is a fraction with the zero as denominator. Zero divided by a negative or positive number is either zero or is expressed as a fraction with zero as numerator and the finite quantity as denominator. Zero divided by zero is zero.
In 830, Mahāvīra unsuccessfully tried to correct the mistake Brahmagupta made in his book Ganita Sara Samgraha: "A number remains unchanged when divided by zero."[18]
Bhāskara II's Līlāvatī (12th century) proposed that division by zero results in an infinite quantity,[20]
A quantity divided by zero becomes a fraction the denominator of which is zero. This fraction is termed an infinite quantity. In this quantity consisting of that which has zero for its divisor, there is no alteration, though many may be inserted or extracted; as no change takes place in the infinite and immutable God when worlds are created or destroyed, though numerous orders of beings are absorbed or put forth.
Historically, one of the earliest recorded references to the mathematical impossibility of assigning a value to is contained in Anglo-Irish philosopher George Berkeley's criticism of infinitesimal calculus in 1734 in The Analyst ("ghosts of departed quantities").[21]
Calculus
Calculus studies the behavior of functions using the concept of a limit, the value to which a function's output tends as its input tends to some specific value. The notation means that the value of the function can be made arbitrarily close to by choosing sufficiently close to
In the case where the limit of the
A basic example of an infinite singularity is the
In most cases, the limit of a quotient of functions is equal to the quotient of the limits of each function separately,
However, when a function is constructed by dividing two functions whose separate limits are both equal to then the limit of the result cannot be determined from the separate limits, so is said to take an indeterminate form, informally written (Another indeterminate form, results from dividing two functions whose limits both tend to infinity.) Such a limit may equal any real value, may tend to infinity, or may not converge at all, depending on the particular functions. For example, in
the separate limits of the numerator and denominator are , so we have the indeterminate form , but simplifying the quotient first shows that the limit exists:
Alternative number systems
Extended real line
The
Projectively extended real line
The set is the
This definition leads to many interesting results. However, the resulting algebraic structure is not a field, and should not be expected to behave like one. For example, is undefined in this extension of the real line.
Riemann sphere
The subject of
This can intuitively be thought of as wrapping up the infinite edges of the complex plane and pinning them together at the single point a
In the extended complex numbers, for any nonzero complex number ordinary complex arithmetic is extended by the additional rules However, , , and are left undefined.
Higher mathematics
The four basic operations – addition, subtraction, multiplication and division – as applied to whole numbers (positive integers), with some restrictions, in elementary arithmetic are used as a framework to support the extension of the realm of numbers to which they apply. For instance, to make it possible to subtract any whole number from another, the realm of numbers must be expanded to the entire set of integers in order to incorporate the negative integers. Similarly, to support division of any integer by any other, the realm of numbers must expand to the rational numbers. During this gradual expansion of the number system, care is taken to ensure that the "extended operations", when applied to the older numbers, do not produce different results. Loosely speaking, since division by zero has no meaning (is undefined) in the whole number setting, this remains true as the setting expands to the real or even complex numbers.[23]
As the realm of numbers to which these operations can be applied expands there are also changes in how the operations are viewed. For instance, in the realm of integers, subtraction is no longer considered a basic operation since it can be replaced by addition of signed numbers.[24] Similarly, when the realm of numbers expands to include the rational numbers, division is replaced by multiplication by certain rational numbers. In keeping with this change of viewpoint, the question, "Why can't we divide by zero?", becomes "Why can't a rational number have a zero denominator?". Answering this revised question precisely requires close examination of the definition of rational numbers.
In the modern approach to constructing the field of real numbers, the rational numbers appear as an intermediate step in the development that is founded on set theory. First, the natural numbers (including zero) are established on an axiomatic basis such as Peano's axiom system and then this is expanded to the ring of integers. The next step is to define the rational numbers keeping in mind that this must be done using only the sets and operations that have already been established, namely, addition, multiplication and the integers. Starting with the set of ordered pairs of integers, {(a, b)} with b ≠ 0, define a binary relation on this set by (a, b) ≃ (c, d) if and only if ad = bc. This relation is shown to be an equivalence relation and its equivalence classes are then defined to be the rational numbers. It is in the formal proof that this relation is an equivalence relation that the requirement that the second coordinate is not zero is needed (for verifying transitivity).[25][26][27]
Although division by zero cannot be sensibly defined with real numbers and integers, it is possible to consistently define it, or similar operations, in other mathematical structures.
Non-standard analysis
In the hyperreal numbers, division by zero is still impossible, but division by non-zero infinitesimals is possible.[28] The same holds true in the surreal numbers.[29]
Distribution theory
In distribution theory one can extend the function to a distribution on the whole space of real numbers (in effect by using
Linear algebra
In matrix algebra, square or rectangular blocks of numbers are manipulated as though they were numbers themselves: matrices can be added and multiplied, and in some cases, a version of division also exists. Dividing by a matrix means, more precisely, multiplying by its inverse. Not all matrices have inverses.[30] For example, a matrix containing only zeros is not invertible.
One can define a pseudo-division, by setting a/b = ab+, in which b+ represents the pseudoinverse of b. It can be proven that if b−1 exists, then b+ = b−1. If b equals 0, then b+ = 0.
Abstract algebra
In abstract algebra, the integers, the rational numbers, the real numbers, and the complex numbers can be abstracted to more general algebraic structures, such as a
Nevertheless, any number system that forms a commutative ring can be extended to a structure called a wheel in which division by zero is always possible. However, the resulting mathematical structure is no longer a commutative ring, as multiplication no longer distributes over addition. Furthermore, in a wheel, division of an element by itself no longer results in the multiplicative identity element , and if the original system was an integral domain, the multiplication in the wheel no longer results in a cancellative semigroup.
The concepts applied to standard arithmetic are similar to those in more general algebraic structures, such as
In field theory, the expression is only shorthand for the formal expression ab−1, where b−1 is the multiplicative inverse of b. Since the field axioms only guarantee the existence of such inverses for nonzero elements, this expression has no meaning when b is zero. Modern texts, that define fields as a special type of ring, include the axiom 0 ≠ 1 for fields (or its equivalent) so that the zero ring is excluded from being a field. In the zero ring, division by zero is possible, which shows that the other field axioms are not sufficient to exclude division by zero in a field.
Computer arithmetic
Floating-point arithmetic
In computing, most numerical calculations are done with
In IEEE arithmetic, division of 0/0 or ∞/∞ results in NaN, but otherwise division always produces a well-defined result. Dividing any non-zero number by positive zero (+0) results in an infinity of the same sign as the dividend. Dividing any non-zero number by
For example, using single-precision IEEE arithmetic, if x = −2−149, then x/2 underflows to −0, and dividing 1 by this result produces 1/(x/2) = −∞. The exact result −2150 is too large to represent as a single-precision number, so an infinity of the same sign is used instead to indicate overflow.
Integer arithmetic
Integer division by zero is usually handled differently from floating point since there is no integer representation for the result. CPUs differ in behavior: for instance x86 processors trigger a hardware exception, while PowerPC processors silently generate an incorrect result for the division and continue. Because of this inconsistency between platforms, the C and C++ programming languages consider the result of dividing by zero undefined behavior.[32] In typical higher-level programming languages, such as Python,[33] an exception is raised for attempted division by zero, which can be handled in another part of the program.
In proof assistants
Many proof assistants, such as Coq and Lean, define 1/0 = 0. This is due to the requirement that all functions are total. Such a definition does not create contradictions, as further manipulations (such as cancelling out) still require that the divisor is non-zero.[34][35]
Historical accidents
- On September 21, 1997, a division by zero error in the "Remote Data Base Manager" aboard USS Yorktown (CG-48) brought down all the machines on the network, causing the ship's propulsion system to fail.[36][37]
See also
Notes
- ^ "Perl BigInt documentation", Perl::doc, Perl 5 Porters, archived from the original on 26 September 2019, retrieved 1 March 2020
- ^ Cheng 2023, pp. 75–83.
- ^ Zazkis & Liljedahl 2009, p. 52–53.
- ^ Zazkis & Liljedahl 2009, p. 55–56.
- ^ Kochenburger, Ralph J.; Turcio, Carolyn J. (1974), Computers in Modern Society, Santa Barbara: Hamilton,
Some other operations, including division, can also be performed by the desk calculator (but don't try to divide by zero; the calculator never will stop trying to divide until stopped manually).
For a video demonstration, see: What happens when you divide by zero on a mechanical calculator?, retrieved 2024-01-06 – via YouTube - ^ Zazkis & Liljedahl 2009, pp. 53–54, give an example of a king's heirs equally dividing their inheritance of 12 diamonds, and ask what would happen in the case that all of the heirs died before the king's will could be executed.
- ^ In China, Taiwan, and Japan, school textbooks typically distinguish between the ratio and the value of the ratio By contrast in the USA textbooks typically treat them as two notations for the same thing. Lo, Jane-Jane; Watanabe, Tad; Cai, Jinfa (2004), "Developing Ratio Concepts: An Asian Perspective", Mathematics Teaching in the Middle School, 9 (7): 362–367, JSTOR 41181943
- S2CID 188092067
- JSTOR 41183440
- JSTOR 20876802
- S2CID 121947341
- JSTOR 41413121.
- ^ Cheng 2023, p. 78; Zazkis & Liljedahl 2009, p. 55
- ^ Zazkis & Liljedahl 2009, p. 55.
- ^ Cheng 2023, pp. 82–83.
- ^ Bunch 1982, p. 14
- ^ ISBN 978-0-19-514237-2
- ^ Bunch 1982, p. 15
- JSTOR 27951153.
- OCLC 1022848630
- ^ Klein 1925, p. 63
- ^ Klein 1925, p. 26
- ^ Schumacher 1996, p. 149
- ^ Hamilton 1982, p. 19
- ^ Henkin et al. 2012, p. 292
- ^ Keisler, H. Jerome (2023) [1986], Elementary Calculus: An Infinitesimal Approach, Prindle, Weber & Schmidt, pp. 29–30
- ISBN 9781568811277
- ISBN 978-0-521-51610-5
- S2CID 9923085,
With appropriate care to be certain that the algebraic signs are not determined by rounding error, the affine mode preserves order relations while fixing up overflow. Thus, for example, the reciprocal of a negative number which underflows is still negative.
- ISBN 978-1-4503-1669-9
- ^ "Built-in Exceptions", Python 3 Library Reference, Python Software Foundation, § "Concrete exceptions – exception
ZeroDivisionError
", retrieved 2024-01-22 - ,
The standard division function on natural numbers in Coq, div, is total and pure, but incorrect: when the divisor is 0, the result is 0.
- ^ Buzzard, Kevin (5 July 2020), "Division by zero in type theory: a FAQ", Xena Project (Blog), retrieved 2024-01-21
- Wired News, 1998-07-24
- ^ William Kahan (14 October 2011), Desperately Needed Remedies for the Undebuggability of Large Floating-Point Computations in Science and Engineering (PDF)
Sources
- Bunch, Bryan (1982), Mathematical Fallacies and Paradoxes, New York: Van Nostrand Reinhold, ISBN 0-442-24905-5(Dover reprint 1997)
- ISBN 978-1-541-60182-6
- Klein, Felix (1925), Elementary Mathematics from an Advanced Standpoint / Arithmetic, Algebra, Analysis, translated by Hedrick, E. R.; Noble, C. A. (3rd ed.), Dover
- Hamilton, A. G. (1982), Numbers, Sets, and Axioms, Cambridge University Press, ISBN 978-0521287616
- Henkin, Leon; Smith, Norman; Varineau, Verne J.; Walsh, Michael J. (2012), Retracing Elementary Mathematics, Literary Licensing LLC, ISBN 978-1258291488
- ISBN 978-0-201-82653-1
- Zazkis, Rina; Liljedahl, Peter (2009), "Stories that explain", Teaching Mathematics as Storytelling, Sense Publishers, pp. 51–65, ISBN 978-90-8790-734-1
Further reading
- Northrop, Eugene P. (1944), Riddles in Mathematics: A Book of Paradoxes, New York: D. Van Nostrand, Ch. 5 "Thou Shalt Not Divide By Zero", pp. 77–96
- ISBN 0-14-029647-6
- Suppes, Patrick (1957), Introduction to Logic, Princeton: D. Van Nostrand, §8.5 "The Problem of Division by Zero" and §8.7 "Five Approaches to Division by Zero" (Dover reprint, 1999)
- Tarski, Alfred (1941), Introduction to Logic and to the Methodology of Deductive Sciences, Oxford University Press, §53 "Definitions whose definiendum contains the identity sign"