12

I have been asked to prove that for any integer base $b \geqslant 2$, every natural number has a unique base $b$ representation. I am not sure if this has been answered somewhere already, but I could not find a general answer that can be applied to any base.

Would the division algorithm apply here? I know that it would serve to give every number a unique quotient and remainder, but I'm not sure how exactly to craft the proof. I appreciate any input, thanks in advance!!

Joffan
  • 40,356
liveFreeOrπHard
  • 494
  • 5
  • 16
  • 2
    They are only ensured to be unique with the extra constraint that the digits are in the span $0\leq a_k < b$, so that is probably what we want to prove, since it is not true otherwise. – mathreadler Mar 06 '17 at 15:54
  • 2
    Example where it is not true (when you relax mentioned constraint) is if you want something to be able to store a ternary number using blocks of 2bits, The number 101 (10dec or 010001) can also be written 31 ( 1101 ) by using the extra state of the 2bit number.. – mathreadler Mar 06 '17 at 15:58
  • @mathreadler I did not follow? Meaning there is a case where you cannot represent every number uniquely in a given base? – Sam Nov 06 '22 at 03:13
  • @Sam this question is more than 5 years old. Certainly some details have been lost along the way. Andreas Carantis answer below is good, it explains it well enough as I would have. Back in time when I commented someone had forgotten the constraint $0\leq a_i < b$. It is easy to show that numbers will not be uniquely represented in an exponential position system if this constraint is removed. – mathreadler Nov 06 '22 at 05:53

5 Answers5

16

Let $N$ be a natural number. You want to write it as $$ N = a_{0} + a_{1} b + a_{2} b^{2} + \dots + a_{k} b^{k} $$ for a suitable $k$, and $0 \le a_{i} < b$.

Now rewrite the above as $$ \begin{cases} N = a_{0} + q b,\\ 0 \le a_{0} < b \end{cases}$$ to see that $a_{0}$ is uniquely determined as the remainder of the division of $N$ by $b$.

Now consider $$ q = a_{1} + a_{2} b + \dots + a_{k} b^{k-1} $$ and repeat, that is, use induction.

  • @liveFreeOrπHard, thx. – Andreas Caranti Apr 04 '17 at 07:24
  • I have a follow-up question about a possible corollary of this, could you please take a look? https://math.stackexchange.com/questions/3153197/does-sum-i-1n-nk-i-determines-k-1-k-n – sam wolfe Jul 19 '22 at 12:26
  • @samwolfe it seems in the meantime you have already received a satisfactory answer. – Andreas Caranti Jul 19 '22 at 12:58
  • yes, thank you anyway! – sam wolfe Jul 19 '22 at 13:31
  • Hi Prof. Caranti, sorry to dredge up an old answer but I figured this was better than writing up a new question. To confirm, this is just a uniqueness proof right? Don't we need to show existence as well? Would it be possible to comment on how one does that? – EE18 Sep 19 '23 at 21:03
  • 1
    @EE18, you are right that my argument may appear to assume that such a representation exists. However, read it as an algorithm that computes a sequence $0 \le a_i < b$ such that $a \equiv a_0 + a_1 b + \dots + a_k b^k \pmod{b^{k+1}}$ for all $k$. When $p^{k+1} > a$, you get $a = a_0 + a_1 b + \dots + a_k b^k$. – Andreas Caranti Sep 21 '23 at 05:05
  • I think I see. Thanks very much for your time! – EE18 Sep 21 '23 at 12:13
5

Below we show uniqueness of radix rep is a special (integer root) case of the Rational Root Test.

