Help with equation that uses floor and ceiling functions

499 Views Asked by At

I have this equation and I've been stuck with it for a couple of hours.

$\lfloor\log_2x\rfloor + 1 = \lceil\log_2(x+1)\rceil$

I've tried using this ceiling property:

$\lceil x\rceil = n \Leftarrow\Rightarrow x\le n\lt x+1$

Which gives me:

$\log_2(x+1)\le\lfloor\log_2x\rfloor + 1 \lt \log_2(x+1)+1$

But then, if I try to use the equivalent property for the floor function or try with the integer floor(x) + fractional part I get confused and I don't know how to proceed.

Thanks for your help!

1

There are 1 best solutions below

1
On BEST ANSWER

A good place to start is to observe that $\lfloor \log_2 x \rfloor +1=\lceil \log_2 x \rceil$ unless $x$ is a power of $2$ and that $\lceil \log_2 x \rceil=\lceil \log_2 (x+1) \rceil$ unless ???