Sign up with your email address to be the first to know about new products, VIP offers, blog features & more.

Intuition behind converting a number of base n to decimal

Note: This was written as an answer to a Quora question asking: What is an intuitive explanation as to why we multiply with increasing powers of n when converting a number from base n to base 10?

Let us use an example number 436 written in base 8, which we want to convert to decimal form in order to understand this intuitively. We basically want to know which-th number is 436 in octal, or in other words, how many numbers are smaller than 436 in octal. Because, we reach 436 only after having used up digits for all the smaller numbers possible.

There are three places in this number, let us call them L, C, R (left, centre, right).

Certainly, all numbers with 0, 1, 2, 3 at L place are smaller than 436. This means we can fill the C and R with any possible digits. There are 8 digits to be used at C and R places, but 4 digits to be used at L place. But the number can’t be 000. So, the number of numbers smaller than 436 that we know by now are 4 × 8 × 8 – 1.

But, did we count all numbers smaller than 436? No, we have yet to count the numbers which have 4 at L place but are smaller than 436. Numbers of the form 40x, 41x, 42x are most certainly smaller than 436. These numbers would have eight possible digits at R place. So the number of such numbers is 3 × 8 (3 for C place, and 8 for R place).

But, we have not yet counted the numbers with form 43x which are smaller than 436. The number of these numbers is 6 (i.e. 430, 431, 432, 433, 434, 435).

So, the total number of numbers smaller than 436 in base 8 is:

4 × 8 × 8 – 1 + 3 × 8 + 6

Note that this is not the decimal equivalent itself. This is the number of octal numbers smaller than 436. So, the decimal equivalent of the octal 436 must add one to this, which makes it 4 × 8 × 8 + 3 × 8 + 6.

There’s your answer. There can be a general approach too using variables, but I hope this is intuitive enough.

No Comments Yet.

What do you think?

Your email address will not be published. Required fields are marked *