maths.freeNumber Theory › 4. Number Representation and Calculation › Addition and Subtraction in Base Systems

Addition and Subtraction in Base Systems

Add and subtract in bases 2–9 and 12.

Learning Objectives

After completing this section, you should be able to:

  1. Add and subtract in bases 2–9 and 12.
  2. Identify errors in adding and subtracting in bases 2–9 and 12.

Addition in Bases Other Than Base 10

Now that we understand what it means for numbers to be expressed in a base other than 10, we can look at arithmetic using other bases, starting with addition. When you think back to when you first learned addition, it is very likely you learned the addition table. Once you knew the addition table, you moved on to addition of numbers with more than one digit. The same process holds for addition in other bases. We begin with an addition table, and then move on to adding numbers with two or more digits.

We worked with base 6 earlier, and have the numbers in base 6 up to 1006. Using that table of values, we can create the base 6 addition table.

Here’s the beginning of the base 6 addition table:

+012345
0012345
112345?
22345??
3345???
445????
55?????

Many of the cells are not filled out. The ones filled in are values that never get past 5, which is the largest legal symbol in base 6, so they are acceptable symbols. But what do we do with 5 + 3 in base 6? We can’t represent the answer as “8” since “8” is not a symbol available to us. Let’s go back to the list of numbers we have for base 6.

012345
101112131415
202122232425
303132333435
404142434445
505152535455

So, what is 5 + 1 equal to in base 6? Well, start at the 5, and jump ahead one step. You land on 10.

This means that, in base 6, 5 + 1 = 10.

So, what is 5 + 2 in base 6? Well, 5 + 2 = 5 + 1 + 1, so 10 + 1…jump one more space and you land on 11. So, 5 + 2 = 11 in base 6.

+012345
0012345
11234510
223451011
3345101112
44510111213
551011121314
Adding in Base 6

Try it.

Calculate 2516 + 1336.

Solution

Step 1: Let’s set up the addition using columns.

251
+133

Step 2: Let’s do the one’s place first. According to the base 6 addition table (), 1 + 3 = 4.

251
+133
4

Step 3: Now, we do the “tens” place (it’s really the sixes place). According to the base 6 addition table (), we have 5 + 3 = 12. So, like in base 10, we use the 2 and carry the 1.

1
251
+133
24

Step 4: Now the “hundreds” place (really, thirty-sixes place). There, we have 1 + 2 + 1 = 3 + 1 = 4.

1
251
+133
424

So, 2516 + 1336 = 4246.

As you can see, the process is the same as when you learned base 10 addition, just a different symbol set.

Adding in Base 12

Try it.

Calculate 3A712 + 9BA12.

Solution

Step 1: Using the process established in the earlier addition problem, set up the columns.

3A7
+9BA

Step 2: Using the rules from the base 12 addition table in the solution for , and being careful to carry the 1 when necessary, we get the following:

11
3A7
+9BA
11A5

The ones that were carried are located over the columns.

So, 3A712 + 9BA12= 11A512.

Condensed — the full section is in OpenStax Contemporary Mathematics.

Subtraction in Bases Other Than Base 10

Subtraction in bases other than base 10 follow the same processes as base 10 subtraction, but, as with addition, using the addition table for the base.

Subtracting in Base 6

Try it.

Calculate 526 − 346.

Solution

Step 1: Let’s set up the subtraction using columns.

52
34

Step 2: Just as we might do in base 10, we borrow a 1 from the 5 for the ones digit.

\(54\)12
34

Step 3: Referring to the base 6 addition table (), we see that 4 + 4 = 12, so 126 − 46 is 46.

\(54\)12
34
4

Step 4: Now we deal with the “tens” (really, sixes) digit, 46 − 36, which equals 16 according to the base 6 addition table ().

\(5\) 412
34
14

So, 526 − 346 = 146.

Subtracting in Base 12

Try it.

Calculate A1712 − 4B312.

Solution

Step 1: Let’s set up the subtraction using columns.

A17
4B3

