|
|
(One intermediate revision by one other user not shown) |
Line 1: |
Line 1: |
| {{Table Numeral Systems}}
| | Hello and welcome. My title is Figures Wunder. Bookkeeping is what I do. South Dakota is her birth place but she needs to move because of her family. The favorite pastime for my kids and me is to play baseball and I'm trying to make it a occupation.<br><br>Stop by my web site :: [http://unblockedflashgames.com/members/lidakmhswk/activity/228798/ over the counter std test] |
| {{Merge from |Nonary |discuss=Talk:Ternary_numeral_system#Merge_from_.22Nonary.22_and_.22Base_27.22 |date=July 2013}}
| |
| '''Ternary''' (sometimes called '''trinary''') is the [[Base (exponentiation)|base]]-{{num|3}} [[numeral system]]. Analogous to a [[bit]], a ternary [[numerical digit|digit]] is a '''trit''' ('''tr'''inary dig'''it'''). One trit contains <math>\log_2 3</math> (about 1.58496) bits of information. Although ''ternary'' most often refers to a system in which the three digits {{num|0}}, {{num|1}}, and {{num|2}} are all non-negative numbers, the adjective also lends its name to the [[balanced ternary]] system, used in comparison logic and [[ternary computer]]s.
| |
| | |
| ==Comparison to other radixes==
| |
| {| class="wikitable" style="float:right; text-align:center"
| |
| |+ A ternary [[multiplication table]]
| |
| |-
| |
| | * || '''1''' || '''2''' || '''10''' || '''11''' || '''12''' || '''20''' || '''21''' || '''22''' || '''100'''
| |
| |-
| |
| | '''1''' || 1 || 2 || 10 || 11 || 12 || 20 || 21 || 22 || 100
| |
| |-
| |
| | '''2''' || 2 || 11 || 20 || 22 || 101 || 110 || 112 || 121 || 200
| |
| |-
| |
| | '''10''' || 10 || 20 || 100 || 110 || 120 || 200 || 210 || 220 || 1000
| |
| |-
| |
| | '''11''' || 11 || 22 || 110 || 121 || 202 || 220 || 1001 || 1012 || 1100
| |
| |-
| |
| | '''12''' || 12 || 101 || 120 || 202 || 221 || 1010 || 1022 || 1111 || 1200
| |
| |-
| |
| | '''20''' || 20 || 110 || 200 || 220 || 1010 || 1100 || 1120 || 1210 || 2000
| |
| |-
| |
| | '''21''' || 21 || 112 || 210 || 1001 || 1022 || 1120 || 1211 || 2002 || 2100
| |
| |-
| |
| | '''22''' || 22 || 121 || 220 || 1012 || 1111 || 1210 || 2002 || 2101 || 2200
| |
| |-
| |
| | '''100''' || 100 || 200 || 1000 || 1100 || 1200 || 2000 || 2100 || 2200 || 10000
| |
| |}
| |
| | |
| | |
| Representations of [[integer number]]s in ternary do not get uncomfortably lengthy as quickly as in [[binary numeral system|binary]]. For example, decimal [[365 (number)|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]].
| |
| | |
| {| class="wikitable"
| |
| |+ '''Numbers one to twenty-seven in standard ternary'''
| |
| |- align="center"
| |
| ! Ternary
| |
| | 1 || 2 || 10 || 11 || 12 || 20 || 21 || 22 || 100
| |
| |- align="center"
| |
| ! Binary
| |
| | 1 || 10 || 11 || 100 || 101 || 110 || 111 || 1000 || 1001
| |
| |- align="center"
| |
| ! Decimal
| |
| | '''1''' || '''2''' || '''3''' || '''4''' || '''5''' || '''6''' || '''7''' || '''8''' || '''9'''
| |
| |-
| |
| |
| |
| |- align="center"
| |
| ! Ternary
| |
| | 101 || 102 || 110 || 111 || 112 || 120 || 121 || 122 || 200
| |
| |- align="center"
| |
| ! Binary
| |
| | 1010 || 1011 || 1100 || 1101 || 1110 || 1111 || 10000 || 10001 || 10010
| |
| |- align="center"
| |
| ! Decimal
| |
| | '''10''' || '''11''' || '''12'''|| '''13''' || '''14''' || '''15''' || '''16''' || '''17''' || '''18'''
| |
| |-
| |
| |
| |
| |- align="center"
| |
| ! Ternary
| |
| | 201 || 202 || 210 || 211 || 212 || 220 || 221 || 222 || 1000
| |
| |- align="center"
| |
| ! Binary
| |
| | 10011 || 10100 || 10101 || 10110 || 10111 || 11000 || 11001 || 11010 || 11011
| |
| |- align="center"
| |
| ! Decimal
| |
| | '''19''' || '''20''' || '''21''' || '''22'''|| '''23''' || '''24''' || '''25''' || '''26''' || '''27'''
| |
| |}
| |
| | |
| {| class="wikitable"
| |
| |+ '''Powers of three in ternary'''
| |
| |- align="center"
| |
| ! Ternary
| |
| | 1 || 10 || 100 || 1 000 || 10 000
| |
| |- align="center"
| |
| ! Binary
| |
| | 1 || 11 || 1001 || 1 1011 || 101 0001
| |
| |- align="center"
| |
| ! Decimal
| |
| | 1 || 3 || 9 || 27 || 81
| |
| |- align="center"
| |
| ! Power
| |
| | '''3<sup>0</sup>''' || '''3<sup>1</sup>''' || '''3<sup>2</sup>''' || '''3<sup>3</sup>''' || '''3<sup>4</sup>'''
| |
| |-
| |
| |
| |
| |- align="center"
| |
| ! Ternary
| |
| | 100 000 || 1 000 000 || 10 000 000 || 100 000 000 || 1 000 000 000
| |
| |- align="center"
| |
| ! Binary
| |
| | 1111 0011 || 10 1101 1001 || 1000 1000 1011 || 1 1001 1010 0001 || 100 1100 1110 0011
| |
| |- align="center"
| |
| ! Decimal
| |
| | 243 || 729 || 2 187 || 6 561 || 19 683
| |
| |- align="center"
| |
| ! Power
| |
| | '''3<sup>5</sup>''' || '''3<sup>6</sup>''' || '''3<sup>7</sup>''' || '''3<sup>8</sup>''' || '''3<sup>9</sup>'''
| |
| |}
| |
| | |
| As for [[rational number]]s, ternary offers a convenient way to represent one third (as opposed to its cumbersome representation as an infinite string of [[recurring decimal|recurring digits]] in decimal); but a major drawback is that, in turn, ternary does not offer a finite representation for one half (neither for one quarter, one sixth, one eighth, one tenth, etc.), because [[2 (number)|2]] is not a [[Prime number|prime]] [[factorization|factor]] of the base.
| |
| | |
| {| class="wikitable"
| |
| |+ '''Fractions in ternary'''
| |
| |- align="center"
| |
| ! Fraction
| |
| | '''1/2''' || '''1/3''' || '''1/4''' || '''1/5''' || '''1/6''' || '''1/7''' || '''1/8''' || '''1/9''' || '''1/10''' || '''1/11''' || '''1/12''' || '''1/13'''
| |
| |- align="center"
| |
| ! Ternary
| |
| | 0.<span style="text-decoration: overline">1</span> || 0.1 || 0.<span style="text-decoration: overline">02</span> || 0.<span style="text-decoration: overline">0121</span> || 0.0<span style="text-decoration: overline">1</span> || 0.<span style="text-decoration: overline">010212</span> || 0.<span style="text-decoration: overline">01</span> || 0.01 || 0.<span style="text-decoration: overline">0022</span> || 0.<span style="text-decoration: overline">00211</span> || 0.0<span style="text-decoration: overline">02</span> || 0.<span style="text-decoration: overline">002</span>
| |
| |- align="center"
| |
| ! Binary
| |
| | 0.1 || 0.<span style="text-decoration: overline">01</span> || 0.01 || 0.<span style="text-decoration: overline">0011</span> || 0.0<span style="text-decoration: overline">01</span> || 0.<span style="text-decoration: overline">001</span> || 0.001 || 0.<span style="text-decoration: overline">000111</span> || 0.0<span style="text-decoration: overline">0011</span> || 0.<span style="text-decoration: overline">0001011101</span> || 0.00<span style="text-decoration: overline">01</span> || 0.<span style="text-decoration: overline">000100111011</span>
| |
| |- align="center"
| |
| ! Decimal
| |
| | 0.5 || 0.<span style="text-decoration: overline">3</span> || 0.25 || 0.2 || 0.1<span style="text-decoration: overline">6</span> || 0.<span style="text-decoration: overline">142857</span> || 0.125 || 0.<span style="text-decoration: overline">1</span> || 0.1 || 0.<span style="text-decoration: overline">09</span> || 0.08<span style="text-decoration: overline">3</span> || 0.<span style="text-decoration: overline">076923</span>
| |
| |}
| |
| | |
| ===Sum of the digits in ternary as opposed to binary===
| |
| The value of a binary number with ''n'' bits that are all 1 is 2<sup>''n''</sup> − 1.
| |
| | |
| Similarly, for a number ''N''(''b'',''d'') with base ''b'' and ''d'' digits, all of which are the maximum digit value ''b'' − 1, we can write
| |
| | |
| ''N''(''b'',''d'') = (''b'' − 1) ''b''<sup>''d''−1</sup> + (''b'' − 1) ''b''<sup>''d''−2</sup> + … + (''b'' − 1) ''b''<sup>1</sup> + (''b'' − 1) ''b''<sup>0</sup>,
| |
| | |
| ''N''(''b'',''d'') = (''b'' − 1) (''b''<sup>''d''−1</sup> + ''b''<sup>''d''−2</sup> + … + ''b''<sup>1</sup> + 1),
| |
| | |
| ''N''(''b'',''d'') = (''b'' − 1) M.
| |
| | |
| ''bM'' = ''b''<sup>''d''</sup> + ''b''<sup>''d''−1</sup> + … + ''b''<sup>2</sup> + ''b''<sup>1</sup>, and
| |
| | |
| −''M'' = −''b''<sup>''d''−1</sup> − ''b''<sup>''d''−2</sup> − … − b<sup>1</sup> − 1, so
| |
| | |
| ''bM'' − ''M'' = ''b''<sup>''d''</sup> − 1, or
| |
| | |
| ''M'' = (''b''<sup>''d''</sup> − 1)/(''b'' − 1).
| |
| | |
| Then, ''N''(''b'',''d'') = (''b'' − 1)''M'',
| |
| | |
| ''N''(''b'',''d'') = (''b'' − 1) (''b''<sup>''d''</sup> − 1)/(''b'' − 1), and
| |
| | |
| ''N''(''b'',''d'') = ''b''<sup>''d''</sup> − 1.
| |
| For a 3-digit ternary number, ''N''(3,3) = 3<sup>3</sup> − 1 = 26 = 2 × 3<sup>2</sup> + 2 × 3<sup>1</sup> + 2 × 3<sup>0</sup> = 18 + 6 + 2.
| |
| | |
| ===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 numeral system|binary]].
| |
| | |
| ==Practical usage==
| |
| <!-- Deleted image removed: [[File:JamieMoyerInningsPitched.jpg|frame|right|''Innnings Pitched'' column on a baseball card]] -->
| |
| 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 [[Tasbih]]s into groups of three.
| |
| | |
| In certain analog logic, the state of the circuit is often expressed ternary. This is most commonly seen in [[Transistor–transistor logic]] using 7406 [[Open collector|open collector]] logic. The output is said to either be low (grounded), high, or open ([[High impedance|high-Z]]). In this configuration the output of the circuit is actually not connected to any voltage reference at all. Where the signal is usually grounded to a certain reference, or at a certain voltage level, the state is said to be high impedance because it is open and serves its own reference. Thus, the actual voltage level is sometimes unpredictable.
| |
| | |
| A rare "ternary point" is used to denote fractional parts of an [[Innings#Baseball|inning]] in [[baseball]]. Since each inning consists of three [[Out (baseball)|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.<ref>Mohsen Soltanifar, ''On A sequence of cantor Fractals'', Rose Hulman Undergraduate Mathematics Journal, Vol 7, No 1, paper 9, 2006.</ref><ref>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.</ref> 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 numeral system|binary]] and [[Quaternary numeral system|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.
| |
| | |
| A form of [[Redundant binary representation]] called [[Balanced ternary]] or [[Signed-digit representation]] is sometimes used in low-level software and hardware to accomplish fast addition of integers because it can eliminate carries.<ref>Dhananjay Phatak, I. Koren, '''Hybrid Signed-Digit Number Systems: A Unified Framework for Redundant Number Representations with Bounded Carry Propagation Chains''', 1994, [http://citeseer.ist.psu.edu/phatak94hybrid.html]</ref>
| |
| | |
| ===Tryte===
| |
| | |
| Some [[ternary computer]]s such as the [[Setun]] defined a '''tryte''' to be 6 trits, analogous to the binary [[byte]].<ref>{{Cite web
| |
| | last = Brousentsov
| |
| | first = N. P.
| |
| | last2 = Maslov
| |
| | first2 = S. P.
| |
| | last3 = Ramil Alvarez
| |
| | first3 = J.
| |
| | last4 = Zhogolev
| |
| | first4 = E.A.
| |
| | title = Development of ternary computers at Moscow State University
| |
| | url = http://www.computer-museum.ru/english/setun.htm
| |
| | accessdate = 20 January 2010}}</ref>
| |
| | |
| ==See also==
| |
| * [[Ternary logic]]
| |
| * [[Tai Xuan Jing]]
| |
| * [[Setun]], a [[ternary computer]]
| |
| | |
| ==Notes==
| |
| <references/>
| |
| | |
| ==References==
| |
| {{More footnotes|date=September 2010}}
| |
| *{{Citation | first=Brian|last=Hayes|title=Third base|journal=American Scientist|url=http://www.americanscientist.org/issues/pub/third-base/2|year=2001|volume=89|issue=6|pages=490–494|doi=10.1511/2001.40.3268}}.
| |
| | |
| ==External links==
| |
| * [http://www.americanscientist.org/issues/pub/third-base/ Third Base]
| |
| * [http://www.washingtonart.net/whealton/ternary.html Ternary Arithmetic]
| |
| * [http://www.mortati.com/glusker/fowler/index.htm The ternary calculating machine of Thomas Fowler]
| |
| * [http://www.mathsisfun.com/numbers/convert-base.php?to=ternary Ternary Base Conversion] includes fractional part, from Maths Is Fun
| |
| * [http://www.americanscientist.org/issues/pub/third-base/3 Gideon Frieder's replacement ternary numeral system]
| |
| * [http://network.nature.com/groups/mathematics/forum/topics/11183 Visualization of numeral systems]
| |
| | |
| {{Data types}}
| |
| | |
| {{Use dmy dates|date=September 2010}}
| |
| | |
| {{DEFAULTSORT:Ternary Numeral System}}
| |
| [[Category:Computer arithmetic]]
| |
| [[Category:Positional numeral systems]]
| |