Talk:Balanced ternary

Balanced systems for bases other than three
Are there balanced systems for any base other than three? I think there would be a requirement for the base to be odd, but other than that, why not balanced base 5? Balanced base 11 could be counted on the fingers, with one hand representing negative numbers and the other positive. Linguofreak 02:13, 19 March 2006 (UTC)


 * Yes, there are ballanced systems with digits other than three.  An for the really preverse, there are workable systems with negative and positive digits that aren't balanced for even bases.  (But this drifts off into original research, many people have played with them, nobody seems to have officially published.)  Nahaj 11:46, 17 April 2006 (UTC)


 * Even bases, how does that work? I shall have to play around with this too. Linguofreak 02:28, 18 April 2006 (UTC)


 * Actually, I've been doing some OR in this myself (developed balanced ternary on my own about 15 years ago, though I called it "nullcentric trinary" back then, for obvious reasons), and it seems that 0 can occupy any position at all within the choice of digits; e.g., you could have an octal system that starts at -2, and goes up to 5 (though why you'd want to is beyond me). I haven't even ruled out systems that don't include 0, e.g. octal from 3 to (decimal) 10, but only because I haven't considered them yet. --John Owens | (talk) 18:10, 16 February 2007 (UTC)


 * The nice thing about web pages is that you can reply to something four years after it was originally posted (grin). This gets into the area of original research, but I've been looking at balanced senary (base 6). You need symbols for (-3), (-2), (-1), (0), (+1), (+2), (+3). = base 7, surely.
 * Base 7 would use the same symbols, but look at signed-digit representation, specifically non-adjacent form (NAF).


 * Now, you just have to remember that one of the characteristics of balanced ternary is that truncation is the same as rounding. One way to do the same thing in balanced senary (and other even bases) is to have the following two rules. First, the symbol immediately to the right of (+/-)3 cannot share the same sign -- the number immediately following (-3) cannot be negative, nor can the symbol immediately to the right of (+3) be positive. Second, if there are only zeroes to the right of (-3) or (+3), the number immediately to the left cannot be odd.


 * For example, here are the balanced senary numbers from 1 through 36 (base 10). Since there are no symbols for (-3), (-2), and (-1), I will use E, S, and L (they are kind of flipped versions of the positive numbers, so...)


 * 1, 2, 3, 1S, 1L, 10, 11, 12, 2E, 2S, 2L, 20, 21, 22, 23, 3S, 3L, 30, 1E1, 1E2, 1SE, 1SS, 1SL, 1S0 1S1, 1S2, 1S3, 1LS, 1LL, 1L0, 1L1, 1L2, 10E, 10S, 10L, 100.


 * In this system, truncation is the same as rounding -- a particularly nice method of rounding, actually, called round-half-to-even. Fractions are also handled quite well (if there is a repeating fraction, the numbers after the radix point have two parts -- a set of numbers followed by the same numbers with the signs flipped, before they repeat). And the method is a balanced version of signed digit representation.  —Preceding unsigned comment added by 174.30.63.21 (talk) 04:34, 21 January 2011 (UTC)

+0- Dave Smith: DaveAt168@aol.com -0+
 * Shouldn't that be balanced septenary? It has 7 digits: E, S, L, 0, 1, 2, and 3. Double sharp (talk) 06:45, 9 June 2012 (UTC)
 * Ah, I see now: your radix is six, but you're using seven symbols, creating some duplicate representations (3 = 1E). That's all right, though. Double sharp (talk) 07:38, 22 June 2014 (UTC)
 * I entered this field many years ago, while toying with the concept of numerical complexity. That is the idea that the complexity of a number is the product of the number of digits required to encode a value, multiplied by the number of states that digit could take.  I was struck by the fact that both base2 and base4 had the same complexity, and wondered if there was a reason for this.  Eventually, I came up with a formula which proved that the nearer the base was to e, the less was the value of numerical complexity.
 * Having reached this conclusion, I struggled to devise a logic system based on what we now call Balanced Ternary.
 * After much struggle, almost coming to the conclusion that no logic was possible, other than negation, I decided to work backwards from arithmetic, and using the Binary half-adder as a model, devised the 'And' and 'Exclusive Or' functions.
 * Here are my results for And, Exclusive Or, and Negate

B + 0 -                B + 0 - A                      A                      A Y       +  + 0 0                +  - + 0               + - 0 0 0 0                0  + 0 -               0 0       -  0 0 -                -  0 - +               - +


 * I was unable to define any other unambiguous function, and still consider that this is the closed set.
 * I was concerned also that the operation according to de Morgan, which turned an And gate into an Or gate, actually reflected all three of these functions back on them selves, such that F(And) = And, F(Exclusive Or) = Exclusive Or, and F(Negate)= Negate.
 * This seems to confirm that the domain is closed.
 * I have serious doubts about refering to other so called ternary systems as ternary as they seem only to be binary logic being input by binary states, and undefined states, but the logic in the gate is still true binary.
 * Best regards,
 * Dave.
 * Dave, I think what you're interested in is Three-valued logic systems. You could use balanced trits (ternary digits) to represent three-valued logical values, but logic is fundamentally different from number systems like balanced ternary. --Quantum7 18:18, 6 June 2012 (UTC)

How about the balanced quinary? S(-2),T(-1),0,1,2.

