How to prove $\log n$

51 Views Asked by At

$$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$

1

There are 1 best solutions below

0
On

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$.