I am using the lecture notes here on page 19 (Algorithm Notes 1) example 1 is the inductive proof of
$\log(n) = O(n)$.
I understand the base case but I don't understand the rest of the example.
Example: $\log(n) = O(n)$. Claim: For all $n \geq 1$, $\log(n) \leq n$. The proof is by induction on $n$. The claim is trivially true for $n=1$, since $0<1$.
Now suppose $n\geq 1$ and $\log(n) \leq n$. Then $$ \log(n+1) \\ \leq \log(2n) \\ = \log(n) + 1 \\ \leq n+1 \quad \text{by the inductive hypothesis}.$$
I need help understanding how
$\log(n + 1) \leq \log(2n)$.
I don't get where the $\log(2n)$ came from.
Best Answer
$n + 1 \le 2n \implies \log(n+1) \le \log(2n)$