简体   繁体   English

大O表示法和多项式?

[英]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: 使用Big-O的定义,证明以下内容:

  1. T(n) = 2n + 3 ∈ O(n) T(n)= 2n + 3∈O(n)
  2. T(n) = 5n + 1 ∈ O(n 2 ) T(n)= 5n +1∈O(n 2
  3. T(n) = 4n 2 + 2n + 3 ∈ O(n 2 ) 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 . 如果≤b,则对于任意的n≥1中,n A≤Ñ

As an example, here's how you could approach the first of these: If n ≥ 1, then 2n + 3 ≤ 2n + 3n = 5n. 例如,以下是您如何处理其中的第一个方法:如果n≥1,则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. 因此,如果取n 0 = 1且c = 5,则对于任何n≥n 0都具有2n + 3≤5n。 Therefore, 2n + 3 = O(n). 因此,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. 对于第二个问题,您可能需要使用两次-一次使用具有某些线性函数的上限5n +1,而另一次使用具有二次函数的该线性函数的上限。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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