Or directly get the last digits from (-1, 0, 1) 100 = 33 * 3 + 1 33 = 11 * 3 + 0 11 = 4 * 3 + (-1) 4 = 1 * 3 + 1 1 = 0 * 3 + 1 Collect those digits together, we get 11X01_3
On 2010-8-31 23:40, Dave wrote:
352/9 = 39-1/9 = 27 + 9 + 3 + 1/9 = 1*3^3 + 1*3^2 + 1*3^1 + 0*3^0 + 0*3^(-1) + 1*3^(-2) = 1110.01_3 Another example, where -1 comes into play: Using ordinary ternary {0,1,2} representation: 100 = 1*3^4 + 0*3^3 + 2*3^2 + 0*3^1 + 1*3^0 = 10201_3{0,1,2} Now transform into the {0,1,-1} representation by replacing 2 with -1 and adding 1 to the place digit to the left, propagating a carry if necessary. I.e., if as you add 1 to the digit to the left it becomes 2, then you repeat the transformation on that digit as well. I'll write 1 bar as X. = 11X01_3{0,1,-1} Dave On Aug 30, 6:46 pm, Raj N<[email protected]> wrote:In ternary number representation, numbers are represented as 0,1,-1. (Here -1 is represented as 1 bar.) How is 352/9 represented in ternary number representation?
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
