Representing Numbers in Different Bases

In elementary school, we learn to count using the decimal system where we have ten digits (the prefix deci refers to breaking numbers into tenths), the digits are:

    \[0\;1\;2\;3\;4\;5\;6\;7\;8\;9\]

We say that the standard decimal system is a base b=10 number system. However, we do not necessarily need to use a decimal number system to count with numbers, in fact, we could do all of mathematics in a different base b number system. For example, consider the binary number system with base b=2, where our two digits are 0 and 1. For example, 101 in base 2 is the same as 5 is base 10.

    \[(101)_2=2^2\cdot 1 + 2^1\cdot 0 +2^0\cdot 1= 5\]

To convert between number bases, we often go back to the decimal system, only because we are the most comfortable with it. For bases b\leq 10, we can use our normal digits 0,1,2,\dots, 9 cutting off at the appropriate number so that the list contains b digits.

Example: Convert (201)_3 to base 10.

    \begin{align*}     (201)_3 &= 2\cdot 3^2+0\cdot 3^1+1\cdot 3^0 \\     &= 18+0+1=19 \end{align*}

Example: Convert (315)_7 to base 8.

    \begin{align*}     (315)_7 &= 3\cdot 7^2+1\cdot 7^1+5\cdot 7^0 \\     &= 98+7+5 \\     &= 110  \end{align*}

Now, look at the powers of 8, 8^0=1, 8^1=8, 8^2=64 and 8^3=512. We have that 512>110 so we stop taking powers since we will not receive a remainder if we divide 110 by 512 or any larger power of 8. Now,

    \begin{align*}     110&= 64+46 = 1\cdot 8^2+46 \\     &= 1\cdot 8^2 + 40+6= 1\cdot 8^2 + 5\cdot 8^1 + 6 \\     &= 1\cdot 8^2 + 5 \cdot 8^1 + 6\cdot 8^0 \end{align*}

This tells us that (315)_7=110=(156)_8.


Exercise: Convert (315)_6 to base 10.

    \begin{align*}     (315)_6 &= 3\cdot 6^2+1 \cdot 6^1+5\cdot 6^0 \\     &= 3\cdot 36+1\cdot 6+5\cdot 1 \\     &= 108+6+5=119 \end{align*}

Exercise: Convert (243)_5 to base 10.

    \begin{align*}     (243)_5 &= 2\cdot 5^2+4 \cdot 5^1+3\cdot 5^0 \\     &= 2\cdot 25+4\cdot 5+3\cdot 1 \\     &= 50+20+3=73 \end{align*}

Exercise: Convert (10101)_2 to base 3.

    \begin{align*}     (10101)_2 &= 1\cdot 2^4+0 \cdot 2^3+1\cdot 2^2 + 0\cdot 2^1 + 1 \cdot 2^0 \\     &= 1\cdot 16+4\cdot 1+1\cdot 1 \\     &= 16+4+1=21 \\     &= 2\cdot 3^2+1\cdot 3^1 + 0\cdot 3^0 \\     &= (210)_3 \end{align*}


Let the digits of a base 16 number system be given by:

    \[0\;1\;2\;3\;4\;5\;6\;7\;8\;9\;\text{A}\;\text{B}\;\text{C}\;\text{D}\;\text{E}\;\text{F}\]

This is known as hexidecimal.
Example: Convert 251 into to base 16.

    \begin{align*}     251&= 15\cdot16^1+11\cdot 16^0 \\     &= (\text{FB})_{16} \end{align*}


Exercise: Convert (11101)_2 into to base 16.

    \begin{align*}     (11101)_2&= 1\cdot 2^4+1\cdot 2^3 + 1\cdot 2^2 + 0\cdot 2^1 + 1\cdot 2^0 \\     &= 16+8+4+1 \\     &=1\cdot 16^1 + 13\cdot 16^0 \\     &= (1\text{D})_{16} \end{align*}


Related Topic: Adding and Subtracting Numbers in Different Bases