0

The best proof that I came with is, given any base $b$, let $c$ be the greatest number can be written whit $n$ digits.

Then the number will be:

$$c=b^0(b-1)+b^1(b-1)+\cdots +b^n(b-1)$$

Summing this number twice, I'll get the maximum possible carry, this being:

$$b^n+b^n(b-1)+b^n(b-1) = -b^n+2b^{n+1}= b^n(b-1)+b^{n+1}$$

This is, only carry one.

I thing it's not a very sound proof, any suggestions?

FranckN
  • 1,304

2 Answers2

1

It'd do this by induction. Let $d_n\ldots d_0$, $e_n\ldots e_0$ be the two numbers in base $b$.

For the right-most digit, as you say, the worst case is $d_0=e_0=b-1$, and you get $$ a_0 + b_0 = (b-1) + (b-1) = 2b -2 = 1\cdot \mathbf{b^1} + (b-2)\cdot \mathbf{b^0} \text{,} $$ i.e. the carry $c_0=1$.

For the $n$-th digit, the worst case is $d_n=e_n=b-1$ and carry $c_n=1$ (per the induction hypothesis), and you get $$ a_n + b_n + c_n = (b-1)+(b-1) + 1= 2b - 1 = 1\cdot \mathbf{b^1} + (b-1)\cdot \mathbf{b^0} \text{,} $$ i.e. again the carry $c_{n+1}=1$.

fgp
  • 21,050
0

You should not assume tha ttwo specific numbers are added. Even if it is "obviously" the worst case, you should show the general result. When adding $x_0+x_1b+x_2b^2+\ldots $ and $y_0+y_1b+y_2b^2+\ldots $, the computation for the $k$th digitgoes like $z_k+c_kb=x_k+y_k+c_{k-1}$, where $c_{k-1}$ is the previous and $c_k$ the new carry. Show by induction that $c_k\in\{0,1\}$. Indeed, this is trivially true for $k=-1$ as this initial carry is understood to be zero. Then in the induction step, $0\le x_k\le b-1$, $0\le y_k\le b-1$, and by hypothesis $0\le c_{k-1}\le 1$ hence $0\le x_k+y_k+c_{k-1}\le 2b-1$ and finally $0\le c_k\le 1$.