3

A binary number is a string $r_mr_{m-1} \cdots r_1r_0$ where $m \in \mathbb{N}$ and $r_i \in \{0,1\}$ for $i=0,\ldots,m$. The string represents the positive integer $r_m2^m+r_{m-1}2^{m-1}+\cdots+r_12+r_0$. Prove by induction that every positive integer is represented by some binary number.

How do I prove p(x),p(k) and p(k+1). Or Strong induction?

Hanul Jeon
  • 27,376
Arya
  • 57
  • induction on $m$ : if every integer $\in \ 0 \ldots 2^{m}-1$ are representable, then every integer $\in \ 0 \ldots 2^{m+1}-1$ too – reuns Oct 13 '16 at 02:14
  • Go via strong induction, and prove that every number in ${0,1,\dots,2^{k}-1}$ is representable. Then, show that it follows that every number in ${2^k,2^k+1,\dots,2^{k+1}-1}$ is also representable. (Hint: a number in ${2^k,2^k+1,\dots,2^{k+1}-1}$ is equal to $2^k$ plus something else smaller) – JMoravitz Oct 13 '16 at 02:15
  • Do you know how to prove that every integer has a unique decimal representation in base $10$? The same arguments work for base $2$ as well. – dxiv Oct 13 '16 at 02:42
  • https://math.stackexchange.com/questions/176678/strong-induction-proof-every-natural-number-sum-of-distinct-powers-of-2 – V.G Feb 10 '21 at 13:42

3 Answers3

3

Proof by strong induction:

Base case: 1 can be written in binary as 1

Assume that $P(n)$ is true i.e. for all $m$ such that $ 0 \leq m \leq n$, we can represent $m$ in binary.

Now consider an integer $n+1$. We need to prove that we can represent $n+1$ in binary. We can write $n+1$ as $2m$ or $2m + 1$ for some integer $m$ where $m < n$. By strong induction, we know $m$ has a binary representation $r_mr_{m-1} \cdots r_1r_0$ and so $2m$ has representation $r_mr_{m-1} \cdots r_1r_00$ and we can add either 0 or 1 to this depending on whether $n+1 = 2m$ or $n+1 = 2m+1$.

Thus if we can represent all integers less than $n+1$, we can also represent $n+1$.

gowrath
  • 3,573
  • 13
  • 31
0

Clever use of strong induction:

Asume true for $0 \le n < 2^k$:

Then we can prove it is true for $2^k \le n+ 2^k < 2^k+2^k=2^{k+1} $

by simply writing $1xxxxxx... = 2^k + xxxxx.... = 2^k+ n$ where $xxxxx.... =n $ in binary.

That's the induction step.

The base step is $0=0$ and $1=2^1-1$.

fleablood
  • 124,253
0

Prove by strong induction on n. (Note that this is the first time students will have seen strong induction, so it is important that this problem be done in an interactive way that shows them how simple induction gets stuck.) The key insight here is that if n is divisible by 2, then it is easy to get a bit string representation of (n + 1) from that of n. However, if n is not divisible by 2, then (n + 1) will be, and its binary representation will be more easily derived from that of (n + 1)/2. More formally:

• Base Case: n = 1 can be written as 1×2^0.

• Inductive Hypothesis: Assume that the statement is true for all 1 ≤ m ≤ n, where n is arbitrary.

• Inductive Step: Now, we need to consider n + 1. If n + 1 is divisible by 2, then we can apply our inductive hypothesis to (n + 1)/2 and use its representation to express n + 1 in the desired form.

(n+1)/2 = ck ·2k +ck−1 ·2k−1 +···+c1 ·21 +c0 ·20

n+1 = 2·(n+1)/2 = ck ·2k+1 +ck−1 ·2k +···+c1 ·22 +c0 ·21 +0·20.

Otherwise, n must be divisible by 2 and thus have c0 = 0. We can obtain the representation of n + 1 from n as follows: n = ck ·2k +ck−1 ·2k−1 +···+c1 ·21 +0·20

n+1 = ck ·2k +ck−1 ·2k−1 +···+c1 ·21 +1·20 Therefore, the statement is true.

Cited by UC Berkeley 2019 fall Discussion 02-a solution