Why can we convert a base $9$ number to a base $3$ number by simply converting each base $9$ digit into two base $3$ digits?

This has more to do with place value.

Consider the image:

enter image description here

The key is the fact that $3^2 = 9$

  • All the value below $3^2$ ($3^0 $ and $ 3^1 $) has to be accomodated in $9^0$

    that is

  • all the values in $9^0$ have to be accommodated in the two places below $3^2$ ($3^0 $ and $ 3^1 $)

Similarly for any other places.


  • This rule also applies to conversion between binary and octal, or binary and hexadecimal, or conversion between any base $k$ and base $k^n$

In general, for conversion of a number $N$ in any base $k$ to base $k^n$, each digit of $N_{k^n}$ get converted to n digits of $N_k$


Consider $N$ in base 3. For simplicity, we can assume that $N_3$ has an even number of digits: if it doesn't, just tack on a leftmost $0$. So let: $$N_3 = t_{2n+1} t_{2n}\dotsc t_{2k+1} t_{2k} \dotsc t_1 t_0. $$ What this positional notation really means is that: $$ N = \sum_{i = 0}^{2n+1} t_i 3^i, $$ which we can rewrite as: $$\begin{align} N &= \sum_{k = 0}^{n} (t_{2k+1} 3^{2k+1} + t_{2k} 3^{2k}) \\ &= \sum_{k = 0}^{n} (3 t_{2k+1} + t_{2k}) 3^{2k} \\ &= \sum_{k = 0}^{n} (3 t_{2k+1} + t_{2k}) 9^{k}. \\ \end{align}$$

But now, note that for each $k$, $3 t_{2k+1} + t_{2k}$ is precisely the base-9 digit corresponding to the consecutive pair of base-3 digits $t_{2k+1} t_{2k}$.


I'm not sure whether you're asking for a proof, or some intuition. The proof is fairly mechanical, so I'll explain why you might expect this to be true.

Putting your information theory hat on, two base 3 digits carry exactly as much information as one base 9 digit. That is, suppose you know I'm going to pass you two digits, each from 0,1 and 2. Then you know there are $3 \cdot 3 =9$ possibilities for what information I could pass.

On the other hand, if I passed you a single digit from 0,1,...,8, then there are again 9 possibilities.

Continuing in this fashion, $n$ digits of base 9 pass as much information as $2n$ digits of base 3.

This isn't exactly a proof yet. You'd need to prove that you don't skip any values. Perhaps doing the computation you describe can never return the value $102_3$. Thankfully it can. But you'd need to think about why this will always work.