Step 2: Even in base 12, 712 − 312 = 412.

A17
4B3
4

Step 3: Moving to the “tens” digit, we have 112 − B12. Since 1 is less than B in base 12, we need to borrow a 1 from the A, just as we would for subtraction in base 10.

\(A\) 9117
4B3
4

Step 4: According to the base 12 addition table in the solution for , B12 + 212 = 1112, so 1112 − B12 = 212.

\(A\) 9117
4B3
24

Step 5: Finally, we deal with the “hundreds” digit. According to the base 12 addition table in the solution for , 412 + 512 = 912, so 912 − 412 = 512.

\(A\) 9117
4B3
524

So, A1712 − 4B312 = 52412.

Errors When Adding and Subtracting in Bases Other Than Base 10

Errors when computing in bases other than 10 often involve applying base 10 rules or symbols to an arithmetic problem in a base other than base 10. The first type of error is using a symbol that is not in the symbol set for the base. For instance, if a 9 shows up when working in base 7, you know an error has happened because 9 is not a legal symbol in base 7.

Identifying an Illegal Symbol in Arithmetic in a Base Other Than Base 10

Try it.

Explain the error in the following calculation:

\[{15}_{6}+{34}_{6}={49}_{6}\]
Solution

Since the problem is in base 6, the symbol set available is 0, 1, 2, 3, 4 and 5. The 9 in the answer is clearly not a legal symbol for base 6. Looking back to the base 6 addition table (), we see that \({5}_{6}+{4}_{6}={13}_{6}\). Correcting the error, we see the sum is \({15}_{6}+{34}_{6}={53}_{6}\).

The second type of error is using a base 10 rule when the numbers are not in base 10. For instance, if you are working in base 13, then 913 + 913 is not 1813, even though 18 is the correct answer in base 10.

Identifying an Arithmetic Error in a Base Other Than Base 10

Try it.

Explain the error in the following calculation, and correct the error:

\[{89}_{12}+{76}_{12}={165}_{12}\]
Solution

If this problem was a base 10 problem, this would be the correct answer. However, in base 12, 9 + 6 is not 15, but is instead 13. To correct this error, carefully use the addition table for base 12. If properly used, the correct answer would be \({143}_{12}\), as seen below:

89
+76
143

Key Concepts

  • Addition tables for bases other than 10 can be built using the same processes that are used in base 10, including using a number line.
  • Addition in bases other than base 10 use the same processes as addition in base 10, but use the addition table for that base.
  • Subtraction in bases other than base 10 use the same processes as subtraction in base 10, but use the addition table for that base.

