How do I calculate the Time Complexity of a polynomial within a square root?

283 Views Asked by At

So say I have the following polynomial $F(n)=\sqrt{5n^2+7n-13}$ and I want to calculate it's upper and lower bounds ($O(n)$ and $\Omega(n)$), as well as the overall complexity $\Theta(n)$. What is the general process for doing so if there is a square root? I know for a normal polynomial I am proving for example $f=O(g)$ & $f=\Omega(g)$ by using the $c$ and setting $n_0 = 1$ in order to prove the inequalities. However when it comes down to having a square root, I'm at a loss of where/how to start. My initial thoughts are I have to use $g(n)=\sqrt(n^2)$ but at second look that doesn't make a whole lot of sense to me? Can anyone point me in the right direction?

2

There are 2 best solutions below

5
On BEST ANSWER

Notice that $\sqrt{5n^2+7n-13}=\sqrt{5}n\sqrt{1+\frac{7}{5n}-\frac{13}{5n^2}}$ and that $\lim\sqrt{1+\frac{7}{5n}-\frac{13}{5n^2}}=1$ as $n\to\infty$, so asymptotically the function grows as $\sqrt{5}n$.

0
On

Intuitively, when $n$ is very large the first term dominates over the other two, so $F(n)\approx \sqrt{5n^2}=n\sqrt 5$. We don't care about multiplicative constants, so $F(n) \in \Theta(n)$. You can make this more precise if you want by dividing the $n$ out of the square root and seeing that the other terms have factors of $\frac 1n$