大O符号帮助,困惑

时间:2014-12-04 19:59:35

标签: algorithm math big-o complexity-theory notation

我有这个问题,证明或反驳

F(n)=10n^3+3n
g(n)=5n^2

这就是我尝试过的东西

k=1
n>1
F(n)/g(n)=(10n^3+3n/5n^2)<(10n^3+3n^2/5n^2)=13/5

因此

10n^3+3n<=13/5(5n^2)
10n^3+3n<=13n^2n when n>1

这是对的吗?

1 个答案:

答案 0 :(得分:0)

鉴于条件n>1,我没有必要计算k的值。

另外,F(n)> G(n)表示n>1的所有值。

您的步骤似乎不正确

for `n>1`, F(n)/g(n)=(10n^3+3n/5n^2) < (10n^3+3n^2/5n^2) = `10n+3`
// still dependent on n and as n>1, so the function is greater

所以,下一步也是错误的。

10n^3+3n <= (10n+3) * (5n^2)  // correct it as per what I've mentioned

因此,(5n^2)乘以(10n+3)大于10n^3+3n;但是,对于n> 1的所有值,5n^2总是小于(10n^3+3n)

最后一步,你的结论应该是

10n^3+3n <= (10n+3) * (5n^2) when n>1
         <= (50n^3+15n^2) when n>1

最后,F(n)= 10n ^ 3 + 3n&amp;&amp; G(N)= 5N ^ 2               = O(n ^ 3)&amp;&amp; = O(N ^ 2)

因此,G(n) = O(F(n)),但是,逆转不可能是真的......

// as upper bound can be considered and inflated as much in powers of n