Prove that running time T(n)=$(n + a)^b$ is $O(n^b)$ with a and b > 0

40 Views Asked by At

Image of the question

I'm studying asymptotic notation, but i'm stuck at this question, can anyone help me?

3

There are 3 best solutions below

0
On BEST ANSWER

$$T(n)=(n + a)^b \leqslant (n + n)^b=2^bn^b$$ when $\lfloor a \rfloor+1<n$, so we can take any $C\geqslant n^b$ and $N=\lfloor a \rfloor+1$.

10
On

By definition of $O(n^b)$ we need to show that it exists a constant $C>0$ such that $(n+a)^b \leq Cn^b$. (There should be absolute values, but assuming $a\geq0$ you don't need them; if $a<0$ the problem is trivial with $C=1$)

Now, can $f$ defined as $f(x) = \frac{(x+a)^b}{x^b}$ be unbounded as a function from $[1,+\infty)$ to $\mathbb{R}$?

2
On

To prove it, show: $$ \lim_{n \to \infty} \frac{(n+a)^b}{n^b} = 1 $$