Number systems can theoretically have as many distinct symbols as there are numbers themselves. The fact that the base-10 system we use has become so prevalent throughout the world today may be because it is intuitive for us to use ten digits, having ten fingers, also known as digits, readily available on our hands with which to count. But there are other number systems that use different amounts of symbols with which to express number values, such as the binary number system, which only uses two, or the hexadecimal, which uses sixteen. Also, different cultures throughout history developed different number systems, such as the ancient Mayans, who used twenty distinct number symbols, or base-20, and the ancient Babylonians, who used a base-60 system. To understand how different base number systems work, let us look at the base-10, or decimal system first.
The term, “base-10” means that we have ten units, or digits, with which to express all numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. To express a number greater than this, we must use combinations of our ten digits. To continue the count, we begin with the number 1 in a new position to the left of the original digits, called the “tens” position, and place a 0 to indicate that there is a value of “nothing” in the “ones” position, which makes the number 10. The count begins again in the “ones” position, while the number 1 in the “tens” position stays constant until we reach 19. The count in the “tens” position then progresses to the next available digit of 2, which holds steady while the count in the “ones” position repeats again from 0 to 9. When this pattern reaches the number 99, the next position to the left is initiated, the “hundreds,” with the number 100, and so on and so forth.
In the base-10 system, each position in the string of digits that represents larger and larger numbers as they progress to the left is a power of ten:
10 = 10 x 1 = 10^1
100 = 10 x 10 = 10 ^2
1000 = 10 x 10 x 10 = 10 ^3
etcetera
When we see a string of digits, we know that the digit in each position has been multiplied by the power of ten that that position represents. This concept can be expressed as follows:
3030 = (10^3 x 3) + (10^2 x 0) + (10^1 x 3) + 0
Now, what if the number of digits were limited to only six? We would begin just the same, keeping in mind that the six digits include the number 0, so we count from 0 to 5. At this point, we have run out of digits to use, so the next position to the left must be initiated. The number following 5 will be “10,” representing the same value as the number 6 does in the base-10 system. Once we begin to use more than one position to represent numbers, their values become entirely different from what we are used to. Let us continue to count to see what happens (the base-6 numbers are on the left, and their base-10 equivalents are on the right):
“10” = 6
“11” = 7
“12” = 8
“13” = 9
“14” = 10
“15” = 11
We have again run out of available digits. The number in the second position to the left progresses, and the count continues:
“20” = 12
“21” = 13
“22” = 14
“23” = 15
“24” = 16
“25” = 17
“30” = 18
“31” = 19
“32” = 20
etcetera
Now that we see the pattern, how can we determine the changed value in the new numbering system without having to write it out in sequence? Notice the values of the base-6 numbers “10,” “20,” and “30,” which equal 6, 12, and 18, respectively in our familiar base-10 system. From this, we can see that a simple formula arises: “10” = 6×1, “20” = 6×2, “30” = 6×3. From this, we can understand the progression as follows:
“10” = (6×1) + 0 = 6
“11” = (6×1) + 1 = 7
“12” = (6×1) + 2 = 8
…
“20” = (6×2) + 0 = 12
“21” = (6×2) + 1 = 13
“22” = (6×2) + 2 = 14
…
Moving on to the next position to the left, what would we expect the value of the base-6 number, “100” to be equal to in base-10? Now, instead of the positions of a string of digits being powers of ten, they are powers of six:
“10” = 6 x 1 = 6^1 = 6
“100” = 6 x 6 = 6^2 = 36
“1000” = 6 x 6 x 6 = 6^3 = 216
Therefore, in a string of base-6 digits, we know that the digit in each position has been multiplied by the power of six that that position represents:
“3030” = (6^3 x 3) + (6^2 x 0) + (6^1 x 3) + 0 = (216 x 3) + 0 + (6 x 3) + 0 = 648 + 18 = 666
“202” = (6^2 x 2) + (6^1 x 0) + 2 = (36 x 2) + (6 x 0) + 2 = 72 + 0 + 2 = 74
And thus we have the formula for converting a number from a different base system, let’s say base-“n,” into base-10. The opposite process of converting base-10 numbers into base-“n” numbers involves dividing the base-10 number by the highest power of “n” possible, and then successively dividing any remainders by each lower power of “n” to find the value of the number that will fill each position in that number system. For example, let us look at the conversion of the base-10 number, 666, into its base-6 equivalent. First, divide 666 by the highest power of six that will go into it. That would be 6^3 = 216, which results in the number 3. That is the value that will go in the 6^3 position. The remainder of the division was 18. Next, try to divide 6^2 into the remainder. 6^2 = 36, which is too large, so that position gets a value of 0. Next, try to divide 6^1 into that remainder of 18. That gives us the number 3, which will be placed in the 6^1 position. There was no remainder, so the “ones” position gets a value of 0. Voila, the base-6 equivalent is “3030.”
My example of a base-6 system does not have any practical use, but the base-2, or binary system, is at the core of all computer programs. The formula is the same, where n=2. The only digits available are 0 and 1. The elegant simplicity of this system runs all of the computers in the world because the two values represent switches in the computer that are either off or on. The decimal values of binary numbers are as follows:
0 = 0
1 = 1
10 = 2^1 = 2
11 = 2^1 + 1 = 3
100 = 2^2 = 4
101 = 2^2 + 1 = 4 + 1 = 5
110 = 2^2 + 2^1 = 4 + 2 = 6
111 = 2^2 + 2^1 + 1 = 4 + 2 + 1 = 7
1000 = 2^3 = 8
1001 = 2^3 + 1 = 8 + 1 = 9
Here is an example of random digital number:
111001100101 =
2^11 + 2^10 + 2^9 + 2^6 + 2^5 + 2^2 + 1 = 2048 + 1024 + 512 + 64 + 32 + 4 + 1 = 3685
The hexadecimal number system is often used in computer programming because the long strings of binary 0’s and 1’s can be grouped into sets of four, making large strings much more manageable. This is because we can easily remember the values of (2^2 = 4) and (2^3 = 8), making the basic math quite easy. The decimal value of the binary number “1111” = 8 + 4 + 2 + 1 = 15, and the hexadecimal system is a base-16 system. In this system, the base values higher than the digit 9 are represented by letters:
A=10
B=11
C=12
D=13
E=14
F=15
Using the same binary number example as above, the conversion from binary into hex is as follows:
1110,0110,0101 = (8 + 4 + 2 + 0) (0 + 4 + 2 + 0) (0 + 4 + 0 + 1) = E65
So, from hex to decimal:
E65 = (16^2 x 14) + (16^1 x 6) + 5 = (256 x 14) + (16 x 6) + 5 = 3584 + 96 + 5 = 3685
Another number system commonly used in computer science is octal, or base-8. This is convenient for working with binary numbers in a similar way to hexadecimal, where the strings of 0’s and 1’s are divided into groups of three. The groupings always begin from the right, or small end of the numbers. Here is the conversion from binary into octal, using the same binary number as an example:
111,001,100,101 = (4 + 2 + 1) (0 + 0 + 1) (4 + 0 + 0) (4 + 0 + 1) = 7145
From octal to decimal:
(8^3 x 7) + (8^2 x 1) + (8^1 x 4) + 5 = (512 x 7) + (64 x 1) + (8 x 4) + 5 = 3584 + 64 + 32 + 5 = 3685
These different number systems are not only fun for math nerds to play with and amazingly useful for information technology, but they also serve to illuminate the fact that the actual values of numbers are constants, while it is the way that we choose to represent them that can vary widely.