Associated Topics || Dr. Math Home || Search Dr. Math

### Representing Numbers in Different Bases

```
Date: 08/05/98 at 03:47:16
From: Irene
Subject: Representation of Numbers

Hi. I am having a problem with the representation of numbers. For
example:

64_(10) = 2101_(3)

where the 10 and the 3 are subscripts. They begin by saying that 64 is
trapped between 3^3 and 3^4. Or to put it another way, 64 lies between
1 x 3^3 and 3 x 3^3. They show this on a number line and say 64 is
trapped between 2 x 3^3 and 3 x 3^3. Thus 64 = 2 x 3^3 + some number
less than 3^3. Since 64 - 2 x 3^3 = 64 - 54 = 10, they say
64 = 2 x 3^3 + 10. Then they say:

64 = 2 x 3^3 + 1 x 3^2 + 1

How did they get the 2 x 3 cubed? Plus some number less than 3 cubed?
I am really in dire need of help. How do you express 200_(10) in
(a) base two, (b) base three, and (c) base four ?

```

```
Date: 08/05/98 at 13:02:58
From: Doctor Peterson
Subject: Re: Representation of Numbers

Hi, Irene. It looks like you're having trouble making the jump from a
picture of what a base means to a method for writing a number in some
base. What you have described is a very slow way to figure out a base
three representation, which is probably meant just to show what base
three is all about. The usual way to write a number in base three is
sort of the reverse of what they did. I'll show you both ways. To make
it more familiar, I'll do it with base ten to start with.

Suppose I have a pile of sticks and I want to count them in base ten.
I count up to ten and make a bundle, then count more in the same way
until I have ten bundles, then bundle the bundles (making a set of
100). I keep doing that until I get 10 sets of 100, and I put those
together to make 1000.

When I am done, I may have 5 1000s, plus 3 left-over sets of 100,
and 4 left-over bundles of 10, and 2 left-over sticks that didn't get
into any bundle. The total count would be:

5 x 1000  +  3 x 100  +  4 x 10  +  2

which we write as 5342 (base 10).

What they have done in their example is to take 64 sticks and bundle
them by threes rather than by tens. They first looked to see how many
digits they would need, and found that they would need bundles of 27
(3^3 = 3 cubed) but wouldn't get as high as 81 (3^4 = 3 to the fourth
power). Then they counted how many bundles of 27 they would get, and
found that 2 x 27 is 54. That leaves 10 more sticks. Those still have
to be bundled into 9's. Since 10 = 9 + 1, they would get one bundle of
9 and one left over. There are no bundles of 3 needed. That means:

64 = 2 x 27  +  1 x 9  +  0 x 3  +  1

which we write as 2101 (base 3).

Their way finds digits of the answer from left to right. They first
divide the number by 27, then divide the remainder by 9, then divide
the remainder from that by 3:

64 / 27 = 2 rem 10
|      |
|      V
|     10 / 9 = 1 rem 1
|              |     |
|              |     V
|              |     1 / 3 = 0 rem 1
|              |             |     |
|              |             |     V
|              |             |     1 / 1 = 1 rem 0
|              |             |             |
V              V             V             V
2              1             0             1

The usual way to write a number in a base works the other way around,
but is a little less obvious. The benefit is that you never have to
work with any divisor other than the base itself. Take those 64 sticks
again. Bundle them in 3's: you'll get 21 bundles of 3 and one left
over. Take the 21 bundles and bundle them by 3's: you'll get 7 bundles
of 9 (3 3's) and none left over. Now take those 7 bundles of 9 and
bundle them by 3's: you'll get 2 bundles of 27 (3 9's) and one left
over. You can't bundle the two 27's by 3's, because there aren't
enough of them left, so you're done. What have you got? Just as before,
two 27's, one 9, no 3's, and one single stick, which makes 2101 (base
3). Notice that we found the last digit first. Here's what the
calculation looks like:

64 / 3 = 21 rem 1 ---------------------------------> 1
|
V
21 / 3 = 7 rem 0 -------------------------> 0
|
V
7 / 3 = 2 rem 1 -----------------> 1
|
V
2 / 3 = 0 rem 2 ---------> 2

Now I'll do one of your problems for you. and you can do the rest.
Here's 200 in base 4:

200 / 4 = 50 rem 0 --------------------------------> 0
|
V
50 / 4 = 12 rem 2 -----------------------> 2
|
V
12 / 4 = 3 rem 0 ---------------> 0
|
V
3 / 4 = 0 rem 3 -------> 3

The answer is 3020 (base 4). Let's check it:

3020 (base 4) = 3 x 4^3  +  0 x 4^2  +  2 x 4  +  0
= 3 x 64   +  0        +  8      +  0
= 192                  +  8
= 200

Looks like we got it.

If any of this doesn't make sense, read through it again with some
real sticks in your hand. If it's still confusing, write me back and
I'll try again.

- Doctor Peterson, The Math Forum
Check out our web site! http://mathforum.org/dr.math/
```
Associated Topics:
High School Basic Algebra
High School Number Theory
Middle School Algebra