[英]How to find upper bound of function
How to find the upper bound (Big O) for f(n) = 2n^3-2n^2. 如何找到f(n)= 2n ^ 3-2n ^ 2的上限(Big O)。 Want to know the C and n.
想知道C和n。
I tried below. 我在下面尝试过。
f(n)<=C*g(n) F(N)<= C * G(N)
2n^3-2n^2 <= C*n^3 2n ^ 3-2n ^ 2 <= C * n ^ 3
My understanding of finding "C" is, consider only higher polynomial degree. 我对找到“ C”的理解是,仅考虑更高的多项式。 So..
所以..
2n^3 <= C*n^3 ---> (omitted 2n^2) 2n ^ 3 <= C * n ^ 3 --->(省略2n ^ 2)
But the answer given in my book is C = 2. 但是我书中给出的答案是C = 2。
question 1: Please clarify how C will be 2. 问题1:请说明C的大小为2。
question 2: how to find the value of n. 问题2:如何找到n的值。
The inequality you have to prove is: 您必须证明的不平等是:
2n^3-2n^2 <= C*n^3 for all n >= n0.
Actually, any C >= 2 works. 实际上,任何C> = 2都可以。 n0 in this case can be taken to anything >= 0.
在这种情况下,n0可以取> = 0的任何值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.