NOT b + 1, with the leading bit being a sign bit. In general, prove that applying the operation NOT b + 1 twice to some n-bit binary number yields the original number b.I found this conceptually straightforward but hard to satisfactorily prove. Try it yourself.
b + NOT b = 1-1 (Ones' complement).
Therefore 1 + NOT b = b-1. (b-1)-1 = b.
(b-1 denotes additive inverse.)
1+NOT(y) ≡ −y ≡ x (mod ##2^n##).
Or even better:
T(x)=1+NOT(x) ≡ −x (mod ## 2^n##)
T(T(x)) ≡ −(−x) ≡ x (mod ## 2^n##)
For any n bit number b, NOT b changes every 0 to 1 and every 1 to 0. Numerically, that means NOT b = 2^n - 1 - b.
So 1 + NOT b = 2^n - b, which is equivalent to -b modulo 2^n. In other words, NOT b + 1 gives you the additive inverse of b.
Now apply the same operation again. Since the additive inverse of -b is b, we get 1 + NOT(1 + NOT b) = b modulo 2^n.
So taking the two's complement twice always gives you the original n bit number.
## \begin{align}
f(x)=1+\text{NOT}x&\implies f(x)-1=\text{NOT}x\nonumber\\
&\implies \text{NOT}(f(x)-1)=x\nonumber\\
&\implies f^{-1}(x)=\text{NOT}(x-1)\nonumber\\
\end{align} ##
For
$$ x=(\sum_{i=0}^{n}x_i10^i)_2 $$
where
## \begin{align}
\text{NOT}x&=(\sum_{i=0}^{n}(1-x_i)10^i)_2\nonumber\\
&=(\sum_{i=0}^{n}1\cdot10^i-\sum_{i=0}^{n}x_i10^i)_2\nonumber\\
\end{align}\\ ##
we have
## \begin{align}
f(x)&=1+\text{NOT}x\nonumber\\
&=(1+(\sum_{i=0}^{n}1\cdot10^i-\sum_{i=0}^{n}x_i10^i))_2\nonumber\\
&=(\sum_{i=0}^{n}1\cdot10^i-(\sum_{i=0}^{n}x_i10^i-1))_2\nonumber\\
&=\text{NOT}(x-1)\nonumber\\
&=f^{-1}(x)\nonumber\\
\end{align}\\ ##
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Is this proof "by contradiction" or "by contrapositive"? | 0 | 7.66 | 12-05-2026 |
| 2 | Interesting math problem that I saw on-line | 0 | 24.29 | 06-10-2026 |
| 3 | Why should we need to re-prove theorems that have been proved already? | 0 | 18.33 | 29-05-2026 |
| 4 | What if 0 is special? | 0 | 10 | 16-09-2026 |
| 5 | Understanding the Reasoning Behind Basic Algebra | 0 | 10 | 24-09-2026 |
| 6 | 0 | 0 | 01-01-1970 | |
| 7 | 0 | 0 | 01-01-1970 | |
| 8 | 0 | 0 | 01-01-1970 | |
| 9 | 0 | 0 | 30-09-2026 | |
| 10 | test | 0 | 10 | 02-10-2026 |