0
$\begingroup$

use subtraction of the largest power of 2 to prove that each positive integer n can be expressed uniquely as a sum of distinct powers of 2. Also, what does this question have to do with binary notation?

I have the main proof finished, I am struggling with the uniqueness part.

  • 0
    Would you mind clarifying the question? I'm not sure I understand what you're looking for.2017-01-27
  • 0
    we have to prove that each positive integer n can be expressed uniquely as a sum of distinct powers of 2. i.e some n=2^(k1)+2^(k2)+2^(k3)..... I am however struggling with the uniqueness part.2017-01-27
  • 0
    Got it. But what do you mean by "subtraction of the largest power of 2"? And by uniqueness, do you mean that no two numbers can be expressed the same way? That's obvious - otherwise you would end up with something like 2=1. You're just asking to prove that any number can be written in binary?2017-01-27
  • 0
    subtraction of the largest power of 2: That's the way the question wants us to prove the statement. so, let nEZ, and take the largest, k1, such that 2^(k1)<=n. If n1=n-2^(k1) >0, take the largest, k2, such that 2^(k2)<=n1. If n2=n1-2^(k2)>0, take the largest, k3, such that 2^(k3)<=n2.... and so on until we get an n=0. Hence, n>n1>n2>n3... that's the first part of my proof, it ends with showing that each integer can be written as the sum of powers of 2.2017-01-27
  • 0
    I believe the binary conclusion is correct, as the question following this one asks how one can relate it to binary.2017-01-27

2 Answers 2

0

Assume you have two different representations, and consider the highest power in each of these, if they are not equal, then the lower one cannot sum up to the number (a contradiction). If they are equal, subtract the highest power off and repeat the above. Do this until you have reached a point where the powers are not equal (you have to arrive at this point by assumption), and you get the above contradiction.

  • 0
    I started off with assuming two different representations and got stuck from there. I was going down the path of divisibility by 2. i.e one would be divisible by 2 and the other wouldn't be (a contradiction). I like your idea, but am not sure how one would represent that in notation, for the equal part..2017-01-27
0

Consider the largest power of $2$ less than or equal to $n + 1$; let it be $2^k$. Then consider the number $n + 1 – 2^k$. Since $2^k\geq 1$ for any natural number $k$, we know that $n + 1 – 2^k \leq n + 1 – 1 = n$. Thus, by our inductive hypothesis, $n + 1 – 2^k$ can be written as the sum of distinct powers of two; let $S$ be the set of these powers of two. This means that $n + 1$ is equal to $2^k$ plus the sum of the powers of two in $S$.

We now need to show that these powers of two are all distinct. We know by the inductive hypothesis that all of the powers of two in $S$ are distinct, so the only way that a power of two would be repeated would be if $2^k \in S $. We show that this is impossible by contradiction; assume that $2^k \in S$. Since $2^k \in S $ and the sum of the powers of two in $S$ is $n + 1 – 2^k$, this means that $2^k \leq n + 1 –2^k$. This means that $2(2^k) \leq n + 1$, so $2^{k + 1}\leq n + 1$, contradicting the fact that $2^k$ is the largest power of two less than or equal to n + 1. We have reached a contradiction, so our assumption was wrong and $2^k \not \in S $. Thus $n + 1$ can be expressed as a sum of distinct powers of two, so $P(n + 1)$ holds, completing the induction. Hope it helps.

  • 0
    thank you for the solution, however I am suppose to answer the proof by the use of subtraction (not induction).2017-01-28