# Division algorithm

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.

 Contents

## Statement of theorem

Specifically, the division algorithm states that given two integers a and d, with d ≠ 0, there exists 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 the quotient, r is the remainder, d is the divisor, and a is the dividend.

## Examples

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

## Proof

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.

### Existence

Consider the set

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

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 (−b)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.

### Uniqueness

Since r = aqd, it is enough to prove the uniqueness of q. So, suppose there exist integers q and q' satisfying the result of the theorem. Then we must have 0 ≤ aqd < |d| and 0 ≤ aq'd < |d|. Note that

[itex](q' - q)d = (a - qd) - (a - q'd) \leq (a - qd) < |d|[itex]
[itex](q' - q)d = (a - qd) - (a - q'd) \geq 0 - (a - q'd) = -(a - q'd) > -|d|[itex]

Together, these two inequalities show that (q' − q)d is an integer whose absolute value is strictly less than |d|. Since |d| > 0, division gives

[itex]-1 < \pm (q' - q) < 1[itex]

Since q' − q is an integer, we must have q' − q = 0, i.e. q = q'. This completes the proof of the uniqueness of q and r.

## Generalisations

There is nothing particular 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.

## External links

##### Navigation

Academic Kids Menu

• Art and Cultures
• Art (http://www.academickids.com/encyclopedia/index.php/Art)
• Architecture (http://www.academickids.com/encyclopedia/index.php/Architecture)
• Cultures (http://www.academickids.com/encyclopedia/index.php/Cultures)
• Music (http://www.academickids.com/encyclopedia/index.php/Music)
• Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
• Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
• Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
• Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
• Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
• Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
• Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
• Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
• History (http://www.academickids.com/encyclopedia/index.php/History)
• Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
• Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
• Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
• Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
• Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
• Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
• United States (http://www.academickids.com/encyclopedia/index.php/United_States)
• Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
• World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
• Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
• Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
• Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
• Science (http://www.academickids.com/encyclopedia/index.php/Science)
• Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
• Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
• Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
• Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
• Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
• Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
• Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
• Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
• Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
• Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
• Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
• Government (http://www.academickids.com/encyclopedia/index.php/Government)
• Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
• Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
• Space and Astronomy
• Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
• Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
• Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
• Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
• Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
• US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

• Home Page (http://academickids.com/encyclopedia/index.php)
• Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

• Clip Art (http://classroomclipart.com)