Simple proof that $\lfloor \log_2 k \rfloor + 1 = \lceil \log_2 (k + 1) \rceil$

545 Views Asked by At

Is there any way to show for $k \in \mathbb{N}$ $$\lfloor \log_2 k \rfloor + 1 = \lceil \log_2 (k + 1) \rceil$$

without casework, or of little of it as possible? I've tested it for some integers and I noticed that both sides seem to "transition" at the same point-- when $k$ is around powers of $2$ - but I don't know if I can explain it elegantly.

1

There are 1 best solutions below

0
On BEST ANSWER

For $k\in\mathbb{N}$, $$\left\lfloor\log_2 k\right\rfloor=m \iff 2^m\le k<2^{m+1} \iff 2^m<k+1\le 2^{m+1} \iff \left\lceil\log_2(k+1)\right\rceil=m+1.$$

Note that this works "for any value of $2$", i.e. for any integer base $b>1$, not just $2$.