$\lfloor\log_2(x)\rfloor + 1 \ \neq \lceil\log_2(x)\rceil?$

133 Views Asked by At

Is there any case where $$\lfloor\log_2(x)\rfloor + 1 \ \neq \lceil\log_2(x)\rceil ?$$

I'm in discrete mathematics, and my teacher stated the former formula to be finding how many bits are needed to represent some number $x$.

I asked him what the difference between the former and latter was, and he said something in regards to boundaries but I didn't have time to ask further.

1

There are 1 best solutions below

2
On BEST ANSWER

Hint For integers $n$, by definition we have $$\lfloor n \rfloor = \lceil n \rceil.$$