rec.puzzles Archive

How much is 7 in base (-1)?

arithmetic/negative.base New

New entry, edited from material collected for the archive and not yet in a released version.

Problem

How much is 7 in base (-1)?

[ Editor: the poster, Dragomir R. Radev, later said the question was
supposed to be "How much is 7 in base (-2)?", that is, 7 in decimal
converted to base negative 2. ]
Show solution
The question is ambiguous.  It could mean:

        (1) Assuming "7" the representation of a number in base -1,
            what is the decimal form of this number?

        (2) What is the representation in base -1 of the number whose
            decimal representation is 7?

Question (1) is easy.  The answer is 7 * (-1)^0 = 7 * 1 = 7.  One might
ask why the digit "7" is being used in representing a number in base
-1.  This is a bit unconventional, but it makes perfectly good sense.
For example, when using base 8, one could interpret "90" to be a
synonym for "110" in which the carry has simply been delayed.

Question (2) is harder.  Negative bases do work quite well in general;
for example, the (decimal) number 7 may be written as 11011 in base -2,
because

(11011)_(-2) = 1 * (-2)^4 + 1 * (-2)^3 + 0 * (-2)^2 + 1 * (-2)^1 + 1 * (-2)^0
             = 1 * 16 + 1 * (-8) + 0 * 4 + 1 * (-2) + 1 * 1
             = 16 - 8 - 2 + 1
             = 7.

In base -n we normally use the same set of digits that we would use in
base +n (just 0 and 1, in the case of base +/-2).

It would appear that, according to this rule, the only digit available
for representing numbers in base +/- 1 would be the digit 0.  Since it
is hard to get nonzero numbers by adding zeros together, an exception
has been made for base 1, where the convention is to write a string of
ones (Turing machine fashion) to represent the number.

This convention does not work very well for base -1, because it appears
that adjacent ones would offset each other, being opposite in sign.
This seems to require at least two symbols, either (0 and 1) or (1 and
blank), to have a chance of representing numbers -- but if you are
going to use two symbols, you might as well be using base -2 in the
first place.  For that matter, you can just as well use the digit 7 and
simply write

        7

in base -1, which means 7 * (-1)^0 = 7 * 1 = 7.  It looks like
cheating, but it's just as legal as the alternative.  (Don't ask how to
write 123456789 in base -1.)

-- Dave Seaman <ags@seaman.cc.purdue.edu>

I think you missed the point, it is a trick question.  He didn't ask
how to represent 7 in base (-1), he just asked how much is it.  7 is 7
irregardless of the base, just like PI is PI irregardless of the base.
However, since you like playing with different bases, here is a fun
one.  Try writing your computer program to write numbers using an
irrational base.  For example:

  20 base PI ==  2*PI

Lots of fun when you try to write something like the number 3 in base
PI.  In base 10 there is more than one way to write numbers.  For
example:

  1 = 0.99999999999999999999999999999999999999999999999999999999999...

In base PI, the examples become far more interesting...  Of course the
standard rule that you can't use a digit larger than or equal to your
base applies.  So, in the example of base PI, you can use digits 0, 1,
2, and 3.  I always wanted to make a processor that worked in base
2.54 instead of binary (convenient for metric conversions) but Intel
beat me to it with Pentiums.

-- Bill C. Riemers <bcr@physics.purdue.edu>

>Of course, this question was supposed to be:
>
>   How much is 7 in base (-2)?
>
>That is: 7 in decimal needs to be converted to base negative 2.

Either 11011 or -1001

-- Stephen H. Landrum <slandrum@3do.com>