Answer on Question #53336 – Math – Algorithms | Quantitative Methods
Question Let f(n)=560n3+3n+107 and g(n)=3n3+5000n2. Which of the following is true?
a) f(n) is O(g(n)), but g(n) is not O(f(n))
b) g(n) is O(f(n)), but f(n) is not O(g(n))
c) f(n) is not O(g(n)), and g(n) is not O(f(n))
d) f(n) is O(g(n)) and g(n) is O(f(n)).
Solution
In computer science "f(n) is O(g(n))" means that f(n) growth asymptotically no faster than g(n). So there exist positive numbers k1 and k2 such that inequalities
k1g(n)≤f(n)≤k2g(n)
hold true.
Search bounds for f(n) and g(n):
f(n)=560n3+3n+107≤560n3+3n3+107=563n3+107≤564n3+107==188⋅3n3+107≤188⋅(3n3+5000n2)=188⋅g(n), hence 1881f(n)≤g(n);g(n)=3n3+5000n2≤3n3+5000n3=5003n3≤5040n3=9⋅560n3≤≤9(560n3+3n+107)=9f(n), hence 91g(n)≤f(n).
We showed that
91g(n)≤f(n)≤188g(n)
and
1881f(n)≤g(n)≤9f(n)
We have polynomial expressions of the same order, hence answer is d) f(n) is O(g(n)) and g(n) is O(f(n)).
Answer: d) f(n) is O(g(n)) and g(n) is O(f(n)).
www.AssignmentExpert.com
Comments