Orienomesh-w (talk) 14:35, 2 November 2012 (UTC)


 * Are there balanced systems for any base other than three?
 * Yes -- see signed-digit representation. How could we improve this article to avoid misleading people into thinking that balanced ternary is the only one?
 * Even bases, how does that work?
 * In the base 6 system that Dave Smith proposes, and in the base-2 system known as non-adjacent form, moving a digit left one position multiplies its value by the base, as normal.
 * This really isn't the right page for that discussion -- you'll want to use the talk page for signed-digit representation.
 * you could have an octal system that starts at -2, and goes up to 5 (though why you'd want to is beyond me). Fascinating and a little surprising to me. I think there is some connection here to bijective numeration that discusses a popular base-26 system with digits A=+1 to Z=+26, which is apparently more popular than any standard base-26 positional numeral system, which would have digits with values from 0 to +25.
 * the concept of numerical complexity ... the complexity of a number is the product of the number of digits required to encode a value, multiplied by the number of states that digit could take.
 * Yes, that is the definition of radix economy.
 * --DavidCary (talk) 01:45, 9 July 2013 (UTC)

Fudge Dice?
I think someone should mention that one Fudge Die can produce one digit in balanced ternary. I'm not sure how to introduce this into either article.

Abhijit Bhattacharjee's work appears to be original research
Abhijit Bhattacharjee's work appears to be original research which has not yet been peer reviewed. It appears to be correct but I am not a mathematician so in line with policy I have added a template


 * Looking at the web page, I wouldn't exactly call it original. The system he describes for representing non-integer numbers is just the normal one: digits to the right of the decimal point get multiplied by successively smaller powers of the base (in this case, 1/3, 1/9, 1/27...).  The description is longwinded, but that's all it boils down to. Carl Muckenhoupt 18:15, 25 October 2006 (UTC)


 * No, there is a crucial difference when it comes to fractional numbers as it has been pointed out in that work. For fractional numbers, you have to approach it from two directions, for those below .5 and for those above .5. Hence there is an inventive step. Just carrying on with ternary numbers wouldnt work because even if you add up all the ternary fractions it would not add up to more that .5


 * Don't we accept self published non peer-reviewed stuff from well published and recognised authors to some degree anyway? See Reliable_sources. I'm not sure of coruse if this stuff was self-published Nil Einne 19:10, 26 October 2006 (UTC)


 * For fractional numbers, you have to approach it from two directions, just like balanced ternary, where you have to approach 26 from two directions: +00- = 1*3^3 + -1. There is no inventive step here. This is just carrying on with balanced ternary numbers. I am a high school junior, and this is completely obvious to me. --Zarel 21:03, 24 November 2006 (UTC)


 * Let me explain: Just like 9.0/10 is the same as 0.90 in decimal, 1 1 .0/10 is the same as 1. 1 0 in balanced ternary. All you're doing is moving the decimal place one to the left to divide by 10. I've edited the article accordingly. --Zarel 21:27, 24 November 2006 (UTC)


 * I am Abhijit Bhattacharjee and it wouldnt be possible for me to restore the page after each vandalisation. Just in case anyone cares, the page can be found here. http://www.abhijit.info/tristate/tristate.html where I have belaboured enough about its need and existence. —The preceding unsigned comment was added by 59.93.246.74 (talk • contribs).

Use as currency
Has the suggestion to use balanced tertiary for currency considered that it would be difficult to have people willingly keep things with negative value?-- unsigned edit by user:72.144.117.150 at 07:55, 28 October 2006


 * Read again... that's not what is suggested. But I guess it could be stated more clearly. The idea is really to use regular ternary coin sizes (1, 3, 9, 27), as that would minimize the number of coins to be exchanged, assuming both parties in the deal have a good supply of different coins.--Niels Ø 13:14, 28 October 2006 (UTC)


 * I have just reverted an addition along the same lines.--Niels Ø 16:48, 22 November 2006 (UTC)


 * I remember encountering coins with values of 3 and 15 in the Soviet Union, shortly before it ceased to exist. Does anyone have accurate info on these coins; is it covered anywhere in the wikipedia; is it (at least marginally) relevant here; is there a good way to include it?--Niels Ø 16:48, 22 November 2006 (UTC)


 * "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."


 * How is this any different than using base 10 money? This is just changing the values for no use. --213.130.254.217 (talk) 02:47, 6 June 2010 (UTC)


 * If you look at all integer prices between 1 and (say) 4236374 dollar/cent/zorkmid (that's just a random large number!), having coin valuse 1, 3, 9, 27, ... will in some sense minimize the number of coins required. But it is not an idea that makes any sense whatsoever in the world we are actually living in!--Nø (talk) 08:54, 6 June 2010 (UTC)

I thinks that nobody is glad to use the ternary note. Orienomesh-w (talk) 10:04, 13 November 2012 (UTC)


 * This section is not seriously advocating for a ternary currency system, which is impractical because it aligns poorly with our numeral system. It is just an interesting illustration of the properties of balanced ternary in a familiar setting. Dcoetzee 21:53, 14 November 2012 (UTC)
 * It is not a familiar setting. No one charges on this way. For example, charge 27₵&1₵ and pull back 9₵&3₵, for 16₵? puzzle!Orienomesh-w (talk) 13:43, 15 November 2012 (UTC)
 * The problem of making change is familiar. If this solution were as familiar, it wouldn't be interesting. —Tamfang (talk) 18:02, 17 November 2012 (UTC)
 * Ha-ha, I means that no one realized that he should pay 27¢ first for 14¢.  -Orienomesh-w (talk) 01:22, 18 November 2012 (UTC)
 * If the price were expressed in BT, and the coinage were ternary, it would be as obvious as paying $1.03 for 53¢. —Tamfang (talk) 10:00, 18 November 2012 (UTC)
 * Actually, there's no superiority than other coinage. And, it make the casher crazy, for hard counting(in a decimal world).-Orienomesh-w (talk) 10:21, 19 November 2012 (UTC)

rounding
From the Article (text in italics recently added):
 * Donald Knuth has pointed out that truncation and rounding are the same operation in balanced ternary&mdash;they produce exactly the same result. Moreover, there is no ambiguity in rounding (a property shared with other odd bases) since the number half is not representable.

Isn't it because there is no representation for 0.5 (mid point) that truncation is the same as rounding. -- Chris Q 15:22, 8 December 2006 (UTC)


 * No. Rounding and truncating is not the same for normal (unbalanced) ternary, even though it doesn't have a representation for 0.5 either. With unbalanced ternary the number 1.2 would get rounded to 2 but truncated to 1. -- Thowllly 01:27, 14 August 2007 (UTC)

for all balanced numeral system(such as balternary, balquinary, balseptenary, balnonary), the rounding and the truncation is the same operation. not for all odd base numeral system.

Orienomesh-w (talk) 15:10, 12 November 2012 (UTC)


 * Knuth repeats his point about truncation in a question about BT floating point notation ("rounding (except during division) is equivalent to truncation"), but it is striking that his "very pleasant system" does not provide for a representation of ½, or any value of the form 1/(2 × 3^n). 2A02:A445:EB91:1:90F2:5620:B1FE:B7F7 (talk) 10:52, 5 April 2019 (UTC)

Evenness test
The article states, "The quick test for even is the analog of the base ten divide-by-nine test: add up all the digits and repeat until you have a one-digit number; the number is even if the final sum is zero."

It can be stated much more simply than that. A number is even if it has an even number of nonzero digits. (In general, in any odd base, balanced or ordinary, a number is even if it has an even number of odd digits.)

I'm not sure whether this should be given as an alternative method or whether it should replace the existing one. The general "odd base evenness test" and the "one less than base" division test coincide, making them both reasonable ways to approach the problem. However, I don't feel that the evenness test deserves too much text devoted to it, so if nobody says anything then (provided I don't forget!) I will replace the complicated method with the simple one. MarkC77 02:09, 9 December 2006 (UTC)

LeRoy Eide's algorithm
Does anyone know what LeRoy Eide's algorithm (mentioned in main article) is? Ian S 14:19, 27 March 2007 (UTC)


 * On the web: http://www.dyalog.com/dfnsdws/n_JitSub.htm for example, Possibly the reference should be removed as original research.  While it seems to be well known in a number of circles, there doesn't seem to have ever been a formal paper.  For balanced ternary it is a slick way of doing divides by 2 and 10. 155.101.224.65 (talk) 17:17, 27 March 2008 (UTC)

It is certainly a slick way of dividing, but it relies on prior knowledge that the dividend is in fact divisible by the divisor (try following the algorithm when it is not). When the quotient is 2 this can be cheaply ascertained (see main article), and if the dividend is not even then a remainder of 1 can be added (or subtracted) to make it so. Can this be generalized to other (3n ± 1)? Ian S (talk) 18:01, 10 April 2008 (UTC)


 * Yes, there is a generalization (but not as easily stated.). But then you are really and truely off into original research with no published paper or even web page. 155.101.244.53 (talk) 18:30, 13 April 2008 (UTC)

In the light of this I have removed the reference to divisors other than 2. I think it would be a pity to remove any more as the correctness of the rest is obvious from the description of the evenness test (in the article) and of the algorithm (in the www.dyalog.dk page referred to above), but strictly there is no accepted source. Ian S (talk) 18:15, 17 April 2008 (UTC)


 * Note that the companies domain has changed now from www.dyalog.dk to www.dyalog.com. 155.101.224.65 (talk) 13:50, 2 September 2008 (UTC)


 * Note that LeRoy's article has moved to http://dfns.dyalog.com/n_JitSub.htm — Preceding unsigned comment added by 81.187.219.129 (talk) 14:34, 16 February 2012 (UTC)

Note that halving even BT numbers, as well as doubling even and odd numbers, can be executed without calculation, by using the shape of the number and trit-wise transformation .2A02:A444:10D6:1:392B:1631:7ED8:4812 (talk) 20:55, 9 August 2017 (UTC)

Notation
Using overline for repeating digits and underline for minus makes it rather nerdy to read the examples. I think the overline is a good choice, but could we change the examples to use "+" for +1 and "-" for -1, or is there in the literature precedence for using some other set of symbols like "1" for +1 and "m", say, for -1?--Niels Ø (noe) 07:25, 20 September 2007 (UTC)


 * I have added a suggested notation ("bop") which is visually symmetric. Unfortunately it's from a colleague who has not chosen to publish it elsewhere. I find it quite appealing, and I think that putting it in Wikipedia (rather than letting it vanish) is a reasonable approach. Snezzy (talk) 23:09, 19 January 2008 (UTC)


 * If it is unpublished from a single colleague it is OR, I am afraid. I think there is a wiki for this type of thing, but not Wikipedia. -- Q Chris (talk) 22:25, 20 January 2008 (UTC)


 * Noe, I have asked where this can be published, as I agree that it is a neat notation, and it would be a shame for it to vanish. It has been suggested that a Wikiversity article would be a good place if you want to publish it. -- Q Chris (talk) 08:18, 22 January 2008 (UTC)


 * I'm not pleased with the way this article introduces the underline notation. It introduces it as an afterthought, then proceeds to depend on it, and then offers a wild jump to the fact that rounding and truncation are the same by giving a (non-obvious) example.  I get it, but I don't expect most readers to.  70.250.238.188 (talk) 16:28, 21 March 2010 (UTC)


 * I think that a single notation should be used throughout the article. In particular, the -0+ notation used in the arithmetic tables is confusing after the 1 01 notation in the previous section, as shown by the question about s below. Here are the pros and cons of each proposed notation, as I see it:
 * -1,0,+1 Using the decimal equivalents of each value is useful in-text, but doesn't work for writing multi-digit numbers since it requires two characters per digit.
 *  1 01 Compact and unambiguous, but confusing when used in combination with overlines for repeating digits, as mentioned by Niels Ø.
 * -0+ Also compact, but confusing when combined with arithmetic operations (+0 + +- = +-- )
 * bop Cleaver suggestion, Snezzy, but possible OR and also not immediately recognized as numbers rather than words (pop, bob, op, boo).
 * Custom symbols We could create custom symbols, such unicode ⊖⊙⊕, or the red/white/green SVG images used in the first figure. These would probably count as OR as well (although does novel notation really count as research?), and could lead to problems on older computers with bad unicode support, accessibility problems, etc.
 * None of them is perfect, but I think that 1 01 has the fewest drawbacks. If anyone disagrees that's fine, but we should choose one and be consistent. Quantum7 19:56, 4 June 2012 (UTC)
 * Now all the tables are given redundantly using -0+ and 1 01. This is absurd. Lets reach a consensus on notation and stick with it! --Quantum7 18:34, 6 June 2012 (UTC)

User:140.206.255.132 edited the page to introduce yet another notation (T,0,1). Such a change must be discussed here and some consensus reached. I'm reverting the edit for now. If anyone likes that notation, I'm happy to accept it after discussion. --Quantum7 22:05, 26 October 2012 (UTC)


 * I thinks that the "T" is a nice symbol for "-1". And, if we use "I" for 1 and "O" for 0, we may sort the ternary sequences easily.
 * But, we can't do it with "+/0/-", " 1 /0/1".
 * I did some homework with "T/O/I", and they worked well.
 * Orienomesh-w (talk) 15:20, 29 October 2012 (UTC)
 * Merrill used T for -1. Merrill, Roy D. Ternary Logic in Digital Computers. January 1965.
 * Setun used i for -1. Setun' W. H. Ware, S. N. Alexander, N. M. Astrahan, H. H. Goode, M. Rubinoff, P. Armer, L. Bers,

H.d. Huskey, "Soviet computer technology - 1959," Communications of the ACM, pp. 149-150, 1960.
 * Knuth uses 1 with an overline. D.E. Knuth, The Art of Computer Programming - Volume 2: Seminumerical Algorithms, pp. 207-208.Addison-Wesley, 3rd ed., 1998. ISBN 0-201-89684-2.
 * Orienomesh-w (talk) 11:16, 30 October 2012 (UTC)
 * Thanks for the research, Orienomesh-w. Some references really help the discussion. Does Merrill use TOI too, or T01? Knuth is the most well known of those refs. Using latex for all the ternary could set it apart even more clearly than TOI: $$\overline{1}01$$
 * BTW, were you responsible for the recent switch in nomenclature? I wanted to contacted the author before reverting, but it was anonymous.
 * --Quantum7 04:57, 31 October 2012 (UTC)

I did some work about the ternary float point representation in Excel days ago. And found that TOI is very good for sorting, and. I mentioned it before. So I purpose to use it. But, it's just personal view.

a few days ago, I searched the infomation about ternary, and found a doucument about the ternary computer test bed(you may get the document in http://jeff.tk/wiki/Trinary). And "Merrill used ...","Setun used...","knuth used..." is the origin text. And the reference is copy from the reference of the original document. I did not comfirm the material.Orienomesh-w (talk) 10:16, 31 October 2012 (UTC)

$$\overline{1}01$$ is most clear, but conflict with Repeating Fraction. T is a nice ligature of $$\overline{1}$$     Orienomesh-w (talk) 14:20, 15 November 2012 (UTC)

¤ ″most clear″: yes, and it's the only proposal that observes the usual tabular lining for digits.2A02:A444:10D6:1:A0D0:7558:5C2E:44A3 (talk) 22:02, 28 September 2017 (UTC)

Kepler?
I vaguely recall seeing this system attributed to the astronomer Johannes Kepler. Can anyone confirm or deny anything? Michael Hardy (talk) 17:12, 6 August 2008 (UTC)

Ambiguity in "Basic operations" paragraph
The sentence "Multiply 2 by 10 in ternary and then divide the result by 2 to see the issue." is ambiguous. Does it instruct you to multiply by ten or by three? Proginoskes (talk) 16:07, 23 September 2008 (UTC)


 * It is obvious that decimal system is used implicitly and that this is ten. Otherwise how much is 2? —Preceding unsigned comment added by 212.36.7.130 on 14:14, 17 October 2008.


 * "2" is two in ternary and decimal alike. But if the quote is misread as "10 in ternary", that would be three. So I agree it's ambiguous.--Noe (talk) 09:49, 18 October 2008 (UTC)

Display of one third and two thirds
Hey, is it just me or does anyone else have these numbers (first sentence in the paragraph on Fractional balanced ternary) display as though they were one half and two halves? I have checked the actual characters by cut and paste and they are the correct ones but my browser doesn't display them correctly. I am using IE 6 SP1. Pedrocelli (talk) 05:01, 5 December 2008 (UTC)
 * I'm using IE7, and I have no problem.--Noe (talk) 09:08, 5 December 2008 (UTC)

Coins example
The example given for coins isn't clear enough in it's relation to balanced ternary. The relationship to ternary is clear, in that the coin denominations are powers of 3, but I fail to see how any of this system is distinct from a traditional non-balanced ternary. 70.250.238.188 (talk) 16:35, 21 March 2010 (UTC)
 * (delayed reply) My understanding is that both the buyer and seller have exactly one of each coin. The buyer gives the seller the coins corresponding to the positions containing a plus, and then the seller gives back the coins corresponding to the positions containing a minus. For example, if the item costs $7, the buyer would give a $9 and a $1 coin, and receive back a $3 coin. In a pure ternary system, the buyer would instead have to have two of each coin, and the seller would never give change. I'll add an example to the article about this. Dcoetzee 01:19, 23 April 2012 (UTC)
 * To be an exact equivalent of balanced ternary you would have to also stipulate that the seller could not give a coin of the same denomination in change that they had received. -- Q Chris (talk) 08:48, 23 April 2012 (UTC)
 * That is true, although I think it's kind of implied (you wouldn't normally hand someone a coin just to have it handed right back to you - you would just not give it). Dcoetzee 10:49, 23 April 2012 (UTC)

addition table
I think instead of:

it should be:

but maybe I'm misunderstanding what "+−" is supposed to mean? — Preceding unsigned comment added by 38.105.200.252 (talk) 22:02, 16 September 2011 (UTC)
 * "+−" means 2. — Preceding unsigned comment added by 80.65.103.177 (talk) 13:37, 23 September 2011 (UTC)
 * Doesn't +- "carry + to next most significant digit and change current digit to -" ?. If so I believe that the first table is correct -- Q Chris (talk) 14:39, 23 September 2011 (UTC)
 * I checked the first table. It is correct. +- means 3 * 1 + 1 * -1. CRGreathouse (t | c) 20:25, 23 September 2011 (UTC)
 * I checked it too. It is correct. "+&minus;" means a +1 in the threes' place and a &minus;1 in the ones' place, so three minus one equals two. Michael Hardy (talk) 21:00, 23 September 2011 (UTC)


 * Using the 1 01 notation, the table would be:
 * {| class="wikitable" style="width: 8em; text-align: center;"

! + !! 1 !! 0 !! 1 !  1  ! 0 ! 1
 * + Addition
 * - align="right"
 * 1 1 || 1 || 0
 * 1 || 0 || 1
 * 0 || 1 || 1 1
 * }


 * Does that make it clearer why the table as stated in the article is correct? Quantum7 20:01, 4 June 2012 (UTC)
 * I think this notation is much clearer. Dcoetzee 00:33, 5 June 2012 (UTC)
 * Both the same to me. If other people think this is clearer I would be fine with the chage. -- Q Chris (talk) 10:10, 5 June 2012 (UTC)
 * OK, I'll make the edit then. Quantum7 17:49, 5 June 2012 (UTC)

List of ternary equivalents for decimal fractions
I think I found a couple mistakes in the fraction table. We should double-check the accuracy of the List section.

1/16: Currently listed as 0. 001 1, the correct answer should be 0. 01 11 . Proof:

0.0+--0+--… x           +--+ ================ Carry:  + - + - … 0.0+--0+--…       0.-++0-++0…        -.++0-++0-…  +    +-.-0+--0+-…  ================        +.00000000…

1/17: Currently listed as 0. 01 111 0 1 10 1 000 11 1 . Should be 0. 01 111 10 1 0 1 111 1 01 . Proof:

0.0+---+0-0-+++-0+… x                     +-0- ========================== Carry: -   +    +  -    - … 0.0-+++-0+0+---+0-…       00-.+++-0+0+---+0-0-…  +    00+-.--+0-0-+++-0+0+-…  ==========================          +.0000000000000000…

Ternary long division is taking me forever, so I'll check the rest of them later. Even better, can someone find a reference for these fractions? Performing basic arithmetic doesn't seem like OR, but I'd sure prefer some third-party calculator to check for errors.
 * Division is settled in Knuth (Exercise 4.3.1:31). His method accounts for the fact that e.g. 16 (four BT digits) ÷ 4 (two) has a two-digit answer, just like 4 (two) ÷ 2 (two).

--Quantum7 21:41, 5 June 2012 (UTC)
 * How did you do the division?--Kc kennylau (talk) 02:42, 6 June 2012 (UTC)
 * I was originally just double-checking via multiplication, as above (eg 1/16 * 16 = 1). When I couldn't get it to equal one I calculated the answer by hand using long division. The only difference I found from decimal long division is that you have to carry a digit in the result if the remainder is more than twice the divisor. — Preceding unsigned comment added by Quantum7 (talk • contribs) 18:06, 6 June 2012 (UTC)
 * Further proofs are at balanced ternary/proof. There's no need to link the arithmetic from the main article, lets just add to it here.
 * Also, Kc kennylau, please check the notation discussion above. --Quantum7 18:41, 6 June 2012 (UTC)

--- Decimalism to Balanced Ternary --- 1/16            1/16, round to nearest, 0; remainder, 1/16;♦ 1/16×3= 3/16, round to nearest, 0; remainder, 3/16 3/16×3= 9/16, round to nearest, 1; remainder,-7/16 -7/16×3=-21/16, round to nearest,-1; remainder,-5/16 -5/16×3=-15/16, round to nearest,-1; remainder, 1/16; jump into the loop 1/1610 = 0. 01TT 3

1/17            1/17, round to nearest, 0; remainder, 1/17;♦ 1/17×3= 3/17, round to nearest, 0; remainder, 3/17; 3/17×3= 9/17, round to nearest, 1; remainder,-8/17; -8/17×3=-24/17, round to nearest,-1; remainder,-7/17; -7/17×3=-21/17, round to nearest,-1; remainder,-4/17; -4/17×3=-12/17, round to nearest,-1; remainder, 5/17; 5/17×3= 15/17, round to nearest, 1; remainder,-2/17; -2/17×3=- 6/17, round to nearest, 0; remainder,-6/17; -6/17×3=-18/17, round to nearest,-1; remainder,-1/17; -1/17×3=- 3/17, round to nearest, 0; remainder,-3/17; -3/17×3=- 9/17, round to nearest,-1; remainder, 8/17; 8/17×3= 24/17, round to nearest, 1; remainder, 7/17; 7/17×3= 21/17, round to nearest, 1; remainder, 4/17; 4/17×3= 12/17, round to nearest, 1; remainder,-5/17; -5/17×3=-15/17, round to nearest,-1; remainder, 2/17; 2/17×3= 6/17, round to nearest, 0; remainder, 6/17; 6/17×3= 18/17, round to nearest, 1; remainder, 1/17; jump into the loop 1/1710 = 0. 001TTT10T0T111T01 3

1/2              1/2, round to nearest1,1; remainder,-1/2;♦ -1/2×3=-3/2, round to nearest,-1; remainder -1/2; jump into the loop 1/210 = 1. T 3 --              1/2, round to nearest2,0; remainder, 1/2;♦ 1/2×3= 3/2, round to nearest, 1; remainder 1/2; jump into the loop 1/210 = 0. 1 3

1/2 is right the middle of the 0 and 1, so there're two "round to nearest" results, and there're two representations in balanced ternary system

- 365        365÷3=121⅔, round to nearest,122; remainder,-1; 122÷3= 40⅔, round to nearest, 41; remainder,-1; 41÷3= 13⅔, round to nearesr, 14; remainder,-1; 14÷3= 4⅔, round to nearest,  5; remainder,-1; 5÷3= 1⅔, round to nearest,  2; remainder,-1; 2÷3=  ⅔, round to nearest,  1; remainder,-1; 1÷3=  ⅓, round to nearest,  0; remainder, 1; 36510=1TTTTTT3 --- -365        -365÷3=-121⅔, round to nearest,-122; remainder, 1; -122÷3=- 40⅔, round to nearest,- 41; remainder, 1; - 41÷3=- 13⅔, round to nearest,- 14; remainder, 1; - 14÷3=- 4⅔, round to nearest,-  5; remainder, 1; - 5÷3=-  1⅔, round to nearest,-  2; remainder, 1; - 2÷3=-   ⅔, round to nearest,-  1; remainder, 1; - 1÷3=-   ⅓, round to nearest,   0; remainder,-1; -36510=T1111113

-25.4                         -25.4,round to nearest,-25; remainder -0.4;♦ -25÷3=-8⅓, round to nearest,-8;remainder,-1; | -0.4×3=-1.2, round to nearest,-1;remainder,-0.2; - 8÷3=-2⅔, round to nearest,-3;remainder, 1; | -0.2×3=-0.6, round to nearest,-1;remainder, 0.4; - 3÷3=-1, round to nearest,-1;remainder, 0; | 0.4×3= 1.2, round to nearest, 1;remainder, 0.2; - 1÷3=- ⅓, round to nearest, 0;remainder,-1; | 0.2×3= 0.6, round to nearest, 1;remainder,-0.4;jump into the loop -25.410=T01T. TT11

This is a benefit of balanced ternary. No speacial handling for negative number is needed. Orienomesh-w (talk) 16:20, 29 October 2012 (UTC)

Computational advantages
It says: "The notation has a number of computational advantages over regular binary, and over traditional ternary. Particularly, the one-digit multiplication table has no carries in balanced ternary, and the addition table has only two symmetric carries instead of three."

But it's not neutral.

Actually, the computational advantage of the Balternary is 1. the plus-minus consistency

…

2. rounding-truncate equivalence.

It make things simpler.

for example, 0.210 + 0.810

In Balternary, 0.1+1.T=1, 0.1T+1.T1=1, 0.1TT+1.T11=1, 0.1TT1+1.T11T=1,... always 1

But, in Binary,

0.0+1.0=1, 0.01+0.11=1, 0.010+0.110=1, 0.0011+0.1101=1,... rounding

0.0+0.1≠1, 0.00+0.11≠1, 0.001+0.110≠1, 0.0011+0.1100≠1,...truncate

Orienomesh-w (talk) 14:45, 12 November 2012 (UTC)


 * I think the "makes things simpler" needs a bit of expansion - maybe "truncation automatically rounds" or something like that. -- Q Chris (talk) 14:59, 12 November 2012 (UTC)

I want to say that " we can get right addition result without an extra rounding program." Orienomesh-w (talk) 16:04, 12 November 2012 (UTC)

IS the compact representation WP:OR and is it relevant
The "compact" representation is Balanced Septemvigesimal. Does this make it relevant to this article? Also is it complete WP:OR, the linked article uses two different symbol mappings to the unreferenced one shown here?

I don't think the compact form adds to understanding in this article, if anything the bracketed Balanced Septemvigesimal in tables like this confused me:

Should it be here? -- Q Chris (talk) 14:38, 29 November 2012 (UTC)
 * If you do not like it, just delete it. It's just a predefine item. Can't be viewed as a Balanced Septemvigesimal. -Orienomesh-w (talk) 10:38, 30 November 2012 (UTC)

rows vs columns
I dislike the new (Jan.25) arrangement of the number table: it visually suggests a (false) parallelism between numbers that differ by 5. What was wrong with the old one? —Tamfang (talk) 09:05, 9 February 2013 (UTC)

Gobledygook.
"In the balanced ternary system, the value of a digit n places left of the radix point the product of the digit and 3n" What on earth is that supposed to mean? Hammerfrog (talk) 10:54, 12 May 2013 (UTC)

Cleanup of the multi-trit division section
I'm going to be honest and say that I'm finding it very difficult to make sense of the multi-trit division section. (There are also some blatant typos and grammatical errors.) I'd like to take a crack at cleaning it up, but someone who understands it already would be far less likely to introduce errors. :-) Still, I have some downtime this morning and might get started. Being bold and all that. --Jay (Histrion) (talk • contribs) 14:09, 6 June 2013 (UTC)

"I have some downtime this morning". In a couple of years, the BT page has gone down from a fairly decent wiki page to what looks like a set of unedited personal notes. Useless.
 * Was that directed at me? If so, you might want to sign your comment, friend. In any case, all I was able to tackle that day was fixing a typo or two and cleaning up a couple of sentences, so the current state of the article (which I agree is a mess) isn't my fault. Further work will have to wait, however, until I've finished working out the kinks in the division algorithms. --Jay (Histrion) (talk • contribs) 17:53, 11 July 2013 (UTC)

″If the dividend over the plus or minus half divisor, the trit of the quotient must be 1 or T. If the dividend is between the plus and minus of half the divisor, the trit of the quotient is 0. The magnitude of the dividend must be compared with that of half the divisor before setting the quotient trit.″ That is not how you differentiate
 * 110TT ÷ 10T = 111 (i.e. 104 ÷ 8 = 13)

from
 * 11011 ÷ 10T = 1TTT (i.e. 112 ÷ 8 = 14),

is it? (2A02:A444:10D6:1:A0D0:7558:5C2E:44A3 (talk) 22:26, 28 September 2017 (UTC))

Repeated fraction example
The repeated fraction example after the table if BT decimals is not well explained and is using material (multiplication) that isn't explained until later in the article. It just gives a parenthetical note of an identity with a decimals value, but no explanation of why that identity is important or where the method/formula to convert the repeated decimal to fraction comes from. It needs to be fleshed out maybe in it's own section later in the article once multiplication and division are explained. Rs180216 (talk) 07:17, 7 September 2017 (UTC)


 * Agree, the fraction section is hard to understand. I have added a link to the decimal method but the section could do with expansion and more detailed explanation by someone more knowledgeable than me. -- Q Chris (talk) 07:47, 8 September 2017 (UTC)

Chapter "Conversion to balanced ternary from any integer base"
The chapter provides a formula of a well known convention. There is no algorithm describing the conversion. Then there is an example that is not understandable (uses numbers without an explanation how they were obtained).
 * Agree, I can't make sense of this section either -- Q Chris (talk) 15:38, 31 July 2019 (UTC)
 * Actually it does make sense but it is only half the solution. It accumulates a value, but does not show how that value is output in balanced ternary.

General
Remarks about biased numeral system (in "Conversion from ternary") confuse representation with implementation and are essentially vacuous.

"The basic operations—addition, subtraction, multiplication, and division—are done as in regular ternary" is obviously false; moreover, BT subtraction (as a "basic operation", i.e. not done as adding the inverse) and division are conceptually weird and more needs to be said about them.

"and an arithmetic shift right of a balanced ternary number is the equivalent of division by a (positive, integral) power of 3." But only in two thirds of the cases the arithmetic right shift gives the same result in both balanced ternary and ordinary ternary, so what is this quote supposed to mean?2A02:A445:EB91:1:717F:8142:3278:D14F (talk) 12:00, 18 March 2020 (UTC)

Ternary integer valuation
It appears that the whole paragraph contains severe misinformation. So I removed the whole section "Contrast to base 2 integer evaluation" and tried to rescue some of the remaining paragraph. −Nomen4Omen (talk) 09:30, 31 October 2020 (UTC)
 * 1) A valuation is DEFINED to map "numbers" (elements) to non-negative real numbers, and does not evaluate a string into the integers.
 * 2) There is nothing "canonical".
 * 3) The begins of the strings are at index 0 to the right, the ends are to the left at index $$n$$.
 * 4) You seem to assume $$v_{2}(\rm T) = f(\rm T) = -1$$. If you do so, then the map is indeed surjective.
 * 5) But then the odd integer 3 has at least the 5 representations $$3 = v_2(11) = v_2(10\rm T) = v_2(1\rm T 1) = v_2(1\rm T 0\rm T) = v_2(1\rm T \rm T 1)$$; and the odd integer 1 $$1 = v_2(1) = v_2(1\rm T) = v_2(1\rm T \rm T) = v_2(1\rm T \rm T \rm T) = v_2(1\rm T \rm T \rm T \rm T )$$.
 * 6) There is absolutely nobody who uses the $$v_2$$ of this section. So you need not give a reason for that.

Page deletion
As per 10/31/2020 this article is FUBAR. Umpteenth mathematical topic that has been totally "fringified" into an unannotated, unstructured, unbalanced set of comments. This page should be identified for deletion for reasons of vandalism, lack of reliable sources and lack of notability.2A02:A445:EB91:1:905B:5A74:BB35:1717 (talk) 12:53, 1 November 2020 (UTC)

The section called **Definition** is either meant as (thus it is misplaced here; it does not appear anywhere else, is unsourced, and must be considered OR; furthermore, it says nothing specific about either signed digits or 'balancedness', and it is not referred to later in the article, and therefore it is insular info with no relevance in this article) or as Either way, this section should be removed.2A02:A440:948D:1:7C51:F64E:6D22:1D9C (talk) 22:21, 15 May 2022 (UTC)
 * an overly precise definition of signed numeration, of which BT would be an application
 * a ghastly exposition of BT conversion with the use of an improper formalism (in which case it is functionally a duplicate of the next section)

Efficiency of multiplication
I the claim about the need for signed and unsigned variants of multiplication operations, and removed the  template. I would be interested to see any unbalanced architecture that can achieve similar efficiency to a balanced representation for signed multiplication for multi-word arguments without signed/unsigned variants of the multiplication instruction, even disregarding packing inefficiencies such as ignoring the loss of a most significant bit. (Courtesy ping: .) —Quondum 21:11, 28 December 2020 (UTC)
 * It's still dubious. The only differences between signed and unsigned multiplication for binary involve minor variations in carrying that do not require duplicate hardware. If CPU hardware were really a concern, they would be designed purely for signed 2's complement binary. The fact that they aren't suggests that your rationale carries no weight with actual CPU designers. —David Eppstein (talk) 21:21, 28 December 2020 (UTC)


 * I agree with David. I don't think that the unsigned types are provided for efficiency reasons. The reason is more alongside space. In fact, if you want to construct support for extremely long integers (signed or unsigned) the first word with the highest significance will be signed or unsigned, but the following words with lesser significance will all be unsigned, just as the subsequent bits in a single word integer. And the distinction between signed and unsigned is obsolete when the type is balanced. –Nomen4Omen (talk) 21:33, 28 December 2020 (UTC)


 * Have you ever tried to implement a multi-word signed multiply with only one variant of instruction? Note that duplication of hardware is not being claimed; I agree that there are only minor differences in the ways the same hardware would be applied.  It is the fact that how the carry logic operates must be selected that forces multiple variants of instruction.  This is not of significance in the cost of the hardware (it might just be a few logic gates), but rather in the greater number of instructions needed.  The claim is that without the additional instructions, the same efficiency cannot be achieved.  —Quondum 21:36, 28 December 2020 (UTC)


 * Do you have a published source for your argument that a reduced number of arithmetic instructions leads to any actual design efficiencies, or is this all just original research? —David Eppstein (talk) 22:50, 28 December 2020 (UTC)


 * I think you may have me wrong. I agree with your removal of claims of comparative advantage with other representations; I find this article to be overly heavy with potentially OR claims of advantage.  In response to your question, I make no claim that what I say is sourced.  My experience is what I base my comments on (and I have no intention of including this in the article; I had simply tried to clarify what was already there): for example, it may be an issue in a multiply-heavy instruction set (as with the Motorola 56000, where it appears that at least 25% of the instruction set encodings are devoted to signed multiply instruction variants, with the effect that even a single bit spent on encoding unsigned variants would have forced significant design compromises; I think as a consequence multi-precision multiply routines were perforce comparatively inefficient).  More generally, to write a loop in which the last iteration only uses a signed variant will increase the code size slightly, which in turn could impact cache performance.  However, since this is no longer seems to pertain to the content of the article, I suggest that we drop it.  —Quondum 00:43, 29 December 2020 (UTC)

