Generalized balanced ternary is a generalization of the balanced ternary numeral system to represent points in a higher-dimensional space.
It was first described in 1982 by Laurie Gibson and Dean Lucas.
[1] It has since been used for various applications, including geospatial[2] and high-performance scientific[3] computing.
Like standard positional numeral systems, generalized balanced ternary represents a point
{\displaystyle p}
as powers of a base
{\displaystyle B}
multiplied by digits
i
p =
Generalized balanced ternary uses a transformation matrix as its base
Digits are vectors chosen from a finite subset
of the underlying space.
In one dimension, generalized balanced ternary is equivalent to standard balanced ternary, with three digits (0, 1, and -1).
matrix, and the digits
are length-1 vectors, so they appear here without the extra brackets.
{\displaystyle {\begin{aligned}B&=3\\D_{0}&=0\\D_{1}&=1\\D_{2}&=-1\end{aligned}}}
This is the same addition table as standard balanced ternary, but with
replacing T. To make the table easier to read, the numeral
is written instead of
In two dimensions, there are seven digits.
The digits
are six points arranged in a regular hexagon centered at
{\displaystyle {\begin{aligned}B&={\frac {1}{2}}{\begin{bmatrix}5&{\sqrt {3}}\\-{\sqrt {3}}&5\end{bmatrix}}\\D_{0}&=0\\D_{1}&=\left(0,{\sqrt {3}}\right)\\D_{2}&=\left({\frac {3}{2}},-{\frac {\sqrt {3}}{2}}\right)\\D_{3}&=\left({\frac {3}{2}},{\frac {\sqrt {3}}{2}}\right)\\D_{4}&=\left(-{\frac {3}{2}},-{\frac {\sqrt {3}}{2}}\right)\\D_{5}&=\left(-{\frac {3}{2}},{\frac {\sqrt {3}}{2}}\right)\\D_{6}&=\left(0,-{\sqrt {3}}\right)\\\end{aligned}}}
As in the one-dimensional addition table, the numeral
is written instead of
having no particular relationship to the number 2).
If there are two numerals in a cell, the left one is carried over to the next digit.
Unlike standard addition, addition of two-dimensional generalized balanced ternary numbers may require multiple carries to be performed while computing a single digit.