De la Wikipedia, enciclopedia liberă.
( EN ) „Poate că cel mai frumos sistem numeric dintre toate este notația ternară echilibrată” | ( IT ) „Poate că cel mai frumos sistem numeric dintre toate este notația ternară echilibrată” |
( Donald E. Knuth ) |
Ternarul echilibrat este un sistem de numere poziționale non-standard. Este un sistem de bază 3, care, spre deosebire de sistemul ternar standard, folosește -1, 0 și 1 ca cifre în loc de 0, 1 și 2. Puterile lui 3 utilizate pentru a reprezenta numărul pot avea deci un pozitiv, nul sau negativ coeficient.
Următorul tabel listează primele 12 numere scrise în sistemul zecimal echilibrat, ternar și ternar (simbolul 1 este utilizat pentru a reprezenta cifra -1).
Zecimal | Ternar | Ternar echilibrat |
---|
{\ displaystyle 1} | {\ displaystyle 1} | {\ displaystyle 1} |
{\ displaystyle 2} | {\ displaystyle 2} | {\ displaystyle 1 {\ bar {1}}} |
{\ displaystyle 3} | {\ displaystyle 10} | {\ displaystyle 10} |
{\ displaystyle 4} | {\ displaystyle 11} | {\ displaystyle 11} |
{\ displaystyle 5} | {\ displaystyle 12} | {\ displaystyle 1 {\ bar {1}} {\ bar {1}}} |
{\ displaystyle 6} | {\ displaystyle 20} | {\ displaystyle 1 {\ bar {1}} 0} |
{\ displaystyle 7} | {\ displaystyle 21} | {\ displaystyle 1 {\ bar {1}} 1} |
{\ displaystyle 8} | {\ displaystyle 22} | {\ displaystyle 10 {\ bar {1}}} |
{\ displaystyle 9} | {\ displaystyle 100} | {\ displaystyle 100} |
{\ displaystyle 10} | {\ displaystyle 101} | {\ displaystyle 101} |
{\ displaystyle 11} | {\ displaystyle 102} | {\ displaystyle 11 {\ bar {1}}} |
{\ displaystyle 12} | {\ displaystyle 110} | {\ displaystyle 110} |
{\ displaystyle 13} | {\ displaystyle 111} | {\ displaystyle 111} |
{\ displaystyle 14} | {\ displaystyle 112} | {\ displaystyle 1 {\ bar {1}} {\ bar {1}} {\ bar {1}}} |
Aritmetic
Plus
Tabelul de adăugare este foarte simplu, ținând cont de faptul că puteți avea un report negativ
- {\ displaystyle {\ begin {array} {cc} 1 & + \\ 0 & = \\\ hline 1 & \\\ end {array}} \ {\ begin {array} {cc} 1 & + \\ 1 & = \\\ hline 1 {\ bar {1}} & \\\ end {array}} \ {\ begin {array} {cc} 1 & + \\ {\ bar {1}} & = \\\ hline 0 & \\\ end {array}} \ {\ begin {array} {cc} {\ bar {1}} & + \\ {\ bar {1}} & = \\\ hline {\ bar {1 }} 1 & \\\ end {array}}}
Scădere
Scăderea se face inversând cifrele numărului de scăzut și adăugând.
Multiplicare
Înmulțirea se face, de asemenea, destul de simplu, reducându-se la o serie de modificări și adăugiri de semne, ca în exemplul următor, în care se efectuează operația 23 × 17 = 391:
- {\ displaystyle {\ begin {align} & 10 {\ bar {1}} {\ bar {1}} \ \ times \\ & 1 {\ bar {1}} 0 {\ bar {1}} \ = \ \\ hline & {\ bar {1}} 011 \\ 0 & 000 \\ {\ bar {1}} 0 & 11 \\ 10 {\ bar {1}} & {\ bar {1}} \\\ hline 1 {\ bar {1}} {\ bar {1}} și {\ bar {1}} 111 \ end {align}}}
Numere negative
Sistemul ternar echilibrat nu are nevoie de un semn minus pentru a reprezenta numere negative. Pentru a schimba semnul unui număr, trebuie doar să schimbați semnul cifrelor sale.
- {\ displaystyle 1 {\ bar {1}} 1 {\ bar {1}} = 20}
- {\ displaystyle {\ bar {1}} 1 {\ bar {1}} 1 = -20}
Posibilitatea reprezentării numerelor negative are, de asemenea, un cost pentru cifrele care trebuie utilizate în comparație cu sistemul ternar standard, de fapt, pentru a reprezenta un număr generic n în sistemul ternar echilibrat este necesar {\ displaystyle int [log_ {3} ({2 \ left \ vert n \ right \ vert})]} cifre, mai mari sau cel mult egale cu {\ displaystyle int [log_ {3} ({\ left \ vert n \ right \ vert})] + 1} cifre în sistemul ternar standard.
Alte proiecte