Numbers and Arithmetic

Balanced Ternary, a Number System With a Negative Digit

Meet the base-three system that uses digits minus one, zero and one, and see how it handles negatives, rounding and balance scales.

Key takeaways

  • Balanced ternary uses place values that are powers of three, with each digit equal to −1, 0 or 1.
  • Negating a number only requires swapping every 1 with T and every T with 1, so no minus sign is needed.
  • Cutting off digits after the point rounds to a nearest value, which ordinary decimal truncation does not do.
  • The system solves the classic problem of weighing every whole load up to 40 units with weights of 1, 3, 9 and 27.

Balanced ternary is a base-three number system whose digits are −1, 0 and 1 instead of the usual 0, 1 and 2. Every whole number, positive or negative, can be written this way, and each in exactly one way (ignoring leading zeros).

The negative digit is usually written T, a 1 with a bar pushed on top. So 1T means one three minus one, which is 2. That small change removes the need for a separate minus sign and makes several operations unusually tidy.

How the places work

The place values are 1, 3, 9, 27, 81 and so on. Each digit says whether to add that power of three, skip it or subtract it. Read 1T0T from the left:

1 × 27 = 27
T × 9  = −9
0 × 3  =  0
T × 1  = −1
total  = 17

Here are the first numbers counting up from zero.

Value Balanced ternary Meaning
1 1 1
2 1T 3 − 1
3 10 3
4 11 3 + 1
5 1TT 9 − 3 − 1
6 1T0 9 − 3
7 1T1 9 − 3 + 1
8 10T 9 − 1
9 100 9
13 111 9 + 3 + 1
14 1TTT 27 − 9 − 3 − 1

With three digits you get 3³ = 27 different strings, and they cover every integer from −13 to 13 exactly once. In general, n digits cover the range from −(3ⁿ − 1)/2 to (3ⁿ − 1)/2. The range is symmetric, which is the "balance" in the name.

Negative numbers come free

To negate a balanced ternary number, swap each 1 with T and each T with 1. Zeros stay put. Since 5 is 1TT, you know at once that −5 is T11, which reads as −9 + 3 + 1.

The sign of a number is simply the sign of its leftmost nonzero digit. A leading 1 means positive and a leading T means negative. The reason is that a power of three outweighs all the smaller powers put together: 27 is larger than 9 + 3 + 1 = 13, so the lower digits can never reverse the sign.

Compare this with ordinary notation, where subtraction and addition need separate procedures and a sign has to be tracked on the side. In balanced ternary, a − b is just a plus the swapped version of b. Rules about signs, such as why a negative times a negative is positive, appear directly in the one-digit multiplication table, where T × T = 1.

Converting from decimal

Use repeated division by 3, with one adjustment. A remainder of 2 is not an allowed digit, so write T and add 1 to the quotient. This is legitimate because 2 = 3 − 1: you borrow one extra three and subtract one.

Here is 20.

20 ÷ 3 = 6 remainder 2   write T, quotient becomes 7
 7 ÷ 3 = 2 remainder 1   write 1
 2 ÷ 3 = 0 remainder 2   write T, quotient becomes 1
 1 ÷ 3 = 0 remainder 1   write 1
read upward: 1T1T

Check by place value: 27 − 9 + 3 − 1 = 20.

For a negative number, convert its absolute value and then swap the digits. Going from balanced ternary back to decimal is just the weighted sum shown earlier. The same repeated-division idea drives conversions into binary and other bases.

Converting 20 into balanced ternary
1 Divide by 3 20 gives 6 remainder 2: write T, carry up to 7 2 Again 7 gives 2 remainder 1: write 1 3 Again 2 gives 0 remainder 2: write T, carry up to 1 4 Last digit 1 remains: write 1 5 Read backward 1T1T equals 27 − 9 + 3 − 1 Divide by 3 20 gives 6 remainder 2: write T, carry up to 7 1 Again 7 gives 2 remainder 1: write 1 2 Again 2 gives 0 remainder 2: write T, carry up to 1 3 Last digit 1 remains: write 1 4 Read backward 1T1T equals 27 − 9 + 3 − 1 5

Addition and multiplication

Adding two digits gives a result between −2 and 2. Only the two extremes need a carry.

  • 1 + 1 = 2, written as 1T: put down T and carry 1.
  • T + T = −2, written as T1: put down 1 and carry T.
  • 1 + T = 0, with nothing to carry.

Add 8 (10T) and 5 (1TT).

ones:    T + T = −2          write 1, carry T
threes:  0 + T + T = −2      write 1, carry T
nines:   1 + 1 + T = 1       write 1
result:  111 = 9 + 3 + 1 = 13

Multiplication is easier than in decimal. The only digit products are 1, 0 and −1, so you never memorize a times table. To multiply 5 (1TT) by 4 (11), add 1TT to a copy of itself shifted one place left, 1TT0.

ones:      0 + T = T
threes:    T + T = −2        write 1, carry T
nines:     T + 1 + T = −1    write T
27s:       1
result:    1T1T = 20

Each partial product is a copy of the first number, a swapped copy, or zero.

Subtraction, comparison and quick tests

