SUPPORT THE WORK

GetWiki

Ternary numeral system

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
Ternary numeral system
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{Short description|Base-3 numeral system}}{{Use dmy dates|date=May 2019|cs1-dates=y}}{{Table Numeral Systems}}A ternary {{IPAc-en|ˈ|t|Éœr|n|É™r|i}} 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 3 (about 1.58496) bits of information.Although ternary most often refers to a system in which the three digits are all non–negative numbers; specifically {{num|0}}, {{num|1}}, and {{num|2}}, the adjective also lends its name to the balanced ternary system; comprising the digits −1, 0 and +1, used in comparison logic and ternary computers.

Comparison to other bases

Representations of integer numbers in ternary do not get uncomfortably lengthy as quickly as in binary. For example, decimal 365{{sub|(10)}} or senary {{gaps|1|405}}{{sub|(6)}} corresponds to binary {{gaps|1|0110|1101}}{{sub|(2)}} (nine bits) and to ternary {{gaps|111|112}}{{sub|(3)}} (six 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 (base 9) and septemvigesimal (base 27).{| class="wikitable" style="float:right; text-align:center"|+ A ternary multiplication table! × || 1|| 2 || 10 || 11 || 12 || 20 || 21 || 22 || 100
! 1
| 100
! 2
| 200
! 10
1|000}}
! 11
111|100}}
! 12
1|010}}111|200}}
! 20
11|100}}112|000}}
! 21
111|120}}122|100}}
! 22
111|210}}222|200}}
! 100
1112|000}}2210|000}}
{| class="wikitable"|+ Numbers from 0 to 33 − 1 in standard ternary align="center"! Ternary
| 22
align="center"! Binary
1|000}}
align="center"! Senary
| 12
align="center"! Decimal! 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8
align="center"! Ternary
| 122
align="center"! Binary
| 111111|0001}}
align="center"! Senary
| 25
align="center"! Decimal! 9 ||10 || 11 || 12|| 13 || 14 || 15 || 16 || 17
align="center"! Ternary
| 222
align="center"! Binary
11111|0110}}1111|1010}}
align="center"! Senary
| 42
align="center"! Decimal! 18 || 19 || 20 || 21 || 22 || 23 || 24 || 25 || 26
{| class="wikitable"|+ Powers of 3 in ternary align="center"! Ternary
110|000}}
align="center"! Binary
1101|0001}}
align="center"! Senary
| 213
align="center"! Decimal
| 81
align="center"! Power! {{big|3}}{{sup|0}} || {{big|3}}{{sup|1}} || {{big|3}}{{sup|2}}! {{big|3}}{{sup|3}} || {{big|3}}{{sup|4}}
align="center"! Ternary
1001000}} {{gaps000|000}}100000}} {{gaps000000}}
align="center"! Binary
1111101001}} {{gaps1000|1011}}110101001110|0011}}
align="center"! Senary
131450231|043}}
align="center"! Decimal
2619|683}}
align="center"! Power! {{big|3}}{{sup|5}} || {{big|3}}{{sup|6}} || {{big|3}}{{sup|7}}! {{big|3}}{{sup|8}} || {{big|3}}{{sup|9}}
As for rational numbers, ternary offers a convenient way to represent {{sfrac|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 {{sfrac|1|2}} (nor for {{sfrac|1|4}}, {{sfrac|1|8}}, etc.), because 2 is not a prime factor of the base; as with base two, one-tenth (decimal{{sfrac|1|10}}, senary {{sfrac|1|14}}) is not representable exactly (that would need e.g. decimal); nor is one-sixth (senary {{sfrac|1|10}}, decimal {{sfrac|1|6}}).
{| class="wikitable"|+ Fractions in ternary align="center"! Fraction
1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1 >{{sfrac>1|13}}'''
align="center"! Ternary
1}} 0.1 0.{{overline0121}} 0.0{{overline010212}} 0.{{overline0022}} 0.{{overline02}} 0.{{overline|002}}
align="center"! Binary
01}} 0.01 0.{{overline01}} 0.{{overline000111}} 0.0{{overline0001011101}} 0.00{{overline000100111011}}
align="center"! Senary
1}} 0.1 0.{{overline3}} 0.{{overline024340531215}}
align="center"! Decimal! 0.5 || 0.{{overline|3}} || 0.25 || 0.2 || 0.1{{overline|6}} || 0.{{overline|142857}} || 0.125! 0.{{overline|1}} || 0.1 || 0.{{overline|09}} || 0.08{{overline|3}} || 0.{{overline|076923}}

Sum of the digits in ternary as opposed to binary

The value of a binary number with n bits that are all 1 is {{math|2n âˆ’ 1}}.Similarly, for a number N(b, d) with base b and d digits, all of which are the maximal digit value {{math|b âˆ’ 1}}, we can write:
{{math|1=N(b, d) = (b âˆ’ 1)b'd−1 + (b âˆ’ 1)b'd−2 + … + (b âˆ’ 1)b1 + (b âˆ’ 1)b0,}} {{math|1={{white|N(b, d)}} = (b âˆ’ 1)(b'd−1 + b'd−2 + … + b1 + 1),}} {{math|1={{white|N(b, d)}} = (b âˆ’ 1)M}}. {{math|1=bM = b'd + b'd−1 + … + b2 + b1}} and {{math|1=−M = −b'd−1 âˆ’ b'd−2 âˆ’ ... âˆ’ b1 âˆ’ 1}}, so {{math|1=bM âˆ’ M = bd âˆ’ 1}}, or {{math|1=M = {{sfrac|bd âˆ’ 1|b âˆ’ 1}}.}}
Then
{{math|1=N(b, d) = (b âˆ’ 1)M,}} {{math|1={{white|N(b, d)}} = {{sfrac|(b âˆ’ 1)(bd âˆ’ 1)|b âˆ’ 1}},}} {{math|1={{white|N(b, d)}} = bd âˆ’ 1.}}
For a three-digit ternary number, {{math|1=N(3, 3) = 33 âˆ’ 1 = 26 = 2 × 32 + 2 × 31 + 2 × 30 = 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) can be used for compact representation of ternary, similar to how octal and hexadecimal systems are used in place of binary.

Practical usage

(File:fewest_weights_balance_puzzle.svg|thumb|Use of ternary numbers to balance an unknown integer weight from 1 to 40 kg with weights of 1, 3, 9 and 27 kg (4 ternary digits actually gives 34 = 81 possible combinations: −40 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–transistor 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 {{frac|3|2|3}} (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.WEB,weblink A complete beginner's guide to baseball stats: Pitching statistics, and what they mean, Ashley MacLennan, Jan 9, 2019, Bless You Boys, July 30, 2020, WEB,weblink Stats - Team - Pitching, MLB (Major League Baseball), July 30, 2020, 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 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.

Binary-coded ternary

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. 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. A library of C code supporting BCT arithmetic is available.

Tryte

Some ternary computers such as the Setun defined a tryte to be six trits or approximately 9.5 bits (holding more information than the de facto binary byte).

See also

References

Further reading

  • JOURNAL, Brian, Hayes, Brian Hayes (scientist), Third base, American Scientist, Sigma Xi, the Scientific Research Society, November–December 2001, 89, 6, 490–494, 10.1511/2001.40.3268,weblink 2020-04-12, live,weblink" title="web.archive.org/web/20191030114823weblink">weblink 2019-10-30,

External links

{{Data types}}

- content above as imported from Wikipedia
- "Ternary numeral system" does not exist on GetWiki (yet)
- time: 9:23am EDT - Sat, May 18 2024
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 23 MAY 2022
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
CONNECT