Practice (10)

Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.

  1. Calculate 2516 + 1336.

    Tunjukkan jawapan

    Step 1: Let’s set up the addition using columns.

    251
    +133

    Step 2: Let’s do the one’s place first. According to the base 6 addition table (), 1 + 3 = 4.

    251
    +133
    4

    Step 3: Now, we do the “tens” place (it’s really the sixes place). According to the base 6 addition table (), we have 5 + 3 = 12. So, like in base 10, we use the 2 and carry the 1.

    1
    251
    +133
    24

    Step 4: Now the “hundreds” place (really, thirty-sixes place). There, we have 1 + 2 + 1 = 3 + 1 = 4.

    1
    251
    +133
    424

    So, 2516 + 1336 = 4246.

    As you can see, the process is the same as when you learned base 10 addition, just a different symbol set.

    1. Create the addition table for base 7.
    2. Create the addition table for base 2.
    Tunjukkan jawapan
    1. We begin with the table below.
      +0123456
      00123456
      1123456
      223456
      33456
      4456
      556
      66

      In base 7, the number that follows 6 is 10 (since we’ve run out of symbols!). So, 67 + 17 = 107. Once that is established, 67 + 27 will be two numbers past 6, which is 11 in base 7.

      +0123456
      00123456
      112345610
      22345611
      33456
      4456
      556
      661011

      Continuing, we can fill in the rows as we would in base 10, but being aware that we are working in base 7 ().

      +0123456
      00123456
      112345610
      2234561011
      33456101112
      445610111213
      5561011121314
      66101112131415
    2. We revisit base 2 here. Begin with the table:
      +01
      001
      11

      In base 2, the number that follows 1 is 10 (since we’ve run out of symbols!). So, 12 + 12 = 102. The complete table for base two then is below.

      +01
      001
      1110

      This demonstrates that the rules necessary for base 2 addition are as small as possible: four rules.

  2. Calculate 5367 + 4337.

    Tunjukkan jawapan

    Step 1: Let’s set up the addition using columns.

    536
    +433

    Step 2: Let’s do the one’s place first. According to the base 7 addition table in the solution for , 6 + 3 = 12. We will carry the 1.

    1
    536
    +433
    2

    Step 3: Now, we do the “tens” place (it’s really the sevens place). According to the base 7 addition table in the solution for , we have 1 + 3 + 3 = 10. So, like in base 10, we use the 0 and carry the 1.

    1
    536
    +433
    02

    Step 4: Now the “hundreds” place (really, forty-ninths place). There, we have 1 + 5 + 4 = 6 + 4 = 13.

    1
    536
    +433
    1302

    So, 5367 + 3337 = 13027.

  3. Create the addition table for base 12.

    Tunjukkan jawapan

    Step 1: Recall, in base 12, the symbol set is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, and B. So, the addition table begins as shown below.

    +0123456789AB
    00123456789AB
    1123456789AB
    223456789AB
    33456789AB
    4456789AB
    556789AB
    66789AB
    7789AB
    889AB
    99AB
    AAB
    BB

    Step 2: The diagonal immediately to the right of the filled in boxes is where the 10 goes for this base.

    +0123456789AB
    00123456789AB
    1123456789AB10
    223456789AB10
    33456789AB10
    4456789AB10
    556789AB10
    66789AB10
    7789AB10
    889AB10
    99AB10
    AAB10
    BB10

    Step 3: Using the pattern we’re familiar with, and counting in base 12, we can fill in the other cells.

    +0123456789AB
    00123456789AB
    1123456789AB10
    223456789AB1011
    33456789AB101112
    4456789AB10111213
    556789AB1011121314
    66789AB101112131415
    7789AB10111213141516
    889AB1011121314151617
    99AB101112131415161718
    AAB10111213141516171819
    BB101112131415161718191A

    Notice that the lower-right entry is 1A12, as this is the number one past 1912.

  4. Calculate 3A712 + 9BA12.

    Tunjukkan jawapan

    Step 1: Using the process established in the earlier addition problem, set up the columns.

    3A7
    +9BA

    Step 2: Using the rules from the base 12 addition table in the solution for , and being careful to carry the 1 when necessary, we get the following:

    11
    3A7
    +9BA
    11A5

    The ones that were carried are located over the columns.

    So, 3A712 + 9BA12= 11A512.

  5. We again return to base 2, the base used by computers. Calculate 10012 + 110112.

    Tunjukkan jawapan

    Step 1: Using the process established in the earlier addition problem, set up the columns.

    1001
    +11011

    Step 2: Using the rules from the base 2 addition table in the solution for , and being careful to carry the 1 when necessary (and shown at the top of the grid), we get the following:

    111
    1001
    +11011
    100100

    Step 3: Calculate 10012 + 110112 = 1001002.

    So, 10012 + 110112 = 1001002.

  6. Calculate 526 − 346.

    Tunjukkan jawapan

    Step 1: Let’s set up the subtraction using columns.

    52
    34

    Step 2: Just as we might do in base 10, we borrow a 1 from the 5 for the ones digit.

    \(54\)12
    34

    Step 3: Referring to the base 6 addition table (), we see that 4 + 4 = 12, so 126 − 46 is 46.

    \(54\)12
    34
    4

    Step 4: Now we deal with the “tens” (really, sixes) digit, 46 − 36, which equals 16 according to the base 6 addition table ().

    \(5\) 412
    34
    14

    So, 526 − 346 = 146.

  7. Calculate A1712 − 4B312.

    Tunjukkan jawapan

    Step 1: Let’s set up the subtraction using columns.

    A17
    4B3

    Step 2: Even in base 12, 712 − 312 = 412.

    A17
    4B3
    4

    Step 3: Moving to the “tens” digit, we have 112 − B12. Since 1 is less than B in base 12, we need to borrow a 1 from the A, just as we would for subtraction in base 10.

    \(A\) 9117
    4B3
    4

    Step 4: According to the base 12 addition table in the solution for , B12 + 212 = 1112, so 1112 − B12 = 212.

    \(A\) 9117
    4B3
    24

    Step 5: Finally, we deal with the “hundreds” digit. According to the base 12 addition table in the solution for , 412 + 512 = 912, so 912 − 412 = 512.

    \(A\) 9117
    4B3
    524

    So, A1712 − 4B312 = 52412.

  8. Explain the error in the following calculation:

    \[{15}_{6}+{34}_{6}={49}_{6}\]
    Tunjukkan jawapan

    Since the problem is in base 6, the symbol set available is 0, 1, 2, 3, 4 and 5. The 9 in the answer is clearly not a legal symbol for base 6. Looking back to the base 6 addition table (), we see that \({5}_{6}+{4}_{6}={13}_{6}\). Correcting the error, we see the sum is \({15}_{6}+{34}_{6}={53}_{6}\).

  9. Explain the error in the following calculation, and correct the error:

    \[{89}_{12}+{76}_{12}={165}_{12}\]
    Tunjukkan jawapan

    If this problem was a base 10 problem, this would be the correct answer. However, in base 12, 9 + 6 is not 15, but is instead 13. To correct this error, carefully use the addition table for base 12. If properly used, the correct answer would be \({143}_{12}\), as seen below:

    89
    +76
    143