Subtraction needs no new rules. To work out 13 − 5, swap the digits of 5 (1TT becomes T11) and add it to 13 (111).

ones:    1 + 1 = 2           write T, carry 1
threes:  1 + 1 + 1 = 3       write 0, carry 1
nines:   1 + T + 1 = 1       write 1
result:  10T = 9 − 1 = 8

Comparing two numbers is also uniform. Pad them to the same length and look for the first place from the left where they differ. Ranking the digits T below 0 below 1, the number with the higher digit there is larger. This holds for positive and negative numbers alike, with no special case for signs.

A couple of properties can be read off at a glance. A number is divisible by 3 exactly when its last digit is 0, because every other place is a multiple of three. It is even exactly when it has an even number of nonzero digits. Each power of three is odd, and adding or subtracting an even count of odd numbers always gives an even result. For 8, written 10T, there are two nonzero digits, and 8 is indeed even.

Rounding by chopping

Digits can continue to the right of a point, worth 1/3, 1/9, 1/27 and so on. Suppose you simply delete everything after a certain place. What is the largest error? The discarded digits could at most all be 1 (or all T), and 1/3 + 1/9 + 1/27 + ... adds up to exactly 1/2. That sum is a geometric series.

So the part you drop is never more than half of the last place you keep. Chopping therefore always lands on a nearest value. In decimal, chopping 2.9 gives 2, which is far from the closest whole number.

The one borderline case is a value exactly halfway. It has two infinite expansions: one half can be written as 0.111... or as 1.TTT..., just as decimal has two ways to write one.

The balance scale puzzle

An old puzzle, often associated with the seventeenth-century French writer Bachet, asks for the fewest weights that can measure every whole load from 1 to 40 on a two-pan balance. The answer is four weights: 1, 3, 9 and 27.

Each weight has three possible positions: in the pan opposite the object (add it), in the same pan as the object (subtract it) or left on the table (skip it). Those are the digits 1, T and 0. Four digits cover every integer up to (81 − 1)/2 = 40.

To weigh 20 units, use the expansion 1T1T. Put 27 and 3 in the pan opposite the object, and put 9 and 1 beside it. One side holds 30 and the other holds 20 + 9 + 1 = 30. The scale balances.

If weights could only go opposite the object, you would be back to a two-choice system, and you would need 1, 2, 4, 8, 16 and 32: six weights to get through 40.

One weight, three choices
Each weight Matches one ternary digit On the table Digit 0: leave it out Opposite pan Digit 1: add its value Object's pan Digit T: subtract it Each weight Matches one ternary digit Opposite pan Digit 1: add its value Object's pan Digit T: subtract it On the table Digit 0: leave it out

Machines that used three states

Balanced ternary has been built into hardware. In 1840 Thomas Fowler, in England, built a wooden calculating machine that worked on this principle. In 1958 a team at Moscow State University, with Nikolay Brusentsov as a leading designer, produced Setun, an electronic computer based on balanced ternary.

There is a theoretical argument for base three. Suppose the cost of representing numbers is proportional to the number of states per digit times the number of digits. For large ranges that cost behaves like b/ln b for base b, where ln is the natural logarithm. The continuous minimum is at b = e ≈ 2.718, and among whole numbers 3 does slightly better than 2: about 2.73 against 2.89.

The assumption is the weak point. Real hardware does not charge equally per state. Circuits that need only to tell "on" from "off" are robust, fast and cheap, and that practical advantage is why binary dominates.

Fractions after the point

Some fractions that are awkward elsewhere are short here. One third is 0.1, and two thirds is 1.T, which reads as one minus a third. One ninth is 0.01. One quarter, on the other hand, repeats, since four is not a power of three.

Common stumbling points

Reading T as ten. In hexadecimal, letters stand for values above nine. Here T stands for negative one. Some books write it as a minus sign or as a 1 with a bar over it, so check the convention before you decode.

Confusing it with ordinary ternary. Standard base three uses 0, 1 and 2. The numeral 12 means five there, but 12 is not a legal balanced ternary string, since 2 is not among the digits.

Forgetting the adjustment when converting. If you write T for a remainder of 2 but do not add 1 to the quotient, your result will be short by a multiple of three. Checking the answer by place value catches this at once.

Expecting the length to match decimal. Each ternary digit carries less information than a decimal digit, so numerals are roughly twice as long. The number 1000 needs seven balanced ternary digits, because six digits reach only 364.

Why it is worth knowing

Balanced ternary shows that a digit set is a design decision. Allowing a negative digit buys symmetry: no special sign, simple negation and well-behaved rounding. The cost is unfamiliarity, plus longer strings than decimal.

The idea of signed digits also turns up in ordinary arithmetic. Computing 98 × 7 as 100 × 7 − 2 × 7 treats 98 as "one hundred, minus two," and some multiplication circuits use signed-digit recoding of binary numbers to reduce the number of additions.

For practice, write the numbers from −13 to 13 as three-digit strings. You will see that the list for negative values mirrors the positive one digit for digit, and that the last digit cycles through T, 0, 1 as you count. Then try the puzzle of weighing 25 units: the expansion is 10T1, since 27 − 3 + 1 = 25.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 38 articles in Numbers and Arithmetic →

Latest news on this topic