If $\,g(x) = \sum g_i \:\! x^i$ is a polynomial with integer coefficients $\,g_i\,$ with $\,0\le g_i < b\,$ and $\,g(b) = n\,$ then we call $\,(g,b)\,$ a radix $\,b\,$ representation of $\,n.\,$ It is unique: $ $ if $\,n\,$ has another rep $\,(h,b)\,$ with $\,g \ne h,\,$ then $\,f := g-h\ne 0\,$ has root $\,b\,$ and all coefficients $\,\color{#c00}{|f_i| < b},\,$ contra the below slight generalization of: $ $ integer roots of integer coef poly's $f(x)\in\Bbb Z[x]$ divide its constant term $\color{#0a0}{f(0)}\,$ [an obvious special case of the Rational Root Test].

Theorem $ $ If $\,f(x) = x^k(\color{#0a0}{f_0}\!+f_1 x +\cdots + f_n x^n)=x^k\bar f(x)\,$ is a polynomial with integer coefficients $\,f_i\,$ and with $\,\color{#0a0}{f_0\ne 0}\,$ then an integer root $\,b\ne 0\,$ satisfies $\,b\mid f_0,\,$ so $\,\color{#c00}{|b| \le |f_0|}$

Proof $\ \ 0 = f(b) = b^k \bar f(b)\overset{\large b\,\ne\, 0}\Longrightarrow\:\! 0 = \bar f(b),\,$ so subtracting $\,f_0\,$ from both sides yields $$\color{#0af}{-f_0 =\, b}\,(f_1\!+f_2 b+\,\cdots+f_n b^{n-1})\, \Rightarrow\,\color{#0af}{b\mid f_0} \underset{\large \color{#0a0}{f_0\,\ne\, 0}}\Longrightarrow\, |b| \le |f_0|\quad\small {\bf QED}$$


Remark $ $ This is very closely related to the common proof using the uniqueness of the remainder (e.g. as in Andreas's answer) since the key result that the above proof depends on is this property: if $\,\color{#c00}{0\le g_i,h_i < b}\,$ then $\,h_i\neq g_i\Rightarrow b\nmid h_i-g_i ,\,$ i.e. remainders $\!\bmod b\,$ are unique (proof here).

In modular arithmetic language the key inference is

$$g_i\:\! b^i \equiv h_i\:\! b^i\!\!\!\!\pmod{\!b^{i+1}}\!\!\underset{{\rm cancel}\ \large b^{\large i}}\Longrightarrow g_i\equiv h_i\!\!\!\!\pmod{\!b}\ \ \color{#c00}{\rm so}\ \ g_i = h_i\qquad\qquad$$

Bill Dubuque
  • 282,220
  • It is interesting to see how expanding the 'theoretical reach' into something a bit more general (and abstract) makes the proof collapse into a couple of lines. The splitting off / isolation of $x^k$ is so simple - and funny when $k = 0$, but works great for nonzero roots. – CopyPasteIt May 29 '19 at 18:27
  • 1
    Is this proof well known or is this the 'place to go'. – CopyPasteIt May 29 '19 at 18:29
  • @CopyPasteIt It's so simple that almost surely it is published somewhere. But I have no link. – Bill Dubuque May 29 '19 at 18:34
4

Let two representations of a number be such that they differ in the $k^{th}$ digit ($k$ zero-based, from the right).

Then

$$(n\text{ div } b^k)\bmod b$$

has different values for these two representation, which is contradictory ($\text{div}$ denotes integer division).

4

The OP asked

Would the division algorithm apply here?

Here we provide, working in the natural numbers $\Bbb N =\{0,1,2,\dots\}$, a proof of uniqueness that doesn't use full blown Euclidean division; we only need the following weaker result.

Lemma 1: Let $b,k,h,r \in \Bbb N$ satisfy

$$\tag 1 kb = hb + r \; \text{ with } r \lt b$$

Then $k = h$ and $r = 0$.
Proof
If $k \lt h$ then $kb \lt hb \le hb + r$, so $\text{(1)}$ is false.
If $k \ge h$ then write $k = h + u$ with $u \ge 0$. Substituting into $\text{(1)}$,

$$ kb = (h + u)b = hb + ub = hb + r $$

so it must be true that $ub = r$. If $u \ge 1$, $\; ub \ge b$ and that can't happen since $r \lt b$. So $u = 0$ and $k = h$, and substituting into $\text{(1)}$,

$$\quad hb = hb + r $$

and so $r = 0$. $\quad \blacksquare$

Note: You can use an alternate proof for lemma 1: If both $k$ and $h$ are greater than $0$ they both have a predecessor, and lemma 1 is equivalent to the statement obtained by replacing both both $k$ and $h$ with these smaller numbers. So there is a 'truth chain' allowing us to assume that $k=0$ or $h=0$.
If $k = 0$ both $h$ and $r$ must be $0$.
If $h = 0$ then we have $r = kb$. If $k \ge 1$ then $r \ge b$ but that can't happen since $r$ is assumed to be less than $b$. So $k = h = r = 0$.

Let $b \ge 2$.

Theorem 2: Let a number $n \ge 0$ have two $\text{Base-b}$ representations $x$ and $y$. Then, using Capital sigma notation with $0\text{-padding}$ if necessary, we can express the equality of these two representations by writing

$$ \tag 2 \sum_{i=0}^k x_i b^i = \sum_{i=0}^k y_i b^i \; \text{ with the coefficients } x_i \text{ and } y_i \text{ all between } 0 \text{ and } b-1$$

Then if $j \in \{i \, | \, 0 \le i \le k\}$, $\;x_j = y_j$, i.e. the coefficients are all equal.
Proof
If the two families $(x_i)$ and $(y_i)$ are not identical, let $j$ be the first integer where $x_j \ne y_j$. Cancelling the initial (if any) equal terms from both sides of equation $\text{(2)}$, there would remain

$$ \tag 3 \sum_{i=j}^k x_i b^i = \sum_{i=j}^k y_i b^i $$

Assume that $x_j \gt y_j$ with $x_j = y_j + u$. Cancelling the $y_jb^j$ term from each side of $\text{(3)}$ allows us to write

$$ \tag 4 ub^j + \sum_{i={j+1}}^k x_i b^i = \sum_{i={j+1}}^k y_i b^i \text{ with } 0 \lt u \lt b$$

since it must be true that $k \ge j+1$. But then, by factoring out $b^j$ and using algebra, we can write

$$ \tag 5 u + kb = hb$$

for some numbers $k$ and $h$. Since $u \lt b$, applying lemma 1 we must conclude that $u = 0$. But that can't happen since we assumed that $x_j \ne x_j$.

The reductio ad absurdum argument is constructed in a like manner when $y_j \gt x_j$.

So assuming that $x_j \ne y_j$ leads to a contradiction.$\quad \blacksquare$


BONUS MATERIAL

We can also prove the existence of $\text{Base-b}$ representations without using Euclidean division (see this). It is an easy exercise to show that the existence of $\text{Base-b}$ representations can be used to demonstrate the existence part of the Euclidean division theorem.

Exercise: Prove the uniqueness part of the Euclidean division theorem using lemma 1.
Hint: Use the same technique used in theorem 2, taking the difference $u$ between two numbers,

CopyPasteIt
  • 11,870
  • But how could you assume ∈{|0≤≤} , =?! I thought the whole point is that they don't use the same numbers... Meaning the original question (as I understood it) asked to prove that there cannot exist two representations of a number in a given base, regardless of the order of the coefficients. It seems to me that you effectively proved that "xyz" must equal "xyz" for any given x, y, and z (e.g. 123 = 123) -- which is a tautology. If your abovementioned constraint would not be satisfied, would this be a valid proof? Would it be a true statement? – Sam Nov 06 '22 at 03:22
2

Here is an argument that works using generating functions. The coefficient of $x^m$ in the generating function needs to count the number of ways of writing $m$ as $$ m=a_0+a_1n+a_2n^2+\cdots+a_ln^l,\quad0\leq a_i\leq n-1$$ This generating function is $$(1+x+\cdots+x^{n-1})(1+x^n+\cdots+x^{(n-1)n})\cdots(1+x^{n^l}+\cdots+x^{(n-1)n^l})\cdots$$ Each factor is a geometric sum, therefore $$1+x^{n^l}+x^{2n^l}+\cdots+x^{(n-1)n^l}=\frac{1-(x^{n^l})^n}{1-x^{n^l}}=\frac{1-x^{n^{l+1}}}{1-x^{n^l}}$$ Therefore the generating function is $$\prod_{l=0}^\infty\frac{1-x^{n^{l+1}}}{1-x^{n^l}}=\frac{1-x^n}{1-x}\cdot\frac{1-x^{n^2}}{1-x^n}\cdot\frac{1-x^{n^3}}{1-x^{n^2}}\cdots=\frac{1}{1-x}=1+x+x^2+x^3+\cdots$$ This shows that there is a unique representation of $m$ in base $n$.

Mec
  • 5,621
  • Concerning your post from Feb 3, 2025 asking about a proof of a Stirling number identity from French Wikipedia, I proved it and it was an interesting exercise. Maybe you should add your attempts at a proof and re-open the question. I would then post my proof. Good luck. – Marko Riedel Feb 04 '25 at 00:29
  • @MarkoRiedel: I reopened the question. The only thing I tried was reading the paper that I mentioned in the new edit. I could not really follow it. I would be very interested in reading your proof. – Mec Apr 03 '25 at 20:57