How can I demonstrate that the decimal equivalent for a binary number consisting of $n$ $1$'s is $2^n-1$?

74 Views Asked by At

I know that $2^n-1$ gives you the decimal equivalent for any word consisting of $n$ $1$'s, but how can I demonstrate that in general terms for any word of $n$ $1$'s?

2

There are 2 best solutions below

0
On

Sum the implicit geometric series:

$$\underbrace{111\ldots111}_n=\sum_{k=0}^{n-1}2^k=\;?$$

0
On

Hint: what is the result if you add $1$ to any such word? What does that tell you?