How to solve:$\sum\limits_{i=0}^{x-1} {2^i} = N$ e.g. if N=15, then x=4.
How to solve:$\sum\limits_{i=0}^{x-1} {2^i} = N$
57 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
Using the formulae for geometric series summation,$$\begin{align} & \sum\limits_{i=0}^{x-1} {2^i} = N \\ \implies & 2^0+\ldots +2^{x-2}+2^{x-1} = N \\ \implies & 2^0\cdot\frac{2^x-1}{2-1}=N \\ \implies & 2^x-1=N \\ \implies & \color{blue}{x=\log_2 (N+1)}\end{align}$$
EDIT: In step-$2$, we have used the following theory:
For ${\displaystyle} r\neq 1$, the sum of the first n terms of a geometric series is
$${\displaystyle} a+ar+ar^{2}+ar^{3}+\cdots +ar^{n-1}=\sum _{k=0}^{n-1}ar^{k}=a\,{\frac {1-r^{n}}{1-r}}$$ where $a$ is the first term of the series, and $r$ is the common ratio. We can derive this formula as follows:
$${\displaystyle} {\begin{aligned}s&=a+ar+ar^{2}+ar^{3}+\cdots +ar^{n-1},\\rs&=ar+ar^{2}+ar^{3}+ar^{4}+\cdots +ar^{n},\\s-rs&=a-ar^{n},\\s(1-r)&=a(1-r^{n}),\end{aligned}}$$ So,
$${\displaystyle} s=a\cdot {\frac {1-r^{n}}{1-r}}\quad {\text{(if }}r\neq 1{\text{)}}.$$
Let's look at what the sum is, indicating term by term. The first ones are
$$S = 1 + 2 + 4 + 8 + 16 + 32 + 64 + \ldots + 2^{x-1}$$
$$S = 1 + 2(1 + 2 + 4 + 8 + \ldots + 2^{x-2})$$
$$S = 1 + 2\left(S - 2^{x-1}\right)$$
$$S = 1 + 2S - 2^x$$
$$S - 2S = 1 - 2^x$$
$$S = 2^x - 1$$
Hence your sum is equal to $2^x-1$
Which means
$$2^x - 1 = N$$
Taking the log base 2
$$\log_2(2^x) = \log_2(N+1)$$
$$\boxed{x = \log_2(N+1)}$$