What is a balanced base?

A balanced base is a base in which each digit can have either a positive or a negative value. e.g:
Digits of normal ternary: 0, 1, 2
Digits of balanced ternary: -1, 0, 1 (in this instance, often written -,0,+)
However, using two characters to represent a single digit is inconvenient and creates limitless ambiguities, so it is usual to use 1 bar to represent -1. However, HTML does not permit the use of overbars, so I shall instead use 1, 2... to represent -1, -2... For the purposes of this write-up, I shall be working in balanced base 5 (2, 1, 0, 1, 2) for convenience, but the techniques described work equally well in any balanced base. It is usual, also for convenience, to use odd numbers as the base.

Fortunately, unlike irrational bases, numbers do have a unique representation in a balanced base. Exactly the same proof of this applies to balanced bases as to normal bases, because the proof is not dependant on the digits concerned being non-negative.

Conversion of balanced base values to base 10

This is remarkably straight-forward. Take the value 201.
201 >> 2x52 + 0x5 + -1x1
= 49
Just as in base 10, eg 413 = 4x100 + 1x10 + 3x1, it is necessary to write out the value in full and then resolve.

Counting in a balanced base

In a normal assymetric base, counting works as follows (arbitrarily starting from 17):
17
18 (increase right hand digit by 1)
19 (increase right hand digit by 1)
20 (right hand digit could not be increased, so set it to the smallest possible value and increase the next digit along by 1)

The same system works for counting in a balanced base. Starting from 10:
11 (increase right hand digit by 1)
12 (increase right hand digit by 1)
22 (right hand digit could not be increased, so set it to the smallest possible value and increase the next digit along by 1)

Arithmetic in a balance base

For the purposes of arithmetic, it is necessary to return to the same method used in primary school addition: that is, work with single digit at a time and memorise the results of each combination of digits. Then the same rules of carrying etc. apply as with base 10.

The table of values for addition of single digits is:

2  1  0  1  2
---------------
2| 11 12 2  1  0
1| 12 2  1  0  1
0| 2  1  0  1  2
1| 1  0  1  2  12
2| 0  1  2  12 11

eg 12+
21
---
121
---

Checking this in base 10:
12 >> 3 (by the method already described)
21 >> 11
121 >> 14
And 3 + 11 does indeed equal 14.

Subtraction

With subtraction, it is possible to use another table of values, or to rely on a useful result of balanced bases. That is, to negate a value, simply toggle the presence of bars.

eg -211 = 211

This is obvious when you consider expressing a number as each of its digits d times the appropriate power of the base b (for this is a characteristic of all balanced bases), where all members of d ε {2, 1, 0, 1, 2}:

-(d0 x bn + d1 x bn-1 ... + dn x b0) = -d0 x bn + -d1 x bn-1 ... + -dn x b0

Clearly, the digits of the result are just the negations of the original, and are still all members of the required set {2, 1, 0, 1, 2}

This relates to subtraction because a - b = a + (-b), so it is sometimes easier to negate the second number and then perform addition. However, if you prefer to do raw subtraction, the table of values for each combination of digits is:

2  1  0  1  2
---------------
2| 0  1  2  12 11
1| 1  0  1  2  12
0| 2  1  0  1  2
1| 12 2  1  0  1
2| 11 12 2  1  0

Multiplication

Multiplication, like addition, is best handled in the primary school fashion. The table of values for the digit combinations is:

2  1  0  1  2
---------------
2| 11 2  0  2  11
1| 2  1  0  1  2
0| 0  0  0  0  0
1| 2  1  0  1  2
2| 11 2  0  2  11

eg 201 x
11
----
201 +
2010
----
2211
----

Checking in base 10:
201 = 49
11 = 4
22211 = 196
And 49 x 4 is indeed 196, an interesting number in itself.

Division

The only method that I know of for division is a rather exhaustive parellel of the primary school method. This is something that I have been unable to improve, so if you can devise a better way, msg me or add your own write-up below. If I think anything up, I will of course add that.

And now, a request

This article has taken me absolutely ages to format in HTML, so if you spot a typo, please msg me before downvoting. The amount of time I spent fiddling has almost inevitably created a few typing errors. Thanks.

Log in or register to write something here or to contact authors.