Efficiency of multi-word addition
In looking at multi-word arithmetic, I think we're allowed to concentrate on addition and subtraction, because of the many many diverse approaches to multiplication (Fürer's algorithm with Θ(n log(n) log(log(n))) resp. O(n log n) 2016 or  2017.)

And there can be no doubt that multi-word binary addition and subtraction benefits from the existence of the duality signed<->unsigned. Whereas for balanced systems, e.g. balanced-ternary, there is signed&equiv;unsigned, because every (ternary) digit acts the same way, so that multi-word addition and subtraction is easily extended from single-word addition and subtraction. I'm sure, there are sources for this observation, maybe but I do not have one of them in my library. –Nomen4Omen (talk) 09:11, 29 December 2020 (UTC)
 * 1) . Reprinted in or


 * I'm afraid I am having difficulty parsing what it is that your observation is (what is "unsigned" in a balanced numeral system?), as well as how having a balanced system might relate to efficiency of multi-word addition as alluded to on your section title. —Quondum 16:30, 29 December 2020 (UTC)

The following "observations" are all essentially trivial: ==> This statement tries to underline my observation that "multi-word balanced ternary addition and subtraction does not benefit from the existence of a duality signed<->unsigned". ==> This statement tries to underline my observation that "multi-word binary addition and subtraction benefits from the existence of the duality signed<->unsigned". I would propose "Balanced ternary provides a representation of integers that naturally extends integer arithmetic, especially addition and subtraction, from single-word to multi-word. This way, the well-known notion of unsignedness is made obsolete."
 * Thanks for your response.
 * With respect to its size every unsigned integer can be represented in a signed one, whereas an integer which is negative cannot be represented in an unsigned integer.
 * Because in balanced numeral systems EVERY representation is signed (= your remark above) and because of the forgoing remark, a balanced numeral system does not really require any notion of unsignedness.
 * The result c of the (binary) addition c=a+b is bitwise the same irrespective of the signedness or unsignedness of each of the partners a,b,or c. The only difference lies in the resulting "flag" (or "condition code"). For unsigned there are 2 values of the flag: "nocarry" or "carry"; for signed there are more: "positive", "zero", "negative", and "overflow".
 * If you want to provide a package for multi-word integer addition in binary, you may declare every word except the first one as unsigned. (Then a good language implementation will inform you about the event of a carry, so that you are able to take care of it.) This is in complete analogy to the use of the bits in a 32-bit word: the first bit determines the sign and the subsequent bits are all unsigned. (If you use signed integers instead of the unsigned ones you lose 1 bit per non-first word, because all the non-first digits (words) are nonnegative, and have a slightly more complicated logic.)
 * (Whether multi-word binary multiplication benefits from the existence of the duality signed<->unsigned" or multi-word multiplication benefits from balanced ternary is not so much my concern. As far as I know, the implementation of balanced ternary cannot be as economical as that of binary. And, the asymptotic performance of integer multiplication is not yet completely settled.)
 * Remarkable for me is
 * ... that binary systems know of the duality signed<->unsigned. This even has an effect on a programming language such as C.
 * ... that the duality signed<->unsigned is totally irrelevant when the numeric system is balanced.
 * As far as I know, the article's § "In computer design​" is the only one which tries to express this observation. Maybe this observation should be placed into a different article, such as "unsigned data type". (But the current article is not so bad a choice.)
 * Instead of your wording "Balanced ternary provides a representation of integers that naturally extends multiplication of long integers in terms of the multiplication operation on single cells."


 * user:David Eppstein has the concern that this would be WP:OR. I, however, am sure that there are sources in the vast available literature. –Nomen4Omen (talk) 20:49, 29 December 2020 (UTC)


 * In the context, we are not concerned about a fixed interpretation of any representation: the same representation in hardware can, for example, be interpreted as unsigned or 2's complement. This has the effect that neither of your point 1s are valid (and I'll contradict you on C: it does not consider the signedness of the values for addition, subtraction or multiplication due to the most significant bits being discarded).  Binary as unsigned and as 2's complement results in the identical hardware implementation for addition, including your apparent carry/overflow variations.
 * Asymptotic performance of fast multiplication algorithms is out of scope IMO. They do not generally apply to everyday computation, even for moderately long values.  —Quondum 22:48, 29 December 2020 (UTC)

I thought that I was saying: "the same" bit sequence "in hardware can, for example, be interpreted as unsigned or" signed – with the same (number theoretic) result as long as the high order (resp. the sign) bit is 0. The bit sequence 10000000 as signed byte stands for the integer -128, whereas as unsigned byte it stands for +128. signed = unsigned; unsigned = signed; As far as I remember: it does not.
 * Whether your (or my) statements about C are correct may be easily tried out. I observed that although the bitwise result is the same, C generates logical ADD for unsigned and algebraic ADD for signed (why? remains unanswered). But I never found "the most significant bits being discarded". E.g. the subtraction of 1 from bit sequence 10000000 results in 127 for both types, signed byte and unsigned byte. Unfortunately, I do not have access to a C compiler. The following question would also be of interest: does the generated code check the contents of the variables for the most simple assignments
 * I agree: "Asymptotic performance of fast multiplication algorithms is out of scope." But under your heading "Efficiency of multiplication​" it would be within scope.
 * –Nomen4Omen (talk) 12:29, 31 December 2020 (UTC)
 * So we have nothing to indicate that multi-word addition as signed or unsigned is any different in the binary signed and unsigned cases, even on the instruction set. For multiplication I claimed only that there is an impact on the instruction set complexity to retain efficiency.  In the context of this article, this is not significant.
 * I have no idea what you mean by "logical ADD" and "algebraic ADD".
 * In answer to your question, in C, the sign of the source is ignored if you are assigning to an integer of the same or lesser bit length, but sign extension is performed if to a greater bit length according to the declared signedness of the source.
 * I disagree with the relevance of asymptotic behaviour of algorithms, even with multiplication. Assuming a constrained instruction set is not relevant in that context.
 * In all, I see nothing that would lead to anything relevant to this article. —Quondum 17:04, 31 December 2020 (UTC)


 * With Balanced ternary (title of the current article) systems the notion of unsignedness does not exist at all. Everything is signed. Isn't this really great? –Nomen4Omen (talk) 17:34, 31 December 2020 (UTC)


 * This cannot be correct. Although balanced ternary (BT) is used to represent values that are signed in other systems (binary two's complement, decimal, e.a.), from a computational viewpoint BT is strictly unsigned, as it doesn't have sign extension, overflow, etc.2A02:A440:948D:1:9D04:30E3:797C:67FC (talk) 16:49, 20 February 2021 (UTC)

Numeral system
The lede and the (weird) following section only discuss balance ternary integers. Fractions emerge unheralded in the remainder of the text. (2A02:A440:948D:1:A55A:B9E4:F071:A240 (talk) 10:03, 11 November 2023 (UTC))