Page 1 of 2

Base conversion

Posted: Fri Dec 09, 2011 10:23 am
by Abdul Muntakim Rafi
Guys which base conversion method do you use? Suppose you need to convert any given number from base 10 to base x... How do you do it?

Re: Base conversion

Posted: Fri Dec 09, 2011 11:14 am
by sourav das
Step:1 Divide the number by $x$, get a remainder, that will be your rightmost digit in base x
..........
.........
Step:i if the quotient of (i-1)th step is less than x that it'll be the last digit in (x base); else Divide the number by $x$ get a remainder, that will be your i'th digit(from right) in base x

Find out why it'll work. :)

Re: Base conversion

Posted: Fri Dec 09, 2011 11:50 am
by Abdul Muntakim Rafi
I use this technique too... :D Got it from the net... And I think you made a typing mistake in this line...
Step:i if the quotient of (i-1)th step is less than x that it'll be the last digit in (x base)
It will be the first digit... the last digit is the first remainder we get when we divide the number by x...

And it works cause we are doing all these to present the number like this

\[i x^n+ R_{n}x^{n-1}+R_{n-1}x^{n-2}+... ... ...+R_{2}x^1+R_{1} \]

\[R_{n},R_{n-1},..........,R_{2},R_{1} \]
are remainders we get each time we divide by $x$... $i$ is the quotient less than $x$

Re: Base conversion

Posted: Fri Dec 09, 2011 12:04 pm
by sourav das
I meant to say last digit if you read the number from right to left. :)

Re: Base conversion

Posted: Fri Dec 09, 2011 12:11 pm
by Abdul Muntakim Rafi
Oh yes... you mentioned that... :D

Re: Base conversion

Posted: Fri Dec 09, 2011 12:50 pm
by Labib
How do you do the opposite?
For example...

$BOOK_{base 8}=BOOK_{base 7}+BOOK_{base 5}$.
Here $B,O,K$ are three different digits...
Find their value...

Re: Base conversion

Posted: Fri Dec 09, 2011 3:12 pm
by nafistiham
well there is a short way to conver bases.
take the number and start dividing it with the new base $x$
every time keep the remainder aside and do the division again.
this process will go on until you get the divisor smaller than $x$
now, arrange the last divisor and the remainders in the oppposite direction you get it.
as it is a long term, i am not giving an example.if you don't understand something here, please post.i'll give an example.

Re: Base conversion

Posted: Fri Dec 09, 2011 3:34 pm
by Abdul Muntakim Rafi
Hey what can we do if we are to convert any given number from base x to y ... I have an idea...
base x-->base 10-->base y ... Please share if you know any direct method...

Labib, the opposite way is that- suppose a number is abc (base x)
Now to go base 10...

$a x^2 + bx + c $
Calculate and you got the result... :D

And how to solve your problem... I have so far found that
$44B = K + 14 O $
Then what to do... Trial & Error!

Re: Base conversion

Posted: Fri Dec 09, 2011 4:33 pm
by Labib
Darn!!
Really nice help from you, Rafi!! Thanks! :D
Solution: $B=2,O=6,K=4.$

Re: Base conversion

Posted: Sat Dec 10, 2011 12:03 pm
by Abdul Muntakim Rafi
Labib, you are welcome friend. :D
And is $O=6$ a valid answer? Cause if $O=6$ then how can we write $BOOK$ as a 5 base number...
My answer is $B=1,K=2,O=3$
$44=2+42$

Now we can verify our answer...

\[BOOK_{base 8}=BOOK_{base 7}+BOOK_{base 5}\]
\[1332_{base 8}=1332_{base 7}+1332_{base 5}\]

We convert them to base 10.
\[1332_{base 8}=730_{base 10}\]
\[1332_{base 7}+1332_{base 5}=513_{base 10}+217_{base 10}=730_{base 10}\]

So the answer is right. $O=6$ can't be an answer I think cause there is no such digit 6 in base 5... :D