简体   繁体   中英

Big-O notation and polynomials?

So I have this problem to do and I am not really sure where to start:

Using the definition of Big-O, prove the following:

  1. T(n) = 2n + 3 ∈ O(n)
  2. T(n) = 5n + 1 ∈ O(n 2 )
  3. T(n) = 4n 2 + 2n + 3 ∈ O(n 2 )

if anyone can point me in the right direction (you don't necessarily have to give me the exact answers), I would greatly appreciate it.

You can use the same trick to solve all of these problems. As a hint, use the fact that

If a ≤ b, then for any n ≥ 1, n a ≤ n b .

As an example, here's how you could approach the first of these: If n ≥ 1, then 2n + 3 ≤ 2n + 3n = 5n. Therefore, if you take n 0 = 1 and c = 5, you have that for any n ≥ n 0 that 2n + 3 ≤ 5n. Therefore, 2n + 3 = O(n).

Try using a similar approach to solve the other problems. For the second problem, you might want to use it twice - once to upper-bound 5n + 1 with some linear function, and once more to upper bound that linear function with some quadratic function.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM