A ternary numeral system (also called base 3 or trinary) has three as its radix. Analogous to a bit, a ternary numerical digit is a trit ( trinary dig it). One trit is equivalent to binary logarithm 3 (about 1.58496) bits of information.
Although ternary most often refers to a system in which the three digits are all non–negative numbers; specifically , , and , the adjective also lends its name to the balanced ternary system; comprising the digits −1, 0 and +1, used in comparison logic and .
+ A ternary multiplication table |
+ Numbers from 0 to 33 − 1 in standard ternary | |||||||||
+ Powers of 3 in ternary | |||||||||
As for , ternary offers a convenient way to represent as same as senary (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 (nor for , , etc.), because 2 is not a Prime number factorization of the base; as with base two, one-tenth (decimal, senary ) is not representable exactly (that would need e.g. decimal); nor is one-sixth (senary , decimal ).
+ Fractions in ternary |
Similarly, for a number N( b, d) with base b and d digits, all of which are the maximal digit value , we can write:
Then
For a three-digit ternary number, .
+ Comparison between ternary and nonary |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
Nonary (base 9, each digit is two ternary digits) or septemvigesimal (base 27, each digit is three ternary digits) can be used for compact representation of ternary, similar to how octal and hexadecimal systems are used in place of binary.
A rare "ternary point" in common use is for defensive statistics in American baseball (usually just for Pitcher), to denote fractional parts of an inning. Since the team on offense is allowed three outs, each out is considered one third of a defensive inning and is denoted as .1. For example, if a player pitched all of the 4th, 5th and 6th innings, plus achieving 2 outs in the 7th inning, his innings pitched column for that game would be listed as 3.2, the equivalent of (which is sometimes used as an alternative by some record keepers). 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 the Sierpinski triangle or the Cantor set conveniently. Additionally, it turns out that the ternary representation is useful for defining the Cantor set and related point sets, because of the way the Cantor set is constructed. The Cantor set consists of the points from 0 to 1 that have a ternary expression that does not contain any instance of the digit 1. Any terminating expansion in the ternary system is equivalent to the expression that is identical up to the term preceding the last non-zero term followed by the term one less than the last non-zero term of the first expression, followed by an infinite tail of twos. For example: 0.1020 is equivalent to 0.1012222... because the expansions are the same until the "two" of the first expression, the two was decremented in the second expansion, and trailing zeros were replaced with trailing twos in the second expression.
Ternary is the integer base with the lowest radix economy, followed closely by binary and quaternary. This is due to its proximity to the mathematical constant e. It has been used for some computing systems because of this efficiency. It is also used to represent three-option trees, such as phone menu systems, which allow a simple path to any branch.
A form of redundant binary representation called a binary signed-digit number system, a form of signed-digit representation, is sometimes used in low-level software and hardware to accomplish fast addition of integers because it can eliminate carries.
|
|