# Ternary systems

## Ternary system – What is it and is there an advantage?

The ternary logic used in IOTA runs through the entire project. Starting with the ternary microcontroller JINN, the hash function Troika, or that the seed consists only of capital letters from A-Z and the number 9, to the fact that exactly 2,779,530,283,277,761 IOTA tokens exist.

Before we clarify why IOTA relies on a ternary logic, we first need to take a closer look at the two systems that are relevant to this article.

The binary system: A bit (binary digit) can assume exactly two states (2 x 1 = 2):

• 0
• 1

Eight bits make a byte (28 = 256) and can thus represent 256 combinations.

The ternary system: A trit (trinary digit) can assume exactly three states (3 x 1 = 3):

• -1
• 0
• 1

Three trits make a tryte (33 = 27) and can thus represent 27 combinations.

The opposite number of each balanced ternary number, is determined by swapping each -1 by 1 and vice versa. Negative numbers can thus be represented just as easily as positive numbers. Unlike the decimal system, no negative sign needs to be noted. This circumstance makes some calculations in the ternary system more efficient than in the binary system.

Since trytes are even more complex than bytes, it is important to make them more readable. This is done by converting them into some kind of other language. For this purpose, the IOTA Development Team has created the tryte alphabet. This consists of the number 9 and the capital letters A-Z. This makes a total of 27 different digits, exactly the number of combinations of a tryte. Thus, each combination of a tryte can be represented by a digit.

IOTA uses exactly this alphabet for the seed, addresses, hashes etc..

The seed itself consists of 81 digits, so 81 trytes. Example:

CIIXLALQIZSAYXTYLOGYHMY9MSCDGCRXQFOHTZRXFRSFBQJJFFXRMVOJQWZJAILCKFSYEFWNLFWIHISEF.

Each tryte has 27 combinations. Thus, IOTA’s seed has 27^81combinations = 8.7189642485960958 * 10^115. This is significantly more than there are atoms in the entire visible universe. The probability to guess a seed is practically 0.

For comparison: The possible key pairs in bitcoin are actually 2^256 (elliptic curve secp256k1). Each public key is encrypted again by the hash function RIPEMD160. This has the effect that the possible key pairs are compressed to 2^160. This brings the Bitcoin to 1.4615016373309029 * 10^115 = 1461501637330902918203684832716283019655932542976 possible key pairs.

### Why exactly are there 2,779,530,283,277,761 IOTA tokens?

This also has something to do with the trytes. Trytes “balance” themselves around the value 0 ranging from -13 to +13. Hence the term balanced trinary system. As an example we have 27 combinations and the maximum value 13. This can also be calculated mathematically:

((3^3) – 1) / 2 = 13, 27 combinations with three trits (1 tryte).

33 trits give the maximum supply: ((3^33) – 1) / 2 = 2.779.530.283.277.761 IOTA

PS: It was important to create a high number of tokens, because they will be used for micropayments between machines. In this case high prices per token are very hindering. If in the distant future, due to a very high demand, it is necessary to increase the maximum number of tokens, this is possible.

### Why exactly do 33 trits result in the max. supply?

The value field in a transaction is 81 trits long, of which 33 trits are currently used. Exactly 33 trits are used because it was determined (presumably by CfB) that the current max. supply is the maximum positive number that can be represented by 33 trits in the balanced ternary, which is exactly ((3^33) – 1) / 2 or 2,779,530,283,277,761.

Since 81 trits have been reserved for the value field, the max supply can be increased to ((3^81) – 1) / 2 if necessary. In this case, each current owner would still own an equal share of the total value, but these amounts can now be divided into smaller units.

## Why do current computers use the binary system?

In the early days of computer technology, mechanical calculating machines were replaced by electrical calculating machines. These first computers worked with relays that could only assume the states “on” or “off”. Because relays with a high percentage of mechanical components are very susceptible to failure, they were replaced by transistors, which also only assume the states “on” or “off” (voltage on, voltage off). Since transistors do not have any mechanical components, they can be made very small in size.

Today’s computers consist of many interconnections and components that are used to transmit and store data and to communicate with other components. Most of the storage, transmission and communication today is done with digital electronics. These still use the binary system with the two clearly separated states on=1 and off=0.

Binary systems are still used because of their high speed in changing circuit states. Transistors are very fast and effective switches. In the interaction of the amount of transistors and the kind of their states different characters can be mapped quickly and arithmetic operations can be performed. The disadvantage is: To increase the speed of a chip based on electrical transistors, more transistors have to be built into the chip. To do this, either the chip must be made larger or the individual transistors must be made smaller. Currently, there is a tendency towards smaller transistors, but this has the disadvantage of higher heat generation and greater susceptibility to faults.

## Advantages of a ternary system

A system with three states, would have advantages in that one could rely on other basic elements instead of transistors to produce more efficient ICs (integrated circuits). Ternary is more efficient because it has the highest density of information representation among other integer bases (2,4…). Thus, in the ternary system, larger numbers can be accommodated in less memory. For example, the decimal number 6 in the binary system would be the number 110 (needs 3 bits), in the ternary system only 20 (one digit less). The efficiency of a numbering system to the base of 3 is more efficient than to 2 (about 1.58 times more efficient). Thus, one saves memory and calculations would run faster with a lower clock number of the chip.

The effort required for a ternary system to build a complex logic circuit within the CPU can be reduced to about 36% compared to an equivalent binary system. This leads to a corresponding energy saving in addition to a space-saving smaller design of the microcontroller. Ternary boards have not been used in the computer industry to date because the hardware implementation is much more complex, and there is also a lack of widespread mass market support. However, once this hardware implementation is achieved, these microcontrollers are significantly more energy efficient and much more powerful than their binary counterparts.

With the advent of mass-produced binary components for computers, ternary calculators (which existed at the time) unfortunately became a minor footnote in computer history, even though the balanced ternary system is a more efficient number representation in mathematics than the binary. In the seventies, the development of ternary computers was largely stopped because binary systems could be developed faster and cheaper. As often in the past, it was not the technically superior concept that prevailed in the course of time, but the concept that was easiest and cheapest to implement for the mass market at that time. The question arises as to where ternary computer technology would be today if it had also been continuously developed.

Considering the elegance and efficiency of ternary logic, expert Donald E. Knuth, predicts a resurgence of ternary computers in the future. Possible ways in which ternary computers could evolve in the future include combining an optical computer with the ternary system. A ternary computer using optical fibers could use dark as 0 and two orthogonal polarizations of light as 1 and -1.

If you want to go deeper into the topic, you can do so here: The Ternary Manifesto

Original source

https://iota-einsteiger-guide.de/ternaeres-system.html

Last Updated on 16. February 2021
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}