[{"@context":"http:\/\/schema.org\/","@type":"BlogPosting","@id":"https:\/\/wiki.edu.vn\/en\/wiki24\/2017\/01\/23\/ternary-numeral-system-wikipedia\/#BlogPosting","mainEntityOfPage":"https:\/\/wiki.edu.vn\/en\/wiki24\/2017\/01\/23\/ternary-numeral-system-wikipedia\/","headline":"Ternary numeral system – Wikipedia","name":"Ternary numeral system – Wikipedia","description":"Base-3 numeral system A ternary numeral system (also called base 3 or trinary) has three as its base. Analogous to","datePublished":"2017-01-23","dateModified":"2017-01-23","author":{"@type":"Person","@id":"https:\/\/wiki.edu.vn\/en\/wiki24\/author\/lordneo\/#Person","name":"lordneo","url":"https:\/\/wiki.edu.vn\/en\/wiki24\/author\/lordneo\/","image":{"@type":"ImageObject","@id":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@type":"Organization","name":"Enzyklop\u00e4die","logo":{"@type":"ImageObject","@id":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","url":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","width":600,"height":60}},"image":{"@type":"ImageObject","@id":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/7\/78\/Fewest_weights_balance_puzzle.svg\/220px-Fewest_weights_balance_puzzle.svg.png","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/7\/78\/Fewest_weights_balance_puzzle.svg\/220px-Fewest_weights_balance_puzzle.svg.png","height":"330","width":"220"},"url":"https:\/\/wiki.edu.vn\/en\/wiki24\/2017\/01\/23\/ternary-numeral-system-wikipedia\/","wordCount":5520,"articleBody":"Base-3 numeral systemA ternary numeral system (also called base 3 or trinary) has three as its base. Analogous to a bit, a ternary digit is a trit (trinary digit). One trit is equivalent to log2\u00a03 (about 1.58496) bits of information.Although ternary most often refers to a system in which the three digits are all non\u2013negative numbers; specifically 0, 1, and 2, the adjective also lends its name to the balanced ternary system; comprising the digits \u22121, 0 and +1, used in comparison logic and ternary computers.Table of ContentsComparison to other bases[edit]Sum of the digits in ternary as opposed to binary[edit]Compact ternary representation: base 9 and 27[edit]Practical usage[edit]Binary-coded ternary[edit]Tryte[edit]See also[edit]References[edit]Further reading[edit]External links[edit]Comparison to other bases[edit]A ternary multiplication table\u00d712101112202122100112101112202122100221120221011101121212001010201001101202002102201000111122110121202220100110121100121210112020222110101022111112002020110200220101011001120121020002121112210100110221120121120022100222212122010121111121020022101220010010020010001100120020002100220010000Representations of integer numbers in ternary do not get uncomfortably lengthy as quickly as in binary. For example, decimal 365 or senary 1405 corresponds to binary 101101101 (nine digits) and to ternary 111112 (six digits). However, they are still far less compact than the corresponding representations in bases such as decimal\u00a0\u2013 see below for a compact way to codify ternary using nonary (base 9) and septemvigesimal (base 27).Numbers from 1 to 33 in standard ternaryTernary12101112202122100Binary1101110010111011110001001Senary1234510111213Decimal123456789Ternary101102110111112120121122200Binary101010111100110111101111100001000110010Senary141520212223242530Decimal101112131415161718Ternary2012022102112122202212221000Binary100111010010101101101011111000110011101011011Senary313233343540414243Decimal192021222324252627Powers of 3 in ternaryTernary110100100010000Binary1111001110111010001Senary131343213Decimal1392781Power3031323334Ternary1000001000000100000001000000001000000000Binary1111001110110110011000100010111100110100001100110011100011Senary104332131404350213231043Decimal2437292187656119683Power3536373839As for rational numbers, ternary offers a convenient way to represent 1\/3 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 1\/2 (nor for 1\/4, 1\/8, etc.), because 2 is not a prime factor of the base; as with base two, one-tenth (decimal1\/10, senary 1\/14) is not representable exactly (that would need e.g. decimal); nor is one-sixth (senary 1\/10, decimal 1\/6).Fractions in ternaryFraction1\/21\/31\/41\/51\/61\/71\/81\/91\/101\/111\/121\/13Ternary0.10.10.020.01210.010.0102120.010.010.00220.002110.0020.002Binary0.10.010.010.00110.0010.0010.0010.0001110.000110.00010111010.00010.000100111011Senary0.30.20.130.10.10.050.0430.040.030.03134524210.030.024340531215Decimal0.50.30.250.20.160.1428570.1250.10.10.090.0830.076923Sum of the digits in ternary as opposed to binary[edit]The value of a binary number with n bits that are all 1 is 2n\u00a0\u2212\u00a01.Similarly, for a number N(b, d) with base b and d digits, all of which are the maximal digit value b\u00a0\u2212\u00a01, we can write:N(b, d) = (b\u00a0\u2212\u00a01)bd\u22121 + (b\u00a0\u2212\u00a01)bd\u22122 + \u2026 + (b\u00a0\u2212\u00a01)b1 + (b\u00a0\u2212\u00a01)b0,N(b, d) = (b\u00a0\u2212\u00a01)(bd\u22121 + bd\u22122 + \u2026 + b1 + 1),N(b, d) = (b\u00a0\u2212\u00a01)M.bM = bd + bd\u22121 + \u2026 + b2 + b1 and\u2212M = \u2212bd\u22121\u00a0\u2212\u00a0bd\u22122\u00a0\u2212\u00a0\u2026\u00a0\u2212\u00a0b1\u00a0\u2212\u00a01, sobM\u00a0\u2212\u00a0M = bd\u00a0\u2212\u00a01, orM = bd\u00a0\u2212\u00a01\/b\u00a0\u2212\u00a01.ThenN(b, d) = (b\u00a0\u2212\u00a01)M,N(b, d) = (b\u00a0\u2212\u00a01)(bd\u00a0\u2212\u00a01)\/b\u00a0\u2212\u00a01,N(b, d) = bd\u00a0\u2212\u00a01.For a three-digit ternary number, N(3, 3) = 33\u00a0\u2212\u00a01 = 26 = 2 \u00d7 32 + 2 \u00d7 31 + 2 \u00d7 30 = 18 + 6 + 2.Compact ternary representation: base 9 and 27[edit]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.Practical usage[edit] Use of ternary numbers to balance an unknown integer weight from 1 to 40\u00a0kg with weights of 1, 3, 9 and 27\u00a0kg (4 ternary digits actually gives 34 = 81 possible combinations: \u221240 to +40, but only the positive values are useful)In certain analog logic, the state of the circuit is often expressed ternary. This is most commonly seen in CMOS circuits, and also in transistor\u2013transistor logic with totem-pole output. The output is said to either be low (grounded), high, or open (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” in common use is for defensive statistics in American baseball (usually just for pitchers), 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 3+2\u20443 (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.[1][2]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.[3][4] 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.[5]Binary-coded ternary[edit]Simulation of ternary computers using binary computers, or interfacing between ternary and binary computers, can involve use of binary-coded ternary (BCT) numbers, with two or three bits used to encode each trit.[6][7] BCT encoding is analogous to binary-coded decimal (BCD) encoding. If the trit values 0, 1 and 2 are encoded 00, 01 and 10, conversion in either direction between binary-coded ternary and binary can be done in logarithmic time.[8] A library of C code supporting BCT arithmetic is available.[9]Tryte[edit]Some ternary computers such as the Setun defined a tryte to be six trits[10] or approximately 9.5 bits (holding more information than the de facto binary byte).[11]See also[edit]References[edit]^ Ashley MacLennan (2019-01-09). “A complete beginner’s guide to baseball stats: Pitching statistics, and what they mean”. Bless You Boys. Retrieved 2020-07-30.^ “Stats – Team – Pitching”. MLB (Major League Baseball). Retrieved 2020-07-30.^ Soltanifar, Mohsen (2006). “On A sequence of cantor Fractals”. Rose Hulman Undergraduate Mathematics Journal. 7 (1). Paper 9.^ Soltanifar, Mohsen (2006). “A Different Description of A Family of Middle\u2013\u03b1 Cantor Sets”. American Journal of Undergraduate Research. 5 (2): 9\u201312.^ Phatak, D. S.; Koren, I. (1994). “Hybrid signed\u2013digit number systems: a unified framework for redundant number representations with bounded carry propagation chains” (PDF). IEEE Transactions on Computers. 43 (8): 880\u2013891. CiteSeerX\u00a010.1.1.352.6407. doi:10.1109\/12.295850.^ Frieder, Gideon; Luk, Clement (February 1975). “Algorithms for Binary Coded Balanced and Ordinary Ternary Operations”. IEEE Transactions on Computers. C-24 (2): 212\u2013215. doi:10.1109\/T-C.1975.224188. S2CID\u00a038704739.^ Parhami, Behrooz; McKeown, Michael (2013-11-03). “Arithmetic with Binary-Encoded Balanced Ternary Numbers”. Proceedings 2013 Asilomar Conference on Signals, Systems and Computers. Pacific Grove, CA, USA: 1130\u20131133. doi:10.1109\/ACSSC.2013.6810470. ISBN\u00a0978-1-4799-2390-8. S2CID\u00a09603084.^ Jones, Douglas W. (June 2016). “Binary Coded Ternary and its Inverse”.^ Jones, Douglas W. (2015-12-29). “Ternary Data Types for C Programmers”.^ Impagliazzo, John; Proydakov, Eduard (2011-09-06). Perspectives on Soviet and Russian Computing: First IFIP WG 9.7 Conference, SoRuCom 2006, Petrozavodsk, Russia, July 3\u20147, 2006, Revised Selected Papers. Springer. ISBN\u00a0978-3-64222816-2.^ Brousentsov, N. P.; Maslov, S. P.; Ramil Alvarez, J.; Zhogolev, E. A. “Development of ternary computers at Moscow State University”. Retrieved 2010-01-20.Further reading[edit]External links[edit]"},{"@context":"http:\/\/schema.org\/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki24\/#breadcrumbitem","name":"Enzyklop\u00e4die"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki24\/2017\/01\/23\/ternary-numeral-system-wikipedia\/#breadcrumbitem","name":"Ternary numeral system – Wikipedia"}}]}]