Method of complements

In mathematics, the method of complements is a technique used to subtract one number from another using only addition of positive numbers. Specifically, the number to be subtracted is first converted into its complement, and then added to the other number.

In the decimal numbering system, the method of complements can be carried out using nines' complement or ten's complement.

Nines' complement

To subtract a number y (the subtrahend) from another number x (the minuend), nines' complement may be used. In this method, y is complemented by determining the complement of each digit. The complement of a decimal digit in the nines' complement system is the number that must be added to it to produce 9. The complement of 3 is 6, the complement of 7 is 2, and so on. Given a subtraction problem:

  873  (x)
- 218  (y)

The nines' complement of y (218) is 781. Because y is three digits long, this is the same as subtracting y from 999. (The number of 9's is equal to the number of digits of y.)

Next, the complement of y is added to x:

  873  (x)
+ 781  (complement of y)
=====
 1654 

The first "1" digit is then dropped, giving 654. Finally, 1 is added to the result, giving 655. It can easily be verified that 873 - 218 = 655.

This technique works differently if x < y. In that case, there will not be a "1" digit to cross out at the end, and nor is a "1" added to the result. For example:

  185  (x)
- 329  (y)

Complementing y gives:

  185  (x)
+ 670  (y)
=====
  855

The result of 855 is then complemented, giving 144. Since x < y, a negative sign must be added, so the answer is -144. Again, it can easily be confirmed that 185 - 329 = -144.

Nines' complement works because the operations we perform cancel each other out. Recall that the nines' complement of a three digit number y is 999-y. That means that replacing y by its nines' complement is the same as adding 999. If we are in the case where x > y, we then remove the leading one and add one. This is the same as subtracting 1000 and adding 1, and together these are the same as subtracting 999. This cancels the 999 we added at the beginning, so we get the correct result. If we were to write these steps out, we would get:

  873 - 219
= 873 - 219 + 999 - 999
= 873 + (999 - 219) - 999
= 873 + 781 - 999
= 1654 - 999
= 1654 - 1000 + 1
= 654 + 1
= 655

On the other hand, if we are in the case where x < y, we take the nines' complement of the result and change the sign, which is the same as subtracting 999. Again, this cancels the 999 we added at the beginning. Writing these steps out gives us:

  185 - 329
= 185 - 329 + 999 - 999
= 185 + (999 - 329) - 999
= 185 + 670 - 999
= 855 - 999
= -999 + 855
= - (999 - 855)
= - (144)
= -144

Note that adding and subtracting 999 in this way will work no matter what size the two numbers are, but the advantage of using 999 is that it gives the nines' complement if our numbers are three digits long. If we want to compute x - y, where x or y has at most n digits, then in place of 999 we should use 10n+1-1, which will be a string of n nines.

Ten's complement

With the ten's complement approach, the complement of the subtrahend is found with regard to 10n, where n is the number of digits in y. In other words, the ten's complement is the number z that makes y + z = 10n. Using the same example as above:

  873  (x)
- 218  (y)

The complement of y with respect to 103 = 1000 is the same as 1000 - y, or 782. In the same way as before, this number is added to x:

  873  (x)
+ 782  (complement of y)
=====
 1655

Dropping the initial "1" gives 655. In ten's complement, there is no need to add 1 to the result.

For cases where xy, the second approach must be used. Note that with ten's complement, if x = y, this approach must be used also. Using the same example as before:

  185  (x)
- 329  (y)

Complementing y using ten's complement gives:

  185  (x)
+ 671  (y)
=====
  856

Complementing 856 with ten's complement gives 144. We reverse the sign to get -144.

Just as with nines' complement, ten's complement works because the operations we perform cancel each other out:

  873 - 218
= 873 - 218 + 1000 - 1000
= 873 + (1000 - 218) - 1000
= 873 + 782 - 1000
= 1655 - 1000
= 655

Similarly,

  183 - 329
= 183 - 329 + 1000 - 1000
= 183 + (1000 - 329) - 1000
= 183 + 671 - 1000
= 856 - 1000
= -144

Comments

The necessity of erasing the initial "1" in the result is convenient, particularly considering that computer microprocessors typically have a limited, fixed number of digits with which to perform arithmetic. In a microprocessor that can only contain 8 bits, for example, the leftmost "1" in the examples above is equivalent to the ninth bit, which is lost during calculation. Since subtraction may be a complex operation involving multiple steps for a microprocessor, the method of complements is extremely useful for performing subtractions using only addition. For details, see two's complement.

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://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)
Toolbox
Personal tools