For Math UIL Tests, there are always a few problems that have base conversions. I would like to know the fastest way to convert to and from base 10.
Here are my current methods:
For going to base 10:
I traditionally used n*b^d for each digit and then added the products together
n would be the value of the digit, b would be the base you are converting from, and d the digit's place.
Example:
1234b6 to ______b10
$${\mathtt{1}}{\mathtt{\,\times\,}}{{\mathtt{6}}}^{{\mathtt{3}}}{\mathtt{\,\small\textbf+\,}}{\mathtt{2}}{\mathtt{\,\times\,}}{{\mathtt{6}}}^{{\mathtt{2}}}{\mathtt{\,\small\textbf+\,}}{\mathtt{3}}{\mathtt{\,\times\,}}{{\mathtt{6}}}^{{\mathtt{1}}}{\mathtt{\,\small\textbf+\,}}{\mathtt{4}}{\mathtt{\,\times\,}}{{\mathtt{6}}}^{{\mathtt{0}}} = {\mathtt{310}}$$
$${\mathtt{216}}{\mathtt{\,\small\textbf+\,}}{\mathtt{72}}{\mathtt{\,\small\textbf+\,}}{\mathtt{18}}{\mathtt{\,\small\textbf+\,}}{\mathtt{4}} = {\mathtt{310}}$$
My friend said there was a faster way, multiply-add:
Starting from the left, you multiply the first digit by the base you're converting from, and then add the next digit and repeat. Then you add the base you're converting from:
$${\mathtt{1}}{\mathtt{\,\times\,}}{\mathtt{6}} = {\mathtt{6}}{\mathtt{\,\small\textbf+\,}}{\mathtt{2}} = {\mathtt{8}}{\mathtt{\,\times\,}}{\mathtt{6}} = {\mathtt{48}}{\mathtt{\,\small\textbf+\,}}{\mathtt{3}} = {\mathtt{51}}{\mathtt{\,\times\,}}{\mathtt{6}} = {\mathtt{306}}{\mathtt{\,\small\textbf+\,}}{\mathtt{4}} = {\mathtt{310}}$$
Is this the fastest way and is it accurate?
For going from base 10:
I've been using the division remainders method:
310b10=____b6
310 ÷ 6 = 51 R4
51 ÷ 6 = 8 R3
8 ÷ 6 = 1 R2
(1 ÷ 6 = 0 R1)
So the remainders are the digit: 1, 2, 3, and 4 = 1234
Is there a faster way for this?
1*6=6+2=12*6=72+3=75*6=300+4=304+6=310 ??????
Since when does 6+2 equal 12, and 75*6 equal 300?
I think you must mean:
1*6 = 6 6+2=8
8*6 = 48 48+3 = 51
51*6 = 306 306+4 = 310
This is expressing the original in nested form:
((1*6 + 2)*6 + 3)*6+4 = 1*63 + 2*62 + 3*61 + 4*60
It requires fewer multiplications so it might be faster, but it is clearly more prone to error!
.
1*6=6+2=12*6=72+3=75*6=300+4=304+6=310 ??????
Since when does 6+2 equal 12, and 75*6 equal 300?
I think you must mean:
1*6 = 6 6+2=8
8*6 = 48 48+3 = 51
51*6 = 306 306+4 = 310
This is expressing the original in nested form:
((1*6 + 2)*6 + 3)*6+4 = 1*63 + 2*62 + 3*61 + 4*60
It requires fewer multiplications so it might be faster, but it is clearly more prone to error!
.
I was tired when I wrote that, and I must have thought 6+2 was 6*2 and 75*6 was 75*4.