Ternary numeral system
Encyclopedia
Ternary is the base- numeral system
Numeral system
A numeral system is a writing system for expressing numbers, that is a mathematical notation for representing numbers of a given set, using graphemes or symbols in a consistent manner....

. Analogous to a bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

, a ternary digit
Numerical digit
A digit is a symbol used in combinations to represent numbers in positional numeral systems. The name "digit" comes from the fact that the 10 digits of the hands correspond to the 10 symbols of the common base 10 number system, i.e...

 is a trit (trinary digit). One trit contains (about 1.58496) bits of information. Although ternary most often refers to a system in which the three digits , , and are all whole number
Whole number
Whole number is a term with inconsistent definitions by different authors. All distinguish whole numbers from fractions and numbers with fractional parts.Whole numbers may refer to:*natural numbers in sense — the positive integers...

s, the adjective also lends its name to the balanced ternary
Balanced ternary
Balanced ternary is a non-standard positional numeral system , useful for comparison logic. It is a ternary system, but unlike the standard ternary system, the digits have the values −1, 0, and 1...

 system, used in comparison logic and ternary computer
Ternary computer
A ternary computer is a computer that uses ternary logic instead of the more common binary logic in its calculations.-History:...

s.

Compared to decimal and binary

Representations of integer numbers in ternary do not get uncomfortably lengthy as quickly as in binary
Binary numeral system
The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...

. For example, decimal 365
365 (number)
365 is the natural number following 364 and preceding 366.-Mathematics:365 is a semiprime centered square number...

 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
Decimal
The decimal numeral system has ten as its base. It is the numerical base most widely used by modern civilizations....

 — see below for a compact way to codify ternary using nonary
Nonary
Nonary is a base- numeral system, typically using the digits 0-8, but not the digit 9.The first few numbers in nonary and decimal are:Nonary 1 2 3 4 5 6 7 81011121314Decimal 1 2 3 4 5 6 7 8 910111213The...

 and septemvigesimal
Septemvigesimal
A septemvigesimal numeral system has a base of twenty-seven. It is used in two natural languages, the Telefol language and the Oksapmin language of Papua New Guinea....

.
Numbers one to twenty-seven in standard ternary
Ternary 1 2 10 11 12 20 21 22 100
Binary 1 10 11 100 101 110 111 1000 1001
Decimal 1 2 3 4 5 6 7 8 9
Ternary 101 102 110 111 112 120 121 122 200
Binary 1010 1011 1100 1101 1110 1111 10000 10001 10010
Decimal 10 11 12 13 14 15 16 17 18
Ternary 201 202 210 211 212 220 221 222 1000
Binary 10011 10100 10101 10110 10111 11000 11001 11010 11011
Decimal 19 20 21 22 23 24 25 26 27

Powers of three in ternary
Ternary 1 10 100 1 000 10 000
Binary 1 11 1001 1 1011 101 0001
Decimal 1 3 9 27 81
Power 30 31 32 33 34
Ternary 100 000 1 000 000 10 000 000 100 000 000 1 000 000 000
Binary 1111 0011 10 1101 1001 1000 1000 1011 1 1001 1010 0001 100 1100 1110 0011
Decimal 243 729 2 187 6 561 19 683
Power 35 36 37 38 39


As for rational number
Rational number
In mathematics, a rational number is any number that can be expressed as the quotient or fraction a/b of two integers, with the denominator b not equal to zero. Since b may be equal to 1, every integer is a rational number...

s, 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
Prime number
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. For example 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the divisors 2...

 factor
Factorization
In mathematics, factorization or factoring is the decomposition of an object into a product of other objects, or factors, which when multiplied together give the original...

 of the base.
Fractions in ternary
Ternary 0.111111111111... 0.1 0.020202020202... 0.012101210121... 0.011111111111... 0.010212010212...
Binary 0.1 0.010101010101... 0.01 0.001100110011... 0.00101010101... 0.001001001001...
Decimal 0.5 0.333333333333... 0.25 0.2 0.166666666666... 0.142857142857...
Fraction 1/2 1/3 1/4 1/5 1/6 1/7
Ternary 0.010101010101... 0.01 0.002200220022... 0.002110021100... 0.002020202020... 0.002002002002...
Binary 0.001 0.000111000111... 0.000110011001... 0.000101110100... 0.000101010101... 0.000100111011...
Decimal 0.125 0.111111111111... 0.1 0.090909090909... 0.083333333333... 0.076923076923...
Fraction 1/8 1/9 1/10 1/11 1/12 1/13

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
Nonary
Nonary is a base- numeral system, typically using the digits 0-8, but not the digit 9.The first few numbers in nonary and decimal are:Nonary 1 2 3 4 5 6 7 81011121314Decimal 1 2 3 4 5 6 7 8 910111213The...

 (base 9, each digit is two ternary digits) or septemvigesimal
