Browse Search Popular Register Upload Rules User list Login:
Search:
The Beauty of Balanced Ternary

Image:
screenshot of the scene

Author: P11234567899D

Group: Default

Filesize: 10.79 kB

Date added: 2026-08-21

Rating: 5

Downloads: 46

Views: 20

Comments: 1

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

In Balanced Ternary, numbers are represented using a positional numeral system (just like standard decimal or binary), but with a twist: the base is 3, and the allowed digits (trits) are:

1 = positive one
0 = zero
T = negative one (often written as T, B, or a bar over 1)

Because there is no separate minus sign, the sign of the number is built directly into the representation.

Each position corresponds to a power of 3. For a trit string d[n]d[n-1]d[n-2]...d[2]d[1]d[0], its value is summation(i=0, n, [i]×3^i). For example, the trit string 1T01 represents 1*27-1*9+0*3+1=27-9+1=19.

To convert a decimal number N into balanced ternary, the process goes like this:
When N isn't 0, divide N by 3 and take the remainder. If the remainder is 0, just write 0, then continue dividing the quotient by 3. The same goes if the remainder is 1. If the remainder is 2, since balanced ternary doesn't have a digit for 2 but does have one for -1, write T, and use (N + 1) ÷ 3 as the new dividend instead of N ÷ 3.
Read the trits from last to first (most significant to least).

To convert from balanced ternary to decimal, simply multiply each trit by its power of 3 and sum them up.

Its brilliance are reflect by four points:
1. No sign bit: Negating a number is just swapping every 1 with T and every T with 1 (leave 0s). Example: 10T (8) becomes T01 (-8).
1T. Unique representation: Every integer has exactly one Balanced Ternary form (no leading zeros).
10. Rounding: Truncating a Balanced Ternary number rounds it to the nearest integer (since the digits are centered at zero), which is great for computer math and signal processing.
11. Addition is intuitive but has a carry rule: 1+1 = 1T (carry 1 to the next digit, leave T), and T+T = T1 (carry T to the next digit, leave 1).

When you see a Balanced Ternary number, think of it as "subtract the T positions" and "add the 1 positions", relative to powers of 3. This symmetric representation is why computer scientist Donald Knuth famously advocated for it—it's mathematically beautiful and computationally efficient.

The picture shows the results of representing the numbers 1 to 10 in balanced ternary, where red represents 1, cyan represents -1, white represents 3, black represents -3, light red checkered represents 9, dark cyan checkered represents -9, and so on.
Please log in to rate this scene
edit
Similar scenes
Title: Mechanical Ternary Counter V1.1
Rating: 5
Filesize: 108.05 kB
Downloads: 624
Comments: 0
Ratings: 1
Date added: 2016/10/30 20:29:45
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Delayed Ternary
Rating: 5
Filesize: 1.28 MB
Downloads: 1159
Comments: 3
Ratings: 1
Date added: 2026/06/14 17:58:47
Made with: Algodoo v2.2.4
Rating: rated 5
download
Title: ternary counter numbered
Rating: 5
Filesize: 21.7 kB
Downloads: 785
Comments: 5
Ratings: 1
Date added: 2015/06/08 22:54:01
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Off-Centered Ternary - v0.1
Rating: 5
Filesize: 20.43 kB
Downloads: 183
Comments: 0
Ratings: 1
Date added: 2026/07/31 17:43:53
Made with: Algodoo v2.2.4
Rating: rated 5
download
Title: Odd circle arrangement is perfectly balanced!
Rating: 5
Filesize: 19.68 kB
Downloads: 313
Comments: 2
Ratings: 1
Date added: 2018/12/06 19:13:44
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Mechanical Ternary Counter V1.0
Rating: 5
Filesize: 102.82 kB
Downloads: 613
Comments: 0
Ratings: 1
Date added: 2016/10/30 19:33:25
Made with: Algodoo v2.1.0
Rating: rated 5
download
But it really is a beauty:D