Transform $1001.12211$ from base $3$ to base $9$.

77 Views Asked by At

Transform $1001.12211$ from base $3$ to base $9$.

Separately transform the integer and non-integer portion. The integer portion is divided by $9$:

$$ \begin{array}{ r|cc } 9&1&0&0&1 \\ \hline &&&3&1 \\ \end{array} $$

Therefore $1001_3=31_9$.

For the non-integer portion, it is multiplication by $9$: $$ \begin{array}{c} 0.&1&2&2&1&1 \\ &&&&&9 \\ \hline 12.&1&1&1&0&0 \\ \end{array} $$

But $12.11100$ has two digits in the integer portion when there should only be one, and the correct answer is $31.573$, so I made a mistake somewhere in the multiplication but I don't know where.

4

There are 4 best solutions below

0
On BEST ANSWER

For the fractional part $0.12211_3$, multiplying by $9$ gives $12.\color{red}211_3$.

This integer part $12_3$ has multiple ternary digits, but still only one base-$9$ digit as expected. This shows that, in base $9$, the first digit after the radix point is at least $3$:

$$12_3 \ge 10_3 \iff 5_9 \ge 3_9$$

The same can happen if the target base is larger than the original base. For example, when converting the decimal number $0.75$ to base $16$.


Not related to your initial confusion, but noted by other answers and comments:

In this particular conversion from base $9$ to base $3$, the multiplication or division by $9$ (for the fractional or integer parts, respectively) is especially easy.

That's because $9 = 100_3$, and multiplication or division by $100_3$ would be shifting the radix point by two places in base $3$. So converting each pair of ternary digits left or right of the radix point gives a base-$9$ digit directly.

0
On

Let me translate the binary number $11100100$ into the base-$4$ system:

$11100100_2 = 1 \cdot 2^7 + 1 \cdot 2^6 + 1 \cdot 2^5 + 0 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 0 \cdot 2^1 + 0 \cdot 2^0$
$ = (1 \cdot 2^7 + 1 \cdot 2^6) + (1 \cdot 2^5 + 0 \cdot 2^4) + (0 \cdot 2^3 + 1 \cdot 2^2) + (0 \cdot 2^1 + 0 \cdot 2^0)$
$ = 3 \cdot 4^3 + 2 \cdot 4^2 + 1 \cdot 4^1 + 0 \cdot 4^0$
$ = 3210_4$

This can be done much easier:

$11100100_2 = ((11)_2(10)_2(01)_2(00)_2)_4 = 3210_4$

Why is this so simple and how do I know that I need to take two digits every time?
Well: $2^a = 4$, where $a=2$.

Imagine you want to convert the name number into base-$8$:
($2^3=8$, so you need to group by $3$)

$11100100_2 = ((011)_2(100)_2(100)_2)_8 = 344_8$

2
On

To answer this question, I would like to take a different approach. (It is just expansion on the comment by @Paul)

Take $0.a_1 a_2 \dots a_n$ modulo $3$ is same as $$\frac{a_1}{3} + \frac{a_2}{3^2} + \cdots + \frac{a_n}{3^n}$$ in decimal expansion. Now to go modulo $9$ is quite easy.

For example in this case $$\frac{1}{3} + \frac{2}{9} + \frac{2}{21} + \frac{1}{81} + \frac{1}{243} = \frac{5}{9} + \frac{7}{81} + \frac{3}{729}$$

EDIT. We can reach to the same answer using the method suggested in the question. (There is a miscalculation)

$(.12211)_3 \times 9 = (12.211)_3$. Now $(12)_3 = (5)_9$. Again, $(.211) \times 9 = (21.1)_3$ and $(21)_3 = (7)_9$. Finally, $(.1) \times 9 = (10)_3$ and $(10)_3 = (3)_9$.

Hence, $(.12211)_3 = (.573)_9$.

0
On

The general way to solve these problems is to note that every place-value numeral is a polynomial (or Laurent polynomial if there are digits after the radix point) in terms of the base. So the base-$b$ numeral $1001.12211$ in expanded form is:

$$1 b^3 + 0 b^2 + 0 b^1 + 1 b^0 + 1 b^{-1} + 2 b^{-2} + 2 b^{-3} + 1 b^{-4} + 1 b^{-5}$$ $$= b^3 + 1 + b^{-1} + 2 b^{-2} + 2 b^{-3} + b^{-4} + b^{-5}$$ $$\frac{b^8 + b^5 + b^4 + 2 b^3 + 2 b^2 + b + 1}{b^5}$$

So to find the value of $1001.12211_3$, you just need to plug $b = 3$ into the above expression, to get:

$$1001.12211_3 = \frac{6961}{243} = 28 + \frac{157}{243}$$

To tranform this to base-9, note that $28 = 3\times 9 + 1$ and $\frac{157}{243} = 5 \times \frac{1}{9} + \frac{22}{243}$. The remainder $\frac{22}{243}$ breaks down further into $7 \times \frac{1}{81} + \frac{1}{243}$, and then $\frac{1}{243}$ is exactly $3 \times \frac{1}{729}$, so:

$$28 + \frac{157}{243}$$ $$= 3 \times 9^1 + 1 \times 9^0 + 5 \times 9^{-1} + 7 \times 9^{-2} + 3 \times 9^{-3}$$ $$= 31.573_9$$


However, as @Dominque alluded to, base conversion has a shortcut if one of the bases is a perfect power of the other. If you're a computer programmer, you may be familiar with the fact that binary (base-2) digits can be grouped in threes to make octal (base-8 = $2^3$) digits:

$$11111100111_2$$ $$= (0)11~111~100~111$$ $$= 3747_8$$

Or in fours to make hexadecimal (base-16 = $2^4$) digits:

$$11111100111_2$$ $$= (0)111~1110~0111$$ $$= 7E7_{16}$$

Similarly, you can group base-3 digits in pairs to make base-9 digits.

$$1001.12211_3$$ $$10~01.12~21~1(0)_3$$ $$31.573_9$$