Septemvigesimal
A septemvigesimal numeral system has a base of twenty-seven. It is used in two natural languages, the Telefol language and the Oksapmin language of Papua New Guinea....

 (base 27, each digit is three ternary digits) is often used, similar to how octal
Octal
The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Numerals can be made from binary numerals by grouping consecutive binary digits into groups of three...

 and hexadecimal
Hexadecimal
In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...

 systems are used in place of binary
Binary numeral system
The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...

.

Practical usage

A base-three system is used in Islam
Islam
Islam . The most common are and .   : Arabic pronunciation varies regionally. The first vowel ranges from ~~. The second vowel ranges from ~~~...

 to keep track of counting Tasbih
Tasbih
A misbaha , subha , Tasbih , or tespih is a string of prayer beads which is traditionally used by Muslims to keep track of counting in tasbih....

 to 99 or to 100 on a single hand
Hand
A hand is a prehensile, multi-fingered extremity located at the end of an arm or forelimb of primates such as humans, chimpanzees, monkeys, and lemurs...

 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 Tasbih
Tasbih
A misbaha , subha , Tasbih , or tespih is a string of prayer beads which is traditionally used by Muslims to keep track of counting in tasbih....

s into groups of three.

A rare "ternary point" is used to denote fractional parts of an inning in baseball
Baseball
Baseball is a bat-and-ball sport played between two teams of nine players each. The aim is to score runs by hitting a thrown ball with a bat and touching a series of four bases arranged at the corners of a ninety-foot diamond...

. Since each inning consists of three outs
Out (baseball)
In baseball, an out occurs when the defensive, or fielding, team effects any of a number of different events, and the umpire rules a batter or baserunner out. When a player is called out, he is said to be retired...

, 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
Innings pitched
In baseball, innings pitched are the number of innings a pitcher has completed, measured by the number of batters and baserunners that are put out while the pitcher on the pitching mound in a game. Three outs made is equal to one inning pitched. One out counts as one-third of an inning, and two...

 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
Sierpinski triangle
The Sierpinski triangle , also called the Sierpinski gasket or the Sierpinski Sieve, is a fractal and attractive fixed set named after the Polish mathematician Wacław Sierpiński who described it in 1915. However, similar patterns appear already in the 13th-century Cosmati mosaics in the cathedral...

 or the Cantor set
Cantor set
In mathematics, the Cantor set is a set of points lying on a single line segment that has a number of remarkable and deep properties. It was discovered in 1875 by Henry John Stephen Smith and introduced by German mathematician Georg Cantor in 1883....

 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 preceeding 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
Radix economy
Various proposals have been made to quantify the relative costs between using different radices in representing numbers, especially in computer systems.-Definition:...

, followed closely by binary
Binary
- Mathematics :* Binary numeral system, a representation for numbers using only two digits * Binary function, a function in mathematics that takes two arguments- Computing :* Binary file, composed of something other than human-readable text...

 and quaternary
Quaternary numeral system
Quaternary is the base- numeral system. It uses the digits 0, 1, 2 and 3 to represent any real number.It shares with all fixed-radix numeral systems many properties, such as the ability to represent any real number with a canonical representation and the characteristics of the representations of...

. 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 computer
Ternary computer
A ternary computer is a computer that uses ternary logic instead of the more common binary logic in its calculations.-History:...

s such as the Setun
Setun
Setun was a balanced ternary computer developed in 1958 at Moscow State University. The device was built under the lead of Sergei Sobolev and Nikolay Brusentsov. It was the only modern ternary computer, using three-valued ternary logic instead of two-valued binary logic prevalent in computers...

 defined a tryte to be 6 trits, analogous to the binary byte
Byte
The byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...

.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK