0
$\begingroup$

I am not very good in math so I apologize if my question is too simple and does not belong here... Why an integer in numeral system X can be converted to decimal by multiplying it's digits to X (meaning base of the numeral system) which is raised to corresponding power (0,1,2,3 etc)? I mean that it seems like it is a universal way to convert any numeral system to decimal. But why there is no similar formula (involving multiplication by the base + exponents) to convert an integer of any numeral system to an integer in any numeral system? Thanks!

$\endgroup$
  • $\begingroup$ Not sure this is clear. Do you mean something like $137=1\times 10^2+3\times 10^1+7\times 10^0$? If so, an analogous formula does hold for other bases. $\endgroup$ – lulu Jul 4 '18 at 16:10
  • $\begingroup$ Yes, that exactly what I meant. But could you give an example of conversion from binary to duodenary system using the same approach? Thanks $\endgroup$ – user574077 Jul 4 '18 at 16:14
  • $\begingroup$ Conversion between bases isn't as simple as all that. Think about decimal to binary, say. you need to find the largest power of $2$ less than or equal to the given number, subtract that and repeat. Simple, but not a closed formula. $\endgroup$ – lulu Jul 4 '18 at 16:24
0
$\begingroup$

There is such a formula. There is nothing peculiar about base $10$. Suppose that you this number: $1\,332$, which is supposed to be a number written in base $4$. And suppose that you want to exprees it in base $6$. So, you compute $2$, $3\times4$, $3\times4^2$ and $4^3$, but you express them in base $6$. You'll get $2$, $20$, $120$, and $144$ respectively. Then you sum them (doing all computations in base $6$, and you'll get the answer: $330$.

$\endgroup$
  • $\begingroup$ Ok, got it. Formula is the same for conversion to any other numeral system and my confusion was related to the EXPRESSION of the result in decimal system. So the result of conversion can be expressed in any required numeral system. Thanks for great explanation! $\endgroup$ – user574077 Jul 4 '18 at 16:23
  • $\begingroup$ Yes, that's right. $\endgroup$ – José Carlos Santos Jul 4 '18 at 16:24
  • $\begingroup$ Apparently this formula does not convert between numeral systems at all. It just simplifies conversion by breaking down a number to addends. By addends I mean each digit of a number multiplied by base raised to a power corresponding to this digit position. Like number 123 in base 10 can be represented as 100 + 20 + 3. Then each addend can be converted to any numer system one by one and a sum of these converted numbers expressed in required numer system will be a converted number.. It is more natural and easy for us to convert it to decimal. $\endgroup$ – user574077 Jul 4 '18 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.