Ternary

Ternary is the base Template:Num numeral system. Ternary digits are known as trits (trinary digit), analogous to bit. This system is also known as trinary.

Although ternary most often refers to a system in which the three numerals, Template:Num, Template:Num and Template:Num, are all positive integers, the adjective also lends its name to the balanced ternary system, useful for comparison logic.


Contents

Base 3

Compared to analog

Compared to base 10 and 2

Standard ternary
Decimal 0 1 2 3 4 5 6 7 8 9 10
Binary 0 1 10 11 100 101 110 111 1000 1001 1010
Ternary 0 1 2 10 11 12 20 21 22 100 101

/* Compared to base e */

Base 9 and 27

See Septemvigesimal

Ternary computers

See also: ternary logic

Balanced ternary notation

A number system called balanced ternary uses digits with the values -1, 0, and 1. This combination is especially valuable for ordinal relationships between two values, where the three possible relationships are less-than, equals, and greater-than. Balanced ternary is counted as follows. (In this example, the symbol 1 denotes the digit -1, but alternatively for easier parsing - may be used denote -1 and + to denote +1.)

Balanced ternary
Decimal -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6
Balanced ternary 110 111 11 10 11 1 0 1 11 10 11 111 110

Unbalanced ternary can be converted to balanced ternary notation by adding 1111.. with carry, then subtracting 1111... without borrow. For example, 0213 + 1113 = 2023, 2023 - 1113 = 1113(bal) = 710.

Balanced ternary is easily represented as electronic signals, as potential can either be negative, neutral, or positive. Utilizing a third state encompasses more data per digit; linearly approximately log(3)/log(2)=~1.589 bits per trit.

Balanced ternary has other applications. For example, a classical "2-pan" balance, with one weight for each power of 3, can weigh relatively heavy objects accurately with a small number of weights, by moving weights between the two pans and the table. For example, with weights for each power of 3 through 81, a 60-gram object will be balanced perfectly with a 81 gram weight in the other pan, the 27 gram weight in its own pan, the 9 gram weight in the other pan, the 3 gram weight in its own pan, and the 1 gram weight set aside. This is an optimal solution in terms of the number of weights needed to weigh any object. 60 = 11110

Similarily, a currency system using balanced ternary would save visits to the bank - customers would be likely to have exact change, or be able to get a small number of coins in change, and sellers would just occasionally need to deposit a large coin or two. The system works by representing positive values as coins the customer gives the merchant, and negative values as coins the merchant gives the customer. For example, if a merchant sells an item for five zorkmids, the customer would give the merchant a nine-zorkmid coin, and the merchant would give the customer a three-zorkmid coin and a one-zorkmid coin.

Compact ternary representation

Ternary is inefficient for human usage, just as binary is. Therefore, nonary (base 9, each digit is two base-3 digits) or base 27 (each digit is 3 base-3 digits) is often used, similar to how octal and hexadecimal systems are used in place of binary. Ternary also has the equivalent of a byte, called a tryte.

External links

fr:Système trinaire

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools