What are number bases? Simply put the base of a number is the number of unique digits, including the digit zero, used to represent numbers. It is also called the radix. So for example, if I say I am counting in base ten, it means that the numerical system I am counting in has 10 unique digits. If I say base 5, it means 5 unique digits in the numerical system.
It’s a multiplication table. I had a few people guess that - the layout and symmetry gives it away pretty well. The top row reads 1, 2, 3, ... 10, the second row reads 2, 4, 6, ... 20, and so on. But what’s the code?
We’ve got three different digits - a vertical line, a horizontal line and a circle. This suggests some kind of ternary, or base-3 system. In "regular” ternary, your digits are 0, 1 and 2, and each position in the number is worth three times more than the position to its right. Similarly with binary having 0 and 1 and each place being worth twice the place to its right, decimal having 0 to 9 and each place being worth ten times to the place to its right and so on.
So in regular ternary, you count 0, 1, 2, 10, 11, 12, 20, 21, 22, 100 and so on.
If we guess that | is 1 and O is 0, this seems to fit reasonably well with the multiplication table guess - I is 1, |O is 3, || is 4, |OO is 9. But if — were 2, then |— would be 5 - which doesn’t fit the pattern. 1, 5, 3, 4? So — must be something else. But what?
Well, if we accept the guess that |— is 2, then what does that mean? It means we have one 3, and an unknown number of 1s - 3(1) + 1(x) = 2, or 3 + x = 2 ... so x = -1. — means -1! If you want to check that, |—— is supposed to mean 5. Does it? Well, 3²(1) + 3(-1) + 1(-1) = 9 - 3 - 1 = 9 - 4 = 5. So it looks like it works. On the multiplication table, 100 becomes ||—O|: 3^4(1) + 3³(1) + 3²(-1) + 3(0) + 1(1) = 81 + 27 - 9 + 1 = 109 - 9 = 100.
So we’re using a variant of ternary where our digits are 0, 1 and -1. This is known as balanced ternary, and was actually used by some early computers, notably a number of experimental Soviet machines like Setun ( https://en.wikipedia.org/wiki/Setun ). It had a couple of interesting advantages over binary in these machines, notably a reduction in carry digits.
A famous puzzle use balanced ternary: say you have a old-fashioned weighing balance with two pans, and you need to weigh things up to 40 grams in weight. What’s the smallest number of unique weights you can do this with?
The obvious answer is to go to binary and say you need weights of 1g, 2g, 4g, 8g, 16g and 32g. Adding some of these values up can get you any number between 1 and 63.
But if you let yourself put weights on both sides of the scale (effectively creating negative weight), you only need weights of 1g, 3g, 9g and 27g to weigh anything up to 40 grams! (27+9+3+1). 20 grams, say, would have the 27g and 3g weights on the “right” side of the scale, and the 9g and 1g weights on the same side of the scale as whatever you were weighing.
Wikipedia has more on balanced ternary here: https://en.wikipedia.org/wiki/Balanced_ternary#In_computer_design
// <![CDATA[ // // define base var digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // remove blank space function ignoreSpaces(string) { var temp = ""; string = '' + string; splitstring = string.split(" "); for(i = 0; i < splitstring.length; i++) temp += splitstring[i]; return temp; } // prepare conversion function xtoy(base) { var k = converter.input.value; var i = 0; var sum=0; var j = 0; // no comma while(k.charAt(i)!="." && i<=k.length) i++; k = k.substring(0,i); i=0; // change LowerCase to UpperCase text = k var casechanged = text.toUpperCase(); k = casechanged // - minus sign, + minus sign var sign = 1; if (k.charAt(0) == "-") { sign=-1; k = k.substring(1,k.length); } var pot = k.length-1; // Convert while(pot>=0) { while (k.charAt(j)!=digits.charAt(i) && i<=base) i++; sum = sum + ((i) * Math.pow(base,pot)); j++; pot--; i=0; } ytox(sign*sum); } function ytox(z) { var base = converter.tobase.value; var xconverted; var k = z + ""; if (k.charAt(0) == "-") xconverted="-"; else xconverted=""; k = Math.abs(k); var j = 0; var i = 0; while(k>=Math.pow(base,(i+1))) i++; while(k>0){ while (k>=((j+1)*Math.pow(base,i))) j++; k = k - (j)*Math.pow(base,i); xconverted = xconverted + digits.charAt(j); i--; j = 0; } for(j=i;j>=0;j--) xconverted = xconverted + "0"; converter.output.value = xconverted } // ]]>
The
BASE NUMBER System
From base 1 - 36 to base 2 - 36
Use only numbers 0 - 9 and A - Z
this is base table : (Base=Red)
(Input/output value=blue)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35)