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 ?
For example 8139 can be converted directly to base 3 by noting
89=223 19=013 39=103
Putting the base digits together ,we get 8139=2201103
I know it has to do with the fact that 9=32 but I am not able to understand this all by this simple fact...
Answer
Consider N in base 3. For simplicity, we can assume that N3 has an even number of digits: if it doesn't, just tack on a leftmost 0. So let:
N3=t2n+1t2n…t2k+1t2k…t1t0.
What this positional notation really means is that:
N=2n+1∑i=0ti3i,
which we can rewrite as:
N=n∑k=0(t2k+132k+1+t2k32k)=n∑k=0(3t2k+1+t2k)32k=n∑k=0(3t2k+1+t2k)9k.
But now, note that for each k, 3t2k+1+t2k is precisely the base-9 digit corresponding to the consecutive pair of base-3 digits t2k+1t2k.
No comments:
Post a Comment