1
$\begingroup$

Suppose that $a_n=O(n)$ and $b_n=O(n^2)$. Let $c_n=a_n-b_n$.

Prove that $c_n=O(n^2)$ and not necessarily $c_n=O(n)$

$$u_n=O(v_n)\Leftrightarrow \exists L\geq0, \exists \overline n, \forall n>\overline n;|u_n|\geq L|v_n| $$

I came up with:

1)Let $L_1,L_2\geq0$

$$|c_n|=|a_n-b_n|\leq|a_n|+|b_n|=L_1\cdot n+L_2\cdot n^2$$

Let $L_3=max\{L_1,L_2\}$. then:

$$|c_n|\leq L_3(n+n^2)$$

\end

And I have no idea what to do with this(because I should get $c_n\leq L_3(n^2)$)

$\endgroup$
2
$\begingroup$

Note that $n+n^2=n(n+1)\leq n\cdot 2n=2n^2$. Now let $L_4=2L_3$, and you're done.

As for $c_n$ not necessarily being $O(n)$, think about what happens if $a_n=0$ and $b_n=n^2$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.