So to convert a number of any base to its equivalent base 10, you use the formula this one (replacing 2 with an arbitrary number representing the base). But why isn't there any mathematical formula to convert bases like 8 and 16 to base 2? I have only seen people map each digit from base 8 and 16 directly to their corresponding binary digits by looking up a table instead of using a similar smart formula. Shouldn't there be some formula that can be used instead of having to look up a table? If there simply is no such thing, why is that?
Why is there no formulas for converting other bases than 2 to decimal?
230 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
What you mean a “formula” is something a bit more complicated.
Theorem. Let $k>1$ be an integer. Then, for each natural number $v$ there exists a largest power $k^n\le v$ and a unique sequence of integers $(b_0,b_1,\dots,b_n)$, with $0\le b_i<k$ such that $$ v=\sum_{i=0}^n b_ik^i $$
Usually, one chooses different symbols for the integers in the range $[0{\,..\,}k-1]$ and represents the summation above simply by $$ \widetilde{b_n}\,\widetilde{b_{n-1}}\dots\widetilde{b_1}\,\widetilde{b_0} $$ where $\widetilde{b_i}$ denotes the chosen symbol. And, most likely, the symbols will be the ones derived from the Indo-Arabic numerals we're accustomed to for the integers from $0$ up to $9$ and possibly uppercase letters beyond those (but it's not necessarily so; some systems such as dozenal use different symbols for 10 and 11).
The theorem above makes no assumption about the representation of $v$; it just defines its $k$-adic representation (and states it exists and is unique).
The algorithm for finding the $k$-adic representation is independent on the base we start from:
- set $i=0$ and $q_0=v$
- divide $q_i$ by $k$, with quotient $q_{i+1}$ and remainder $b_i$
- if $q_{i+1}=0$, then stop; otherwise increment $i$ and go to step 2
There is a formula for any base conversion you can think of, and they all look basically the same. It's just that the most common conversion to learn in school is between binary and decimal. So that's the one everyone knows, that's the one every resource gives a formula for.
That being said, converting between, say, base 2 and base 8 or 16 is particularly easy, and not really worthy of a formula.