Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Ternary numeral system
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Comparison to other bases == Representations of [[integer number]]s in ternary do not get uncomfortably lengthy as quickly as in [[binary numeral system|binary]]. For example, [[decimal]] [[365 (number)|365]]{{sub|(10)}} or [[senary]] {{gaps|1|405}}{{sub|(6)}} corresponds to binary {{gaps|1|0110|1101}}{{sub|(2)}} (nine [[bit]]s) 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''' | 1 || 2 || 10 || 11 || 12 || 20 || 21 || 22 || 100 |- ! '''2''' | 2 || 11 || 20 || 22 || 101 || 110 || 112 || 121 || 200 |- ! '''10''' | 10 || 20 || 100 || 110 || 120 || 200 || 210 || 220 || 1,000 |- ! '''11''' | 11 || 22 || 110 || 121 || 202 || 220 || 1,001 || 1,012 || 1,100 |- ! '''12''' | 12 || 101 || 120 || 202 || 221 || 1,010 | 1,022 || 1,111 || 1,200 |- ! '''20''' | 20 || 110 || 200 || 220 || 1,010 || 1,100 | 1,120 || 1,210 || 2,000 |- ! '''21''' | 21 || 112 || 210 || 1,001 || 1,022 || 1,120 | 1,211 || 2,002 || 2,100 |- ! '''22''' | 22 || 121 || 220 || 1,012 || 1,111 || 1,210 | 2,002 || 2,101 || 2,200 |- ! '''100''' | 100 || 200 || 1,000 || 1,100 || 1,200 || 2,000 | 2,100 || 2,200 || 10,000 |} :{| class="wikitable" |+ '''Numbers from 0 to 3<sup>3</sup> β 1 in standard ternary''' |- align="center" ! Ternary | 0 || 1 || 2 || 10 || 11 || 12 || 20 || 21 || 22 |- align="center" ! Binary | 0 || 1 || 10 || 11 || 100 || 101 || 110 || 111 || {{gaps|1|000}} |- align="center" ! Senary | 0 || 1 || 2 || 3 || 4 || 5 || 10 || 11 || 12 |- align="center" ! Decimal ! 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 |- |colspan=10 style="background-color:white;"| |- align="center" ! Ternary | 100 || 101 || 102 || 110 || 111 || 112 || 120 || 121 || 122 |- align="center" ! Binary | 1001 || 1010 || 1011 || 1100 || 1101 || 1110 || 1111 | {{gaps|1|0000}} || {{gaps|1|0001}} |- align="center" ! Senary | 13 || 14 || 15 || 20 || 21 || 22 || 23 || 24 || 25 |- align="center" ! Decimal ! 9 ||10 || 11 || 12|| 13 || 14 || 15 || 16 || 17 |- |colspan=10 style="background-color:white;"| |- align="center" ! Ternary | 200 || 201 || 202 || 210 || 211 || 212 || 220 || 221 || 222 |- align="center" ! Binary | {{gaps|1|0010}} || {{gaps|1|0011}} || {{gaps|1|0100}} || {{gaps|1|0101}} || {{gaps|1|0110}} | {{gaps|1|0111}} || {{gaps|1|1000}} || {{gaps|1|1001}} || {{gaps|1|1010}} |- align="center" ! Senary | 30 || 31 || 32 || 33 || 34 || 35 || 40 || 41 || 42 |- align="center" ! Decimal ! 18 || 19 || 20 || 21 || 22 || 23 || 24 || 25 || 26 |} : :{| class="wikitable" |+ '''Powers of 3 in ternary''' |- align="center" ! Ternary | 1 || 10 || 100 || {{gaps|1|000}} || {{gaps|10|000}} |- align="center" ! Binary | 1 || 11 || 1001 || {{gaps|1|1011}} || {{gaps|101|0001}} |- align="center" ! Senary | 1 || 3 || 13 || 43 || 213 |- align="center" ! Decimal | 1 || 3 || 9 || 27 || 81 |- align="center" ! Power ! {{big|3}}{{sup|0}} || {{big|3}}{{sup|1}} || {{big|3}}{{sup|2}} ! {{big|3}}{{sup|3}} || {{big|3}}{{sup|4}} |- |colspan=10 style="background-color:white;"| |- align="center" ! Ternary | {{gaps|100|000}} || {{gaps|1|000|000}} || {{gaps|10|000|000}} | {{gaps|100|000|000}} || {{gaps|1|000|000|000}} |- align="center" ! Binary | {{gaps|1111|0011}} || {{gaps|10|1101|1001}} || {{gaps|1000|1000|1011}} | {{gaps|1|1001|1010|0001}} || {{gaps|100|1100|1110|0011}} |- align="center" ! Senary | {{gaps|1|043}} || {{gaps|3|213}} || {{gaps|14|043}} || {{gaps|50|213}} || {{gaps|231|043}} |- align="center" ! Decimal | 243 || 729 || {{gaps|2|187}} || {{gaps|6|561}} || {{gaps|19|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 number]]s, 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 decimal|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 (number)|2]] is not a [[Prime number|prime]] [[factorization|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 | '''{{sfrac|1|2}}''' || '''{{sfrac|1|3}}''' || '''{{sfrac|1|4}}''' || '''{{sfrac|1|5}}''' || '''{{sfrac|1|6}}''' || '''{{sfrac|1|7}}''' || '''{{sfrac|1|8}}''' || '''{{sfrac|1|9}}''' || '''{{sfrac|1|10}}''' || '''{{sfrac|1|11}}''' || '''{{sfrac|1|12}}''' || '''{{sfrac|1|13}}''' |- align="center" ! Ternary | 0.{{overline|1}} || 0.1 || 0.{{overline|02}} || 0.{{overline|0121}} || 0.0{{overline|1}} || 0.{{overline|010212}} || 0.{{overline|01}} || 0.01 || 0.{{overline|0022}} || 0.{{overline|00211}} || 0.0{{overline|02}} || 0.{{overline|002}} |- align="center" ! Binary | 0.1 || 0.{{overline|01}} || 0.01 || 0.{{overline|0011}} || 0.0{{overline|01}} || 0.{{overline|001}} || 0.001 || 0.{{overline|000111}} || 0.0{{overline|0011}} || 0.{{overline|0001011101}} || 0.00{{overline|01}} || 0.{{overline|000100111011}} |- align="center" ! Senary | 0.3 || 0.2 || 0.13 || 0.{{overline|1}} || 0.1 || 0.{{overline|05}} || 0.043 || 0.04 || 0.0{{overline|3}} || 0.{{overline|0313452421}} || 0.03 || 0.{{overline|024340531215}} |- 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|2<sup>''n''</sup> β 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''<sup>''d''β1</sup> + (''b'' β 1)''b''<sup>''d''β2</sup> + β¦ + (''b'' β 1)''b''<sup>1</sup> + (''b'' β 1)''b''<sup>0</sup>,}} : {{math|1={{white|''N''(''b'', ''d'')}} = (''b'' β 1)(''b''<sup>''d''β1</sup> + ''b''<sup>''d''β2</sup> + β¦ + ''b''<sup>1</sup> + 1),}} : {{math|1={{white|''N''(''b'', ''d'')}} = (''b'' β 1)''M''}}. : {{math|1=''bM'' = ''b''<sup>''d''</sup> + ''b''<sup>''d''β1</sup> + β¦ + ''b''<sup>2</sup> + ''b''<sup>1</sup>}} and : {{math|1=β''M'' = β''b''<sup>''d''β1</sup> β ''b''<sup>''d''β2</sup> β ... β b<sup>1</sup> β 1}}, so : {{math|1=''bM'' β ''M'' = ''b''<sup>''d''</sup> β 1}}, or : {{math|1=''M'' = {{sfrac|''b''<sup>''d''</sup> β 1|''b'' β 1}}.}} Then : {{math|1=''N''(''b'', ''d'') = (''b'' β 1)''M'',}} : {{math|1={{white|''N''(''b'', ''d'')}} = {{sfrac|(''b'' β 1)(''b''<sup>''d''</sup> β 1)|''b'' β 1}},}} : {{math|1={{white|''N''(''b'', ''d'')}} = ''b''<sup>''d''</sup> β 1.}} For a three-digit ternary number, {{math|1=''N''(3, 3) = 3<sup>3</sup> β 1 = 26 = 2 Γ 3<sup>2</sup> + 2 Γ 3<sup>1</sup> + 2 Γ 3<sup>0</sup> = 18 + 6 + 2}}. === Compact ternary representation: base 9 and 27 === {| class="wikitable" style="float:right; text-align:center" |+ Comparison between ternary and nonary |- ! ternary || nonary |- | 00 || 0 |- | 01 || 1 |- | 02 || 2 |- | 10 || 3 |- | 11 || 4 |- | 12 || 5 |- | 20 || 6 |- | 21 || 7 |- | 22 || 8 |} '''Nonary''' {{IPAc-en|Λ|n|Ι|n|Ιr|i}} (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 numeral system|binary]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)