Template:Short description Template:About
In arithmetic, Euclidean division – or division with remainder – is the process of dividing one integer (the dividend) by another (the divisor), in a way that produces an integer quotient and a natural number remainder strictly smaller than the absolute value of the divisor. A fundamental property is that the quotient and the remainder exist and are unique, under some conditions. Because of this uniqueness, Euclidean division is often considered without referring to any method of computation, and without explicitly computing the quotient and the remainder. The methods of computation are called integer division algorithms, the best known of which being long division.
Euclidean division, and algorithms to compute it, are fundamental for many questions concerning integers, such as the Euclidean algorithm for finding the greatest common divisor of two integers,<ref name=":1">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> and modular arithmetic, for which only remainders are considered.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The operation consisting of computing only the remainder is called the modulo operation,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> and is used often in both mathematics and computer science.
Division theoremEdit
Template:Anchor Euclidean division is based on the following result, which is sometimes called Euclid's division lemma.
Given two integers Template:Math and Template:Math, with Template:Math, there exist unique integers Template:Math and Template:Math such that
and
where Template:Math denotes the absolute value of Template:Math.<ref>Template:Cite book</ref>
In the above theorem, each of the four integers has a name of its own: Template:Math is called the Template:Em, Template:Math is called the Template:Em, Template:Math is called the Template:Em and Template:Math is called the Template:Em.
The computation of the quotient and the remainder from the dividend and the divisor is called Template:Em, or in case of ambiguity, Template:Em. The theorem is frequently referred to as the Template:Em (although it is a theorem and not an algorithm), because its proof as given below lends itself to a simple division algorithm for computing Template:Math and Template:Math (see the section Proof for more).
Division is not defined in the case where Template:Math; see division by zero.
For the remainder and the modulo operation, there are conventions other than Template:Math, see Template:Slink.
GeneralizationEdit
{{#invoke:Labelled list hatnote|labelledList|Main article|Main articles|Main page|Main pages}} Although originally restricted to integers, Euclidean division and the division theorem can be generalized to univariate polynomials over a field and to Euclidean domains.
In the case of univariate polynomials, the main difference is that the inequalities <math>0\le r<|b|</math> are replaced with
- <math>r = 0</math> or <math>\deg r < \deg b,</math>
where <math>\deg</math> denotes the polynomial degree.
In the generalization to Euclidean domains, the inequality becomes
- <math>r = 0</math> or <math>f(r) < f(b),</math>
where <math>f</math> denote a specific function from the domain to the natural numbers called a "Euclidean function".
The uniqueness of the quotient and the remainder remains true for polynomials, but it is false in general.
HistoryEdit
Template:Refimprove Although "Euclidean division" is named after Euclid, it seems that he did not know the existence and uniqueness theorem, and that the only computation method that he knew was the division by repeated subtraction.Template:Citation needed
Before the invention of Hindu–Arabic numeral system, which was introduced in Europe during the 13th century by Fibonacci, division was extremely difficult, and only the best mathematicians were able to do it Template:Cn. Presently, most division algorithms, including long division, are based on this numeral system or its variants, such as binary numerals. A notable exception is Newton–Raphson division, which is independent from any numeral system.
The term "Euclidean division" was introduced during the 20th century as a shorthand for "division of Euclidean rings". It has been rapidly adopted by mathematicians for distinguishing this division from the other kinds of division of numbers.Template:Citation needed
Intuitive exampleEdit
Suppose that a pie has 9 slices and they are to be divided evenly among 4 people. Using Euclidean division, 9 divided by 4 is 2 with remainder 1. In other words, each person receives 2 slices of pie, and there is 1 slice left over.
This can be confirmed using multiplication, the inverse of division: if each of the 4 people received 2 slices, then 4 × 2 = 8 slices were given out in total. Adding the 1 slice remaining, the result is 9 slices. In summary: 9 = 4 × 2 + 1.
In general, if the number of slices is denoted <math>a</math> and the number of people is denoted <math>b</math>, then one can divide the pie evenly among the people such that each person receives <math>q</math> slices (the quotient), with some number of slices <math>r < b</math> being the leftover (the remainder). In which case, the equation <math>a = bq + r</math> holds.
If 9 slices were divided among 3 people instead of 4, then each would receive 3 and no slice would be left over, which means that the remainder would be zero, leading to the conclusion that 3 evenly divides 9, or that 3 divides 9.
Euclidean division can also be extended to negative dividend (or negative divisor) using the same formula; for example −9 = 4 × (−3) + 3, which means that −9 divided by 4 is −3 with remainder 3.
ExamplesEdit
- If a = 7 and b = 3, then q = 2 and r = 1, since 7 = 3 × 2 + 1.
- If a = 7 and b = −3, then q = −2 and r = 1, since 7 = −3 × (−2) + 1.
- If a = −7 and b = 3, then q = −3 and r = 2, since −7 = 3 × (−3) + 2.
- If a = −7 and b = −3, then q = 3 and r = 2, since −7 = −3 × 3 + 2.
ProofEdit
The following proof of the division theorem relies on the fact that a decreasing sequence of non-negative integers stops eventually. It is separated into two parts: one for existence and another for uniqueness of <math>q</math> and <math>r</math>. Other proofs use the well-ordering principle (i.e., the assertion that every non-empty set of non-negative integers has a smallest element) to make the reasoning simpler, but have the disadvantage of not providing directly an algorithm for solving the division (see Template:Slink for more).<ref>Template:Cite book</ref>
ExistenceEdit
For proving the existence of Euclidean division, one can suppose <math>b > 0,</math> since, if <math>b < 0,</math> the equality <math>a=bq+r</math> can be rewritten <math>a = (-b)(-q) + r.</math> So, if the latter equality is a Euclidean division with <math>-b > 0,</math> the former is also a Euclidean division.
Given <math>b > 0</math> and <math>a,</math> there are integers <math>q_1</math> and <math>r_1 \ge 0</math> such that <math>a = bq_1 + r_1;</math> for example, <math>q_1 = 0</math> and <math>r_1 = a</math> if <math>a \ge 0,</math> and otherwise <math>q_1 = a</math> and <math>r_1 = a - ab.</math>
Let <math>q</math> and <math>r</math> be such a pair of numbers for which <math>r</math> is nonnegative and minimal. If <math>r < b.</math> we have Euclidean division. Thus, we have to prove that, if <math>r \ge b,</math> then <math>r</math> is not minimal. Indeed, if <math>r \ge b,</math> one has <math>a = b(q+1) + (r-b),</math> with <math>0 \le r-b < r,</math> and <math>r</math> is not minimal
This proves the existence in all cases. This provides also an algorithm for computing the quotient and the remainder, by starting from <math>q = 0</math> (if <math>a \ge 0</math>) and adding <math>1</math> to it until <math>a-bq < b.</math> However, this algorithm is not efficient, since its number of steps is of the order of <math>a/b</math>
UniquenessEdit
The pair of integers Template:Math and Template:Math such that Template:Math is unique, in the sense that there can be no other pair of integers that satisfy the same condition in the Euclidean division theorem. In other words, if we have another division of Template:Math by Template:Math, say Template:Math with Template:Math, then we must have that
To prove this statement, we first start with the assumptions that
Subtracting the two equations yields
So Template:Math is a divisor of Template:Math. As
by the above inequalities, one gets
and
Since Template:Math, we get that Template:Math and Template:Math, which proves the uniqueness part of the Euclidean division theorem.
EffectivenessEdit
In general, an existence proof does not provide an algorithm for computing the existing quotient and remainder, but the above proof does immediately provide an algorithm (see Division algorithm#Division by repeated subtraction), even though it is not a very efficient one as it requires as many steps as the size of the quotient. This is related to the fact that it uses only additions, subtractions and comparisons of integers, without involving multiplication, nor any particular representation of the integers such as decimal notation.
In terms of decimal notation, long division provides a much more efficient algorithm for solving Euclidean divisions. Its generalization to binary and hexadecimal notation provides further flexibility and possibility for computer implementation. However, for large inputs, algorithms that reduce division to multiplication, such as Newton–Raphson, are usually preferred, because they only need a time which is proportional to the time of the multiplication needed to verify the result—independently of the multiplication algorithm which is used (for more, see Division algorithm#Fast division methods).
VariantsEdit
The Euclidean division admits a number of variants, some of which are listed below.
Other intervals for the remainderEdit
Template:See also In Euclidean division with Template:Mvar as divisor, the remainder is supposed to belong to the interval Template:Math of length Template:Math. Any other interval of the same length may be used. More precisely, given integers <math>m</math>, <math>a</math>, <math>d</math> with <math>m>0</math>, there exist unique integers <math>q</math> and <math>r</math> with <math>d \le r < m+d </math> such that <math>a = mq+r</math>.
In particular, if <math> d=- \left\lfloor \frac{m}{2} \right\rfloor </math> then <math> - \left\lfloor \frac{m}{2} \right\rfloor \le r < m-\left\lfloor \frac{m}{2} \right\rfloor </math> . This division is called the centered division, and its remainder <math>r</math> is called the centered remainder or the least absolute remainder.
This is used for approximating real numbers: Euclidean division defines truncation, and centered division defines rounding.
Montgomery divisionEdit
{{#invoke:Labelled list hatnote|labelledList|Main article|Main articles|Main page|Main pages}} Given integers <math>a</math>, <math>m</math> and <math>R,</math> with <math>m >0</math> and <math>\gcd(R,m) =1,</math> let <math>R^{-1}</math> be the modular multiplicative inverse of <math>R</math> (i.e., <math> 0<R^{-1}<m</math> with <math>R^{-1}R-1</math> being a multiple of <math>m</math>), then there exist unique integers <math>q</math> and <math>r</math> with <math>0 \le r < m </math> such that <math> a = mq+R^{-1} \cdot r </math>. This result generalizes Hensel's odd division (1900).<ref>Template:Cite journal</ref>
The value <math>r</math> is the Template:Math-residue defined in Montgomery reduction.
In Euclidean domainsEdit
Template:See also Euclidean domains (also known as Euclidean rings)<ref name=Rot06>Template:Harvnb</ref> are defined as integral domains which support the following generalization of Euclidean division:
- Given an element Template:Math and a non-zero element Template:Math in a Euclidean domain Template:Math equipped with a Euclidean function Template:Math (also known as a Euclidean valuation<ref>Template:Harvnb</ref> or degree function<ref name=Rot06/>), there exist Template:Math and Template:Math in Template:Math such that Template:Math and either Template:Math or Template:Math.
Uniqueness of Template:Math and Template:Math is not required.<ref name=":1" /> It occurs only in exceptional cases, typically for univariate polynomials, and for integers, if the further condition Template:Math is added.
Examples of Euclidean domains include fields, polynomial rings in one variable over a field, and the Gaussian integers. The Euclidean division of polynomials has been the object of specific developments.