It is possible to memorize algorithms for, for example, converting a base-10 number into base-7. However, it is easier in the long run to understand what bases really represent, and what we mean when we say a number is written in base 10 as "3,264" for example. Once you understand that, it is easy to figure out how to convert from base-10 to base-7 or any other base, without memorizing formulas.

Andreea, Erika, and Katharyn are organizing the first national convention for the Organization Of Girls Who Spell Their Own Names Wrong. From the hotel to the convention center, the available forms of transportation are:

- unicycles that can carry 1 person apiece
- minivans that can carry 10 people apiece
- buses that can carry 100 people apiece
- cruise ships that can carry 1,000 people apiece

So, the girls start by filling up the cruise ships (each with a capacity of 1,000) until 3 ships are completely filled, but there aren't enough girls remaining to fill a 4th ship, so the 3 cruise ships depart fully loaded.

At this point, there must be less than 1,000 girls remaining (since there aren't enough to fill up another cruise ship). They start piling into the buses until 2 buses are filled (each with 100 girls), but there aren't enough girls to fill a 3rd bus, so the two buses leave.

We know there are less than 100 girls left (because there weren't enough girls to fill another bus), so the girls start filling the minivans, until 6 minivans are completely full, and those depart. At this point there are only 4 girls left, so they hop onto 4 of the unicycles.

Thus the girls have been divided into groups as follows:

- 3 cruise ships filled with 1,000 girls apiece
- 2 buses filled with 100 girls apiece
- 6 minivans filled with 10 girls apiece
- 4 unicycles carrying 1 girl apiece

All of which should be obvious using 4th grade math. But suppose you change the capacity of the transportation vehicles:

- unicycles that can carry 1 person apiece
- minivans that can carry 7 people apiece
- buses that can carry 7
^{2}= 49 people apiece - cruise ships that can carry 7
^{3}= 343 people apiece - aircraft carriers that can carry 7
^{4}= 2401 people apiece

We know that the total number of girls to transport is 3,264, and we want to transport them using the same rules as before, filling the vehicles from largest to smallest. So we start by filling 1 of the aircraft carriers with 2,401 girls, leaving 3,264 - 2,401 = 863 girls remaining.

With those 863 girls, we can fill 2 cruise ships with 343 girls apiece (but there aren't enough girls to fill a third cruise ship after that). So after filling 2 cruise ships with 343 girls apiece, the number of girls remaining is 863 - (2 x 343) = 177 girls left.

With 177 girls, we can completely fill 3 buses that carry 49 girls apiece. After filling those three buses, the number of girls remaining is 177 - (3 x 49) = 30.

Out of those 30 girls, we can fill 4 buses with 7 girls apiece. Those 4 buses depart, taking 4 x 7 = 28 girls with them, leaving only 2 girls left, and those 2 girls each get their own unicycle.

So the same group of girls has now been divided into groups as follows:

**1**aircraft carrier filled with 7^{4}= 2,401 girls**2**cruise ships filled with 7^{3}= 343 girls apiece**3**buses filled with 7^{2}= 49 girls apiece**4**minivans filled with 7 girls apiece**2**unicycles carrying 1 girl apiece

(Note, it is just a coincidence that the first four bolded numbers in this example, turn out to be 1, 2, 3, 4.)

If you add up the sizes of all of those groups, you get (1 x 2,401) + (2 x 343) + (3 x 49) + (4 x 7) + (2 x 1) = 3,264,
the number of girls you started with -- which of course is what you'd expect, so that's one way to check
your work. But by dividing the girls into groups that are powers of 7, which is what we did above, we also
came up with the base-7 representation of the number.
This base-7 representation is **12342 _{7}**, which is just the digits written
in bold above.

The *meaning* of the digits in the base-7 number 12342_{7} is similar to the meaning of the base-10
number 3,264.
In base 10, we were taught in 2nd grade to think of the "1's digit", the "10's digit", and so on. But if you're
learning about bases, by that time you would understand exponents, and it's more organized
to think of the 1's digit as the "10^{0} digit",
the 10's digit as the "10^{1} digit", the 100's digit as the "10^{2} digit", etc. -- since
by this point you know that 10^{0} = 1, and 10^{1} = 10:

This is what the digits mean when the same number is written in base-7:

Some important things to note:

- The right-most digit is always the "1's digit", no matter what base you are in, since the right-most
digit represents the n
^{0}digit in base n, and n^{0}is always 1. - In base n, the power of n represented by the left-most digit, is 1
*less*than the number of digits. For example, 12342_{7}is a 5-digit number, and the left-most digit is the 7^{4}digit.

In the example above where we had to transport 3,264 people using vehicles whose capacities were powers
of 7, I just gave you the fact that the largest required vehicle would carry 7^{4} = 2,401 people.
In general though, to convert a number X into base 7, you would have to find the highest power of 7 that
is less than or equal to X. For relatively small numbers, this is easy -- start with the number 7,
and keep multiplying by 7 until you get a power of 7 that's larger than the number you want to represent:

- 7
^{1}= 7 - 7
^{2}= 7 x 7 = 49 - 7
^{3}= 49 x 7 = 343 - 7
^{4}= 343 x 7 = 2401 - 7
^{5}= 2401 x 7 = 16807, which is**bigger**than 3264. So we stop here, and 7^{4}= 2401 is the highest power of 7 that is less than or equal to 3264.

- 7
^{4.158}= 3264 - ... which means that 7
^{4}is*less than*3264, while 7^{5}is*greater than*3264 - ... which in turn means that 7
^{4}is the highest power of 7 that is less than or equal to 3264.

- Find the highest power of n that is less than or equal to X. (This can be done by multiplying n by itself until you get a number that is greater than X, or by using the calculator log shortcut above.)
- Once you know the highest power of n that divides X, divide X by that power of n. The
**quotient**, the number of times that that power of n goes into X, becomes the first digit of your base-n number. (It's a good idea to label it as you're working -- for example label it as the 7^{4}digit.) - The
**remainder**you carry over to the next step of the problem. Take the next-highest power of n (for example, if you divided by 7^{4}in the last step, this time divide by 7^{3}.). Taking the remainder from the last phase of the problem, divide it by the current power of n. The**quotient**becomes the next digit of your base-n number, and the**new remainder**you carry over to the next step. - Repeat this cycle until the final remainder you are left with, is less than n. This becomes the
last digit of your base-n number. If you haven't made any mistakes, and you've been labelling the digits
with decreasing powers of n (the 7
^{4}digit, the 7^{3}digit, and so on), then when you fill in the last digit of your result, it should be labeled as the 7^{0}digit, or 1's digit. - (Optional) Check your work by taking the answer and converting back into base 10, to make sure you get the same number you started with.

If you go back to the story problem involving transporting girls on aircraft carriers, ships, buses, minivans and unicycles, this is in fact exactly what we were doing.

If at any stage in the above algorithm, you do a division and find that the quotient is zero, don't forget to fill in that zero as one of the digits in your answer.

For example, suppose you are transporting 102 girls using the network of unicycles, minivans, etc. listed above
where their carrying capacities are powers of 7. The highest power of 7 that is less than 102, is 7^{2} = 49,
and 49 fits into 102 twice. So 2 becomes the first digit of our answer, the 7^{2} digit:

We subtract (49 x 2) from 102, leaving a remainder of 4. Now, since in the last round we divided by 7^{2},
in this round we divide by 7^{1}. 7, of course, does not fit into 4, which means that when you divide
4 by 7, the quotient is 0 and the remainder is 4. But **that 0 has to go into the answer** -- since
we are dividing by 7^{1}, the 0 becomes the 7^{1} digit:

As usual, we carry the remainder 4 to the next round. But now we have arrived at the 7^{0} digit
(i.e. the "1's digit"), so we just fill in the 4 (what we're really doing is dividing 4 by
7^{0}, i.e. dividing 4 by 1, but that amounts to the same thing as just filling in the number 4):

If at any stage of the division, you find that your remainder is zero, then don't forget to fill in any remaining digits with zeroes that haven't been filled in yet.

For example, suppose you're transporting 98 girls using the same available vehicles. The highest
power of 7 that is less than 98, is 49 again, and 49 goes into 98 *exactly twice, with no remainder*.
So, as before, you fill in the 7^{2} digit:

But now your remainder is zero. In terms of the problem, you have no more girls to transport, so
you need zero minivans and zero unicycles. But you still have to fill those digits in,
representing the 7^{1} digit and the 7^{0} digit:

Converting from a non-standard base into base 10 is easier. Simply label the digits according to the power of n that they represent, then multiply each digit by the corresponding power of n, and add them all together.

For example, to convert the base-5 number 3102_{5} into base-10, label the digits appropriately,
starting from the right:

- the 2 is the 5
^{0}digit, or "1's digit" - the 0 is the 5
^{1}digit, or "5's digit" - the 1 is the 5
^{2}digit - the 3 is the 5
^{3}digit

(3 x 5

= 375 + 25 + 0 + 2

= 402.

write the number 7 (or 8 or 9), except the "7" that appears as a
subscript that indicates a
base-7 number: 12342_{7}. In the number itself, the only digits that are available are
0, 1, 2, 3, 4, 5, and 6.
The reason for this is clear if you think back to the examples of aircraft carriers, ships, buses, etc.
and remember that vehicles are filled from largest to smallest, and that you can't move on to filling
up a smaller class of vehicle until the number of people you have left is not enough to fill up any
larger vehicle. (You have to fill ships until you don't have enough girls left to fill a complete ship,
and then you move on to filling up buses.) Using the example where the capacities of the vehicles were
powers of 7, suppose you've finished filling up the ships and you're now filling up the buses, which
can hold 7 This rule is true in everyday base 10 as well, by the way -- no "digit" or "symbol" for the number 10 ever appears in a base-10 number. ("10" is not a symbol, it's the combination of the symbols 1 and 0.) |

Binary, or base-2 numbers, follow all the rules for bases described above. The only two digits in a binary number are 1 and 0.

Converting a base-10 number into binary (and back again) is just a special case of the algorithm given above for converting a base-10 number into a different base. For example, to convert the number 42 into binary:

- The highest power of 2 that is less than 42, is 2
^{5}= 32. So the first digit of your binary number is**1**, the 2^{5}digit. Subtract 32 and you're left with a remainder of 10. - The next-highest power of 2 is 2
^{4}= 16. 16 doesn't go into 10. So the 2^{4}digit is**0**. The entire remainder, 10, gets carried over to the next step. - The next-highest power of 2 is 2
^{3}= 8. 8 goes into 10, once, so the 2^{3}digit is entered as**1**. Subtract 8 from 10 and get a remainder of 2. - The next-highest power of 2 is 2
^{2}= 4. 4 doesn't go into 2. So the 2^{2}digit is**0**. The entire remainder, 2, gets carried over to the next step. - The next-highest power of 2 is 2
^{1}= 2. 2 goes into 2, one time, so we enter the digit**1**. The remainder is 0, however we're**not done yet**-- see the section above, "And, remember to fill in the zeroes on the end as well!". - We still have to fill in the 2
^{0}digit, so we enter that as**0**.

1. All of the previous examples used bases that were less than 10. It is also possible to use
bases that are greater than 10, however in that case you need *more* digits than are available
in the normal numbering system, and you need symbols to represent the digit 10, the digit 11, and so on.

By far the most commonly used numbering system with a base higher than 10 is the hexadecimal
system used in computers, base 16 ("hexadecimal" i.e. "hex" for 6 and "deci" for 10, where 6 + 10 = 16, get it?).
In this system, the digits 10 through 15 are represented by letters:

A = 10, B = 11, C = 12, D = 13, E = 14, F = 15

But otherwise, all the usual rules for converting bases still apply. Knowing this, show that
the base-10 number 300, converted into base 16, would be written 12C_{16}.
Convert back to base-10 to check your
work.

2. We showed that for whole numbers in base-10, the right-most digit represents the 10^{0} digit
or "1's digit", the next digit from the right represents the 10^{1} digit, etc., and showed
how numbers could be written in base 7 for example using the same rules, but using powers of 7 instead
of powers of 10.

Similarly, consider fractional numbers in base 10, such as 4.23. In this number, the 4 is the 10^{0}
digit -- and the 2 is the 10^{-1} digit, and the 3 is the 10^{-2} digit.

Following the same logic, what do you think the different digits represent in the base-3
fractional number 2.102_{3}? Show that this number equals 2^{11}/_{27}
when written as a fraction in the usual way in base 10.

3. You already know that 0.99999... = 1. Similarly, show that the base-2 number
which continues forever, 0.111111..._{2}, is equal to 1.
Hint: each digit represents a fraction. Write the binary number as an infinite sum of fractions, where
it becomes a geometric series.

4. Consider this binary number which continues forever:

0.101010101010..._{2}

Show that this is equal to the fraction 2/3. Hint: again, write the binary number as a sum of
fractions so that it becomes another geometric series, this time with a different common ratio
from the last problem.