Binary Subtraction

Subtraction is made by the operation of -1 defined to be the inverse or opposite or undoing of +1, so that for two natural numbers m and n:

  • m = n – 1 is the same as n = m + 1.

Given m you get n = m + 1  by adding 1 to m (doing +1), and then you get back m = n – 1 back by subtracting 1 from n (doing -1 or undoing +1). Compare with 5. below.

Saying that 2 = 3 – 1 is thus the same as saying the 3 = 2 + 1. You get 3 from 2 by adding 1 (doing +1) and you get 2 from 3 by subtracting 1 (doing -1).

Note that formally n – 1 = m (same as m = n – 1) can be seen as the result of shifting the 1 on the right hand side of n = m + 1 to the left hand side while changing the sign (+ 1 becomes – 1). This is useful in manipulating (algebraic) expressions involving numbers.

Watch this example and play with the code.

Then take a look this subtraction machine.

Repeating -1 starting from 0 constructs the negative numbers -1, -2, -3, -4,…,. which together with the natural numbers created by repeating +1, constructs the

  • integers 0,\,\pm 1,\,\pm 2,\,\pm 3,...,.

The negative numbers is a wonderful gift to humanity by the heavens, or simply constructed by the human mind (including zero).

To do:

  1. Display the natural numbers on horizontal line stretching to the right as:  0 1 2 3 4 5 ….
  2. Display the integers on a horizontal line stretching both left and right as: …-5 -4 -3 -2 -1 0 1 2 3 4 5… (compare with a horisontal thermometer). Conclude that doing +1 can be seen as moving one step to the right and -1 moving one step to the left. In particular,  see 1 = 0 + 1 as the result of taking  one step to the right from 0, and -1 = 0 – 1 as the result of taking one step to the left from 0. The same for 2 = 0 + 1 +1 as the result of taking two steps to the right, and -2 = 0 – 1 – 1 as the result of taking two steps to the left, and so on.
  3. Compare defining the negative number -n with n a natural number as the solution x to the equation  x + n =0 (taking n steps to the left cancels taking n steps to the right starting from 0). See that x = – n formally arises from the equation x + n = 0 by moving n from the left to right side of the equation while changing its sign.
  4. See that -(-n) = n since x = n solves the equation x+(-n)=0 and so x = -(-n).   (two minus-signs cancel)