- Ternary numeral system
Ternary or trinary is the base-num|3
numeral system . Analogous to a "bit ", a ternary digit is known as a "trit" (trinary digit). One trit contains about 1.58596 () bit of information. Although "ternary" most often refers to a system in which the three digits, num|0, num|1, and num|2, are allnonnegative integer s, the adjective also lends its name to thebalanced ternary system, used in comparison logic andternary computer s.Comparison to other radixes
Compared to decimal and binary
Representations of
integer number s in ternary do not get uncomfortably lengthy as quickly as in binary. For example, decimal 365 corresponds to binary 101101101 (9 digits) and to ternary 111112 (6 digits). However, they are still far less compact than the corresponding representations in bases such asdecimal — see below for a compact way to codify ternary using nonary and septemvigesimal.Sum of the digits in trinary as opposed to binary
Where as in binary, where the sum of all previous digit values before 2n can be found using the formula 2n-1, in trinary the following formula can be used: (3n-1)/2.
An example is where in binary the fourth digit has a value of 8, the sum of all the binary numbers before 8 can be found out using the above formula as 23-1, which is 7. In trinary the fourth digit has a value of 27 and the sum of all previous trinary numbers can be found out using the above formula, as (33-1)/2, which is 13.
The formula is 3n because we are counting to base 3 and we divide by 2 now because the maximum value of each digit is 2. The general formula for the nth digit it a base-N number is:
Nn
and the sum of previous digits:
(Nn-1)/(N-1)
Compact ternary representation: base 9 and 27
Nonary (base 9, each digit is two ternary digits) orseptemvigesimal (base 27, each digit is three ternary digits) is often used, similar to howoctal andhexadecimal systems are used in place of binary. Ternary also has a unit similar to abyte , the tryte, which is six ternary digits.Practical usage
A base-three system is used in
Islam to keep track of countingTasbih to 99 or to 100 on a singlehand for counting prayers (as alternative for theMisbaha ). The benefit—apart from allowing a single hand to count up to 99 or to 100—is that counting doesn't distract the mind too much since the counter needs only to divideTasbih s into groups of three.A rare "ternary point" is used to denote fractional parts of an inning in
baseball . Since each inning consists of three outs, each out is considered one third of an inning and is denoted as .1. For example, if a player pitched all of the 4th, 5th and 6th innings, plus 2 outs of the 7th inning, hisInnings pitched column for that game would be listed as 3.2, meaning 3⅔. In this usage, only the fractional part of the number is written in ternary form.Ternary numbers can be used to convey self-similar structures like a
Sierpinski Triangle or aCantor set conveniently.ee also
*
Ternary logic External links
* [http://www.americanscientist.org/issues/pub/third-base/ Third Base]
* [http://www.washingtonart.net/whealton/ternary.html Ternary Arithmetic]
* [http://www.mortati.com/glusker/fowler/index.htm The ternary calculating machine of Thomas Fowler]
* [http://www.mathsisfun.com/numbers/convert-base.php?to=ternary Ternary Base Conversion] includes fractional part, fromMath Is Fun
* [http://www.americanscientist.org/issues/pub/third-base/3 Gideon Frieder's replacement ternary numeral system]
Wikimedia Foundation. 2010.