Symbols used here

\log_b x,\ \ln x
logarithm, natural log
The exponent b must be raised to for x; ln uses base e.
\sum_{k=1}^{n} a_k
summation
Add a_k for k = 1 up to n.
\prod_{k=1}^{n} a_k
product
Multiply a_k for k = 1 up to n.
\mathbb{N},\ \mathbb{Z},\ \mathbb{Q},\ \mathbb{R},\ \mathbb{C}
number sets
Naturals, integers, rationals, reals, complex numbers.
a \equiv b \pmod n
congruent modulo n
n divides a − b; a and b have the same remainder.
a \mid b,\ \gcd(a,b)
divides, greatest common divisor
b is a multiple of a; the largest number dividing both.
\varphi(n),\ \pi(x)
Euler's totient, prime-counting function
Count of 1..n coprime to n; number of primes up to x.
\mathbb{Z}/n\mathbb{Z},\ \mathbb{Z}_n
integers modulo n
The remainders 0…n−1 with clock arithmetic.
a \bmod n
remainder
What is left after dividing a by n.

How to: Addition and Subtraction in Base Systems

  1. Add and subtract in bases 2–9 and 12.
  2. Identify errors in adding and subtracting in bases 2–9 and 12.
  3. Create the addition table for base 7.
  4. Create the addition table for base 2.
  5. We begin with the table below.
  6. We revisit base 2 here. Begin with the table:
  7. Addition tables for bases other than 10 can be built using the same processes that are used in base 10, including using a number line.
  8. Addition in bases other than base 10 use the same processes as addition in base 10, but use the addition table for that base.

Questions people ask

Why are primes so important?

Every integer factors into primes in exactly one way, so primes are the atoms of multiplication. Cryptography relies on that factoring being easy to state and hard to do.

How do I tell whether a big number is prime?

Trial division up to the square root works for small numbers. For large ones, probabilistic tests (Miller–Rabin) give an answer that is wrong with negligible probability, and deterministic tests (AKS) exist but are slower.

Cubalah sendiri

Parts of this page are adapted from OpenStax Contemporary Mathematics (CC BY-NC-SA 4.0). Condensed and re-explained here; errors are ours.

Lebih dalam Number Theory