how far $2k+log_2(k+1)$ is to $k+log_2(k)$

54 Views Asked by At

Given two functions $f(k)=2k+log_2(k+1)$ and $f'(k)=k+log_2(k)$, I am wondering how far $f(k)$ is to $f'(k)$ in asymptotic notation. If $k$ is large then $log_2(k)\approx log_2(k+1)$ and $f(k)=f'(k)+k$. Does that mean $f(k)$ is $O(k)$ far from $f'(k)$ ?

I assume $f(x)$ being $O(k)$ far from $f'(k)$ means $f'(k)$ should be multiplied (not summed) by $k$. IF that's true then is it $O(1)$?

1

There are 1 best solutions below

0
On

I think what you really want to say is that $f(k)−f′(k)=Θ(k)$, which is indeed true, since $f(k)−f′(k)=k+\log_2(k+1)−\log_2(k)$, hence $k \leq f(k)−f′(k)≤k+\frac{1}{k \ln(2)}$ (using concavity of the logarithm). If you are instead talking about ratios, then $\frac{f(k)}{f'(k)}=\Theta(1)$. (If you don't recognize the notation, look up Big Theta notation, it is a variant of Big Oh notation which is more precise.)