Number in binary as a product

178 Views Asked by At

I agree that any binary number that consists of $n$ ones (and no zeros) has as its decimal equivalent the number $2^n - 1$. However, the author of the book I'm reading next makes the following claim, which I don't quite see. He says that as a consequence of the fact above, it follows that any binary number that has the form of starting with $n$ ones and ending with $n - 1$ zeros (with nothing between them) has as its decimal equivalent the number $2^{n - 1}(2^n - 1)$. For example, the decimal number 496 in binary is 111110000, which consists of five 1s followed by four 0s, so $496 = 2^4 \times (2^5 - 1) = 16 \times 31$. But why is this true, i.e. why does it work?

2

There are 2 best solutions below

0
On BEST ANSWER

Since your binary number starts with $n$ ones followed by $n-1$ zeros, the number has $n+(n-1) = 2n-1$ binary digits. Therefore its decimal value is $$ \begin{align} & 0 \times 2^{0} + 0 \times 2^{1} + \cdots + 0 \times 2^{n-2} + 1 \times 2^{n-1} + 1 \times 2^{n} + 1 \times 2^{n+1} + \cdots + 1 \times 2^{2n-3} + 1 \times 2^{2n-2} \\ &= 2^{n-1} \left( 1 + 2 + 2^2 + \cdots + 2^{n-2 } + 2^{n-1} \right) \\ &= 2^{n-1} \frac{1 - 2^n }{1 - 2 } \\ &= 2^{n-1} \frac{2^n - 1 }{2-1} \\ &= 2^{n-1} \left( 2^n-1 \right). \end{align} $$

0
On

Maybe it is easy to see in base$10$: $$999990000 = 99999\times 10^4=(10^5-1)10^4$$ In base$2$: $$(111110000)_2 = (11111)_2\times 2^4=(2^5-1)2^4$$


If you're not comfortable with base2, change it to base10:
$$\begin{align}(111110000)_2 &= 0+0+0+0+2^4+2^5+2^6+2^7+2^8 \\ &= 2^4(1+2+2^2+2^3+2^4) \\ &= 2^4(2^5-1) \end{align}$$