Ternary or trinary is the base-3 numeral system. Ternary digits are known as trits (trinary digit), with a name analogous to "bit". One trit contains about 1.58596 (log23) bit of information. Although ternary most often refers to a system in which the three digits, 0, 1, and 2, are all nonnegative integers, the adjective also lends its name to the balanced ternary system, used in comparison logic and ternary computers.
Comparison to other radixesCompared to decimal and binaryRepresentations of integer numbers 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 as decimal — see below for a compact way to codify ternary using nonary and septemvigesimal.
As for rational numbers, ternary offers a convenient way to represent one third (as opposed to its cumbersome representation as an infinite string of recurring digits in decimal); but a major drawback is that, in turn, ternary does not offer a finite representation for the most basic fraction: one half (and thus, neither for one quarter, one sixth, one eighth, one tenth, etc.), because 2 is not a prime factor of the base.
Compact ternary representation: base 9 and 27Nonary (base 9, each digit is two ternary digits) or septemvigesimal (base 27, each digit is three ternary digits) is often used, similar to how octal and hexadecimal systems are used in place of binary. Ternary also has a unit similar to a byte, the tryte, which is six ternary digits. Practical usageA base-three system is used in Islam to keep track of counting Tasbih to 99 or to 100 on a single hand for counting prayers (as alternative for the Misbaha). 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 divide Tasbihs into groups of three. A rare ternary point is used to denote fractional parts of an inning in baseball. Since each inning consists of 3 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, his Innings 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 a Cantor set conveniently. See AlsoExternal links
| | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||