Byte

Ternary numeral system

Numeral systems by culture
Hindu-Arabic numerals
Western Arabic (Hindu numerals)
Eastern Arabic
Indian family
Tamil
Burmese
Khmer
Lao
Mongolian
Thai
East Asian numerals
Chinese
Japanese
Suzhou
Korean
Vietnamese
Counting rods
Alphabetic numerals
Abjad
Armenian
Āryabhaṭa
Cyrillic
Ge'ez
Greek
Georgian
Hebrew
other historical systems
Aegean
Attic
Babylonian
Brahmi
Egyptian
Etruscan
Inuit
Kharosthi
Mayan
Quipu
Roman
Positional systems by base
Decimal (10)
2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 20, 24, 27, 30, 36, 60, 64
Balanced ternary
Non-positional system
Unary numeral system (Base 1)
List of numeral systems

Ternary (sometimes called trinary) is the base-3 numeral system. Analogous to a bit, a ternary digit is a trit (trinary digit). One trit contains \log_2 3 (about 1.58496) bits of information. Although ternary most often refers to a system in which the three digits 0, 1, and 2 are all whole numbers, the adjective also lends its name to the balanced ternary system, used in comparison logic and ternary computers.


Contents

Comparison to other radixes

Compared to decimal and binary

Representations 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.

Sum of the digits in ternary as opposed to binary

Whereas in binary the sum of all previous digit values before 2n can be found using the formula 2n-1, in ternary 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 ternary the fourth digit has a value of 27 and the sum of all previous ternary 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) 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.

Practical usage

A 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 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, 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 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 nonzero term of the first expression, followed by an infinite tail of twos. For example: .1020 is equivalent to .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 highest radix economy, followed closely by binary and quaternary. It has been used for some computing systems because of this efficiency. It is also used to represent 3 option trees, such as phone menu systems, which allow a simple path to any branch.

Tryte

Some ternary computers such as the Setun defined a tryte to be 6 trits, analogous to the binary byte.

See also

Notes

  1. ^ Mohsen Soltanifar, On A sequence of cantor Fractals, Rose Hulman Undergraduate Mathematics Journal, Vol 7, No 1, paper 9, 2006.
  2. ^ Mohsen Soltanifar, A Different Description of A Family of Middle-a Cantor Sets, American Journal of Undergraduate Research, Vol 5, No 2, pp 9–12, 2006.
  3. ^ Brousentsov, N. P.; Maslov, S. P.; Ramil Alvarez, J.; Zhogolev, E.A.. "Development of ternary computers at Moscow State University". http://www.computer-museum.ru/english/setun.htm. Retrieved 20 January 2010. 

References

This article includes a list of references, but its sources remain unclear because it has insufficient inline citations. Please help to improve this article by introducing more precise citations. (September 2010)

External links

Uninterpreted
Numeric
Text
Pointer
Composite
Other
Related topics


szafy | proteindrik slankekur | abiword | kursy językowe za granicą | szlabany warszawa
All text is available under the terms of the GNU Free Documentation License