A question on solution 6.1-2 from CLRS

  • Context: Comp Sci 
  • Thread starter Thread starter loop quantum gravity
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 170 views
loop quantum gravity
Messages
26
Reaction score
7
Homework Statement
How to prove the following claim?

that: $m=\lfloor \log_2 n \rfloor= \lfloor \lg n \rfloor$
from $n=2m+k−1$
?

Obviously we have $m=log_2(n−k+1)$
.
$k$ is the number of leaves.
My question has arisen from the solution here: https://walkccc.me/CLRS/Chap06/6.1/ of 6.1-2.

Thanks in advance!
Relevant Equations
maybe $\lfloor x \rfloor <x \le \rfloor x \lfloor +1$, not sure how or what to use to show their claim.
How to prove the following claim?

that: $$m=\lfloor \log_2 n \rfloor= \lfloor \lg n \rfloor$$
from $$n=2m+k−1$$
?

Obviously we have $$m=log_2(n−k+1)$$
.
##k## is the number of leaves.
My question has arisen from the solution here: https://walkccc.me/CLRS/Chap06/6.1/ of 6.1-2.

Thanks in advance!
 
Last edited:
Physics news on Phys.org
A technical advice. Edit OP to replace single $ with double $ for proper Latex presentation, like

that: $$m=\lfloor \log_2 n \rfloor= \lfloor \lg n \rfloor$$
from $$n=2m+k−1$$.

You mean ##2^m## ?
 
Last edited:
anuttarasammyak said:
A technical adcvice. Edit to replace single $ with double $ for proper Latex presentation, like

that: $$m=\lfloor \log_2 n \rfloor= \lfloor \lg n \rfloor$$
from $$n=2m+k−1$$.
fixed that, thanks!