Division algorithm

From Wikipedia, the free encyclopedia

The division algorithm is a theorem in mathematics which precisely expresses the outcome of the usual process of division of integers. The name is something of a misnomer, as it is a theorem, not an algorithm, i.e. a well-defined procedure for achieving a specific task — although the division algorithm can be used to find the greatest common divisor of two integers.

It should be noted that the term "division algorithm" in the study of algebra is commonly applied to the more general variant of this theorem, shown to hold in integral domains which are principal ideal domains.

Contents

Specifically, the division algorithm states that given two integers a and d, with |d| ≠ 0

There exist unique integers q and r such that a = qd + r and 0 ≤ r < | d |, where | d | denotes the absolute value of d.

The integer

  • q is called the quotient
  • r is called the remainder
  • d is called the divisor
  • a is called the dividend

  • If a = 7 and d = 3, then q = 2 and r = 1, since 7 = (2)(3) + 1.
  • If a = 7 and d = −3, then q = −2 and r = 1, since 7 = (−2)(−3) + 1.
  • If a = −7 and d = 3, then q = −3 and r = 2, since −7 = (−3)(3) + 2.
  • If a = −7 and d = −3, then q = 3 and r = 2, since −7 = (3)(−3) + 2.

The proof consists of two parts — first, the proof of the existence of q and r, and secondly, the proof of the uniqueness of q and r.

Consider the set

S = \left\{a - nd : n \in \mathbb{Z}\right\}

We claim that S contains at least one nonnegative integer. There are two cases to consider.

  • If d < 0, then −d > 0, and by the Archimedean property, there is a nonnegative integer n such that (−d)n ≥ −a, i.e. adn ≥ 0.
  • If d > 0, then again by the Archimedean property, there is a nonnegative integer n such that dn ≥ −a, i.e. ad(−n) = a + dn ≥ 0.

In either case, we have shown that S contains a nonnegative integer. This means we can apply the well-ordering principle, and deduce that S contains a least nonnegative integer r. If we now let q = (ar)/d, then q and r are integers and a = qd + r.

It only remains to show that 0 ≤ r < |d|. The first inequality holds because of the choice of r as a nonnegative integer. To show the last (strict) inequality, suppose that r = |d|. Since d ≠ 0, r > 0, and again d > 0 or d < 0.

  • If d > 0, then r = d. Let q' = q + 1; then q' is an integer and q'd = (q + 1)d = qd + d = qd + r = a, i.e. aq'd = 0.
  • If d < 0, then r = −d. Let q' = q − 1; then q' is an integer and q'd = (q − 1)d = qdd = qd + r = a, i.e. aq'd = 0.

In either case, we have shown that r > 0 was not really the least nonnegative integer in S, after all. This is a contradiction, and so we must have r < |d|. This completes the proof of the existence of q and r.

Suppose \exists q, Q, r, R with 0 \leq r,R < |d| \,\! such that a = dq + r \,\! and a = dQ + R. \,\! Without loss of generality we may assume that q \leq Q \,\!.

Subtracting the two equations yields: d(Q - q) = (r - R)\,\! .

If d > 0 \,\! then R \leq r \,\! and r < d \leq d + R\,\!, and so (r-R) < d\,\!. Similarly, if d < 0\,\! then r \leq R\,\! and R < -d \leq -d + r\,\!, and so -(r-R) < -d \,\!. Combining these gives |r-R| < |d|\,\!.

The original equation implies that |d|\,\! divides |r-R|\,\!; therefore either |d| \leq |r-R|\,\! or |r-R|=0\,\!. Because we just established that |r-R| < |d|\,\!, the first possibility cannot hold by trichotomy. Thus, r=R\,\!.

Substituting this into the original two equations quickly yields dq = dQ \,\! (Recall: d is not 0) and thus q = Q \,\! proving uniqueness.

There is nothing particularly special about the set of remainders {0, 1, ..., |d| − 1}. We could use any set of |d| integers, such that every integer is congruent to one of the integers in the set. This particular set of remainders is very convenient, but it is not the only choice. See also coset and equivalence relation.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.