$$n, \frac n2,\frac n4,\frac n8,\frac n{16}\dots 1$$
In this series $n$ to $1$, there are $x$ number of steps.
Then how to prove (Can we prove?)
$\log_2 n = x$
$$n, \frac n2,\frac n4,\frac n8,\frac n{16}\dots 1$$
In this series $n$ to $1$, there are $x$ number of steps.
Then how to prove (Can we prove?)
$\log_2 n = x$
Copyright © 2021 JogjaFile Inc.
It’s clear that after $k$ steps you have $\dfrac{n}{2^k}$; when $\dfrac{n}{2^k}=1$, clearly $n=2^k$. Now just take logs base $2$.