![Euclidean division](https://www.english.nina.az/wikipedia/image/aHR0cHM6Ly91cGxvYWQud2lraW1lZGlhLm9yZy93aWtpcGVkaWEvY29tbW9ucy90aHVtYi9mL2Y0L0V1Y2xpZGVhbl9kaXZpc2lvbl9leGFtcGxlLnN2Zy8xNjAwcHgtRXVjbGlkZWFuX2RpdmlzaW9uX2V4YW1wbGUuc3ZnLnBuZw==.png )
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.
![image](https://www.english.nina.az/wikipedia/image/aHR0cHM6Ly93d3cuZW5nbGlzaC5uaW5hLmF6L3dpa2lwZWRpYS9pbWFnZS9hSFIwY0hNNkx5OTFjR3h2WVdRdWQybHJhVzFsWkdsaExtOXlaeTkzYVd0cGNHVmthV0V2WTI5dGJXOXVjeTkwYUhWdFlpOW1MMlkwTDBWMVkyeHBaR1ZoYmw5a2FYWnBjMmx2Ymw5bGVHRnRjR3hsTG5OMlp5OHlNakJ3ZUMxRmRXTnNhV1JsWVc1ZlpHbDJhWE5wYjI1ZlpYaGhiWEJzWlM1emRtY3VjRzVuLnBuZw==.png)
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, and modular arithmetic, for which only remainders are considered. The operation consisting of computing only the remainder is called the modulo operation, and is used often in both mathematics and computer science.
![image](https://www.english.nina.az/wikipedia/image/aHR0cHM6Ly93d3cuZW5nbGlzaC5uaW5hLmF6L3dpa2lwZWRpYS9pbWFnZS9hSFIwY0hNNkx5OTFjR3h2WVdRdWQybHJhVzFsWkdsaExtOXlaeTkzYVd0cGNHVmthV0V2WTI5dGJXOXVjeTkwYUhWdFlpOHdMekExTDFCcFpWOWthWFpwYzJsdmJpNXpkbWN2TWpJd2NIZ3RVR2xsWDJScGRtbHphVzl1TG5OMlp5NXdibWM9LnBuZw==.png)
Division theorem
Euclidean division is based on the following result, which is sometimes called Euclid's division lemma.
Given two integers a and b, with b ≠ 0, there exist unique integers q and r such that
- a = bq + r
and
- 0 ≤ r < |b|,
where |b| denotes the absolute value of b.
In the above theorem, each of the four integers has a name of its own: a is called the dividend, b is called the divisor, q is called the quotient and r is called the remainder.
The computation of the quotient and the remainder from the dividend and the divisor is called division, or in case of ambiguity, Euclidean division. The theorem is frequently referred to as the division algorithm (although it is a theorem and not an algorithm), because its proof as given below lends itself to a simple division algorithm for computing q and r (see the section Proof for more).
Division is not defined in the case where b = 0; see division by zero.
For the remainder and the modulo operation, there are conventions other than 0 ≤ r < |b|, see § Other intervals for the remainder.
Generalization
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 are replaced with
or
where denotes the polynomial degree.
In the generalization to Euclidean domains, the inequality becomes
or
where 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.
History
This section needs additional citations for verification.(September 2016) |
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.[citation needed]
Before the discovery 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. Presently, most division algorithms, including long division, are based on this notation 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.[citation needed]
Intuitive example
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 and the number of people is denoted
, then one can divide the pie evenly among the people such that each person receives
slices (the quotient), with some number of slices
being the leftover (the remainder). In which case, the equation
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.
Examples
- 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.
Proof
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 and
. 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 § Effectiveness for more).
Existence
For proving the existence of Euclidean division, one can suppose since, if
the equality
can be rewritten
So, if the latter equality is a Euclidean division with
the former is also a Euclidean division.
Given and
there are integers
and
such that
for example,
and
if
and otherwise
and
Let and
be such a pair of numbers for which
is nonnegative and minimal. If
we have Euclidean division. Thus, we have to prove that, if
then
is not minimal. Indeed, if
one has
with
and
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 (if
) and adding
to it until
However, this algorithm is not efficient, since its number of steps is of the order of
Uniqueness
The pair of integers r and q such that a = bq + r 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 a by b, say a = bq' + r' with 0 ≤ r' < |b|, then we must have that
- q' = q and r' = r.
To prove this statement, we first start with the assumptions that
- 0 ≤ r < |b|
- 0 ≤ r' < |b|
- a = bq + r
- a = bq' + r'
Subtracting the two equations yields
- b(q – q′) = r′ – r.
So b is a divisor of r′ – r. As
- |r′ – r| < |b|
by the above inequalities, one gets
- r′ – r = 0,
and
- b(q – q′) = 0.
Since b ≠ 0, we get that r = r′ and q = q′, which proves the uniqueness part of the Euclidean division theorem.
Effectiveness
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).
Variants
The Euclidean division admits a number of variants, some of which are listed below.
Other intervals for the remainder
In Euclidean division with d as divisor, the remainder is supposed to belong to the interval [0, d) of length |d|. Any other interval of the same length may be used. More precisely, given integers ,
,
with
, there exist unique integers
and
with
such that
.
In particular, if then
. This division is called the centered division, and its remainder
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 division
Given integers ,
and
with
and
let
be the modular multiplicative inverse of
(i.e.,
with
being a multiple of
), then there exist unique integers
and
with
such that
. This result generalizes Hensel's odd division (1900).
The value is the N-residue defined in Montgomery reduction.
In Euclidean domains
Euclidean domains (also known as Euclidean rings) are defined as integral domains which support the following generalization of Euclidean division:
- Given an element a and a non-zero element b in a Euclidean domain R equipped with a Euclidean function d (also known as a Euclidean valuation or degree function), there exist q and r in R such that a = bq + r and either r = 0 or d(r) < d(b).
Uniqueness of q and r is not required. It occurs only in exceptional cases, typically for univariate polynomials, and for integers, if the further condition r ≥ 0 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.
See also
- Euclid's lemma
- Euclidean algorithm
Notes
- "Division and Euclidean algorithms". www-groups.mcs.st-andrews.ac.uk. Archived from the original on 2021-05-06. Retrieved 2019-11-15.
- "What is modular arithmetic?". Khan Academy. Retrieved 2019-11-15.
- "Fun With Modular Arithmetic – BetterExplained". betterexplained.com. Retrieved 2019-11-15.
- Burton, David M. (2010). Elementary Number Theory. McGraw-Hill. pp. 17–19. ISBN 978-0-07-338314-9.
- Durbin, John R. (1992). Modern Algebra : an Introduction (3rd ed.). New York: Wiley. p. 63. ISBN 0-471-51001-7.
- Haining Fan; Ming Gu; Jiaguang Sun; Kwok-Yan Lam (2012). "Obtaining More Karatsuba-Like Formulae over the Binary Field". IET Information Security. 6 (1): 14–19. CiteSeerX 10.1.1.215.1576. doi:10.1049/iet-ifs.2010.0114.
- Rotman 2006, p. 267
- Fraleigh 1993, p. 376
References
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 17 is divided into 3 groups of 5 with 2 as leftover Here the dividend is 17 the divisor is 3 the quotient is 5 and the remainder is 2 which is strictly smaller than the divisor 3 or more symbolically 17 3 5 2 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 and modular arithmetic for which only remainders are considered The operation consisting of computing only the remainder is called the modulo operation and is used often in both mathematics and computer science The pie has 9 slices so each of the 4 people receives 2 slices and 1 is left over Division theoremEuclidean division is based on the following result which is sometimes called Euclid s division lemma Given two integers a and b with b 0 there exist unique integers q and r such that a bq r and 0 r lt b where b denotes the absolute value of b In the above theorem each of the four integers has a name of its own a is called the dividend b is called the divisor q is called the quotient and r is called the remainder The computation of the quotient and the remainder from the dividend and the divisor is called division or in case of ambiguity Euclidean division The theorem is frequently referred to as the division algorithm although it is a theorem and not an algorithm because its proof as given below lends itself to a simple division algorithm for computing q and r see the section Proof for more Division is not defined in the case where b 0 see division by zero For the remainder and the modulo operation there are conventions other than 0 r lt b see Other intervals for the remainder Generalization 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 0 r lt b displaystyle 0 leq r lt b are replaced with r 0 displaystyle r 0 or deg r lt deg b displaystyle deg r lt deg b where deg displaystyle deg denotes the polynomial degree In the generalization to Euclidean domains the inequality becomes r 0 displaystyle r 0 or f r lt f b displaystyle f r lt f b where f displaystyle f 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 HistoryThis section needs additional citations for verification Please help improve this article by adding citations to reliable sources in this section Unsourced material may be challenged and removed Find sources Euclidean division news newspapers books scholar JSTOR September 2016 Learn how and when to remove this message 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 citation needed Before the discovery 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 Presently most division algorithms including long division are based on this notation 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 citation needed Intuitive exampleSuppose 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 a displaystyle a and the number of people is denoted b displaystyle b then one can divide the pie evenly among the people such that each person receives q displaystyle q slices the quotient with some number of slices r lt b displaystyle r lt b being the leftover the remainder In which case the equation a bq r displaystyle a bq r 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 ExamplesIf 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 ProofThe 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 q displaystyle q and r displaystyle r 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 Effectiveness for more Existence For proving the existence of Euclidean division one can suppose b gt 0 displaystyle b gt 0 since if b lt 0 displaystyle b lt 0 the equality a bq r displaystyle a bq r can be rewritten a b q r displaystyle a b q r So if the latter equality is a Euclidean division with b gt 0 displaystyle b gt 0 the former is also a Euclidean division Given b gt 0 displaystyle b gt 0 and a displaystyle a there are integers q1 displaystyle q 1 and r1 0 displaystyle r 1 geq 0 such that a bq1 r1 displaystyle a bq 1 r 1 for example q1 0 displaystyle q 1 0 and r1 a displaystyle r 1 a if a 0 displaystyle a geq 0 and otherwise q1 a displaystyle q 1 a and r1 a ab displaystyle r 1 a ab Let q displaystyle q and r displaystyle r be such a pair of numbers for which r displaystyle r is nonnegative and minimal If r lt b displaystyle r lt b we have Euclidean division Thus we have to prove that if r b displaystyle r geq b then r displaystyle r is not minimal Indeed if r b displaystyle r geq b one has a b q 1 r b displaystyle a b q 1 r b with 0 r b lt r displaystyle 0 leq r b lt r and r displaystyle r 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 q 0 displaystyle q 0 if a 0 displaystyle a geq 0 and adding 1 displaystyle 1 to it until a bq lt b displaystyle a bq lt b However this algorithm is not efficient since its number of steps is of the order of a b displaystyle a b Uniqueness The pair of integers r and q such that a bq r 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 a by b say a bq r with 0 r lt b then we must have that q q and r r To prove this statement we first start with the assumptions that 0 r lt b 0 r lt b a bq r a bq r Subtracting the two equations yields b q q r r So b is a divisor of r r As r r lt b by the above inequalities one gets r r 0 and b q q 0 Since b 0 we get that r r and q q which proves the uniqueness part of the Euclidean division theorem EffectivenessIn 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 VariantsThe Euclidean division admits a number of variants some of which are listed below Other intervals for the remainder In Euclidean division with d as divisor the remainder is supposed to belong to the interval 0 d of length d Any other interval of the same length may be used More precisely given integers m displaystyle m a displaystyle a d displaystyle d with m gt 0 displaystyle m gt 0 there exist unique integers q displaystyle q and r displaystyle r with d r lt m d displaystyle d leq r lt m d such that a mq r displaystyle a mq r In particular if d m2 displaystyle d left lfloor frac m 2 right rfloor then m2 r lt m m2 displaystyle left lfloor frac m 2 right rfloor leq r lt m left lfloor frac m 2 right rfloor This division is called the centered division and its remainder r displaystyle r 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 division Given integers a displaystyle a m displaystyle m and R displaystyle R with m gt 0 displaystyle m gt 0 and gcd R m 1 displaystyle gcd R m 1 let R 1 displaystyle R 1 be the modular multiplicative inverse of R displaystyle R i e 0 lt R 1 lt m displaystyle 0 lt R 1 lt m with R 1R 1 displaystyle R 1 R 1 being a multiple of m displaystyle m then there exist unique integers q displaystyle q and r displaystyle r with 0 r lt m displaystyle 0 leq r lt m such that a mq R 1 r displaystyle a mq R 1 cdot r This result generalizes Hensel s odd division 1900 The value r displaystyle r is the N residue defined in Montgomery reduction In Euclidean domainsEuclidean domains also known as Euclidean rings are defined as integral domains which support the following generalization of Euclidean division Given an element a and a non zero element b in a Euclidean domain R equipped with a Euclidean function d also known as a Euclidean valuation or degree function there exist q and r in R such that a bq r and either r 0 or d r lt d b Uniqueness of q and r is not required It occurs only in exceptional cases typically for univariate polynomials and for integers if the further condition r 0 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 See alsoEuclid s lemma Euclidean algorithmNotes Division and Euclidean algorithms www groups mcs st andrews ac uk Archived from the original on 2021 05 06 Retrieved 2019 11 15 What is modular arithmetic Khan Academy Retrieved 2019 11 15 Fun With Modular Arithmetic BetterExplained betterexplained com Retrieved 2019 11 15 Burton David M 2010 Elementary Number Theory McGraw Hill pp 17 19 ISBN 978 0 07 338314 9 Durbin John R 1992 Modern Algebra an Introduction 3rd ed New York Wiley p 63 ISBN 0 471 51001 7 Haining Fan Ming Gu Jiaguang Sun Kwok Yan Lam 2012 Obtaining More Karatsuba Like Formulae over the Binary Field IET Information Security 6 1 14 19 CiteSeerX 10 1 1 215 1576 doi 10 1049 iet ifs 2010 0114 Rotman 2006 p 267 Fraleigh 1993 p 376ReferencesFraleigh John B 1993 A First Course in Abstract Algebra 5th ed Addison Wesley ISBN 978 0 201 53467 2 Rotman Joseph J 2006 A First Course in Abstract Algebra with Applications 3rd ed Prentice Hall ISBN 978 0 13 186267 8