Ternary numeral system
Encyclopedia
|
| Tutorials | Encyclopedia | Dictionary | Directory |
|
Ternary numeral system
Ternary or trinary is the base- numeral system. Analogous to a "bit", a ternary digit is known as a trit (trinary digit). One trit contains about 1.58596 (\log_2 3) bit of information. Although ternary most often refers to a system in which the three digits, , , and , 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.
Sum of the digits in trinary as opposed to binaryWhere 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 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 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 a Sierpinski Triangle or a Cantor set conveniently. See alsoExternal links
de:Ternärsystem fr:Système trinaire ko:??? ht:Sistèm trinè ja:??? ru:???????? ??????? ????????? sv:Trinär th:????????? zh:??? Source: Wikipedia | The above article is available under the GNU FDL. | Edit this article
|
|
top
©2008-2009 TutorGig.com. All Rights Reserved. Privacy Statement