开发者

Big Oh (Induction Proof)

开发者 https://www.devze.com 2023-01-28 09:32 出处:网络
If f(n) = 15n^3 + 7n^2 + 34 & g(n) = n^4 + 3n^2 + 17. How do I prove f belongs to O(开发者_JAVA技巧g)? Well the definition of Big-O notation is as follows:

If f(n) = 15n^3 + 7n^2 + 34 & g(n) = n^4 + 3n^2 + 17. How do I prove f belongs to O(开发者_JAVA技巧g)?


Well the definition of Big-O notation is as follows:

f is in O(g) <=> there exist c,n0 such that for all n >= n0, |f(n)| <= c|g(n)|

So in this case, you could most easily demonstrate that f is in O(g) by finding appropriate c and n0 satisfying for all n >= n0, |15n^3+7n^2+34| <= c|n^4+3n^2+17|. I guess.

0

精彩评论

暂无评论...
验证码 换一张
取 消