Question #53336

Let f(n) = 560*n^3 +3*n+107 and g(n) = 3*n^3 +5000*n^2. 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))
1

Expert's answer

2015-07-16T09:22:21-0400

Answer on Question #53336 – Math – Algorithms | Quantitative Methods

Question Let f(n)=560n3+3n+107f(n) = 560n^3 + 3n + 107 and g(n)=3n3+5000n2g(n) = 3n^3 + 5000n^2. Which of the following is true?

a) f(n)f(n) is O(g(n))O(g(n)), but g(n)g(n) is not O(f(n))O(f(n))

b) g(n)g(n) is O(f(n))O(f(n)), but f(n)f(n) is not O(g(n))O(g(n))

c) f(n)f(n) is not O(g(n))O(g(n)), and g(n)g(n) is not O(f(n))O(f(n))

d) f(n)f(n) is O(g(n))O(g(n)) and g(n)g(n) is O(f(n))O(f(n)).

Solution

In computer science "f(n)f(n) is O(g(n))O(g(n))" means that f(n)f(n) growth asymptotically no faster than g(n)g(n). So there exist positive numbers k1k_{1} and k2k_{2} such that inequalities


k1g(n)f(n)k2g(n)k _ {1} g (n) \leq f (n) \leq k _ {2} g (n)


hold true.

Search bounds for f(n)f(n) and g(n)g(n):


f(n)=560n3+3n+107560n3+3n3+107=563n3+107564n3+107==1883n3+107188(3n3+5000n2)=188g(n), hence 1188f(n)g(n);\begin{array}{l} f (n) = 5 6 0 n ^ {3} + 3 n + 1 0 7 \leq 5 6 0 n ^ {3} + 3 n ^ {3} + 1 0 7 = 5 6 3 n ^ {3} + 1 0 7 \leq 5 6 4 n ^ {3} + 1 0 7 = \\ = 1 8 8 \cdot 3 n ^ {3} + 1 0 7 \leq 1 8 8 \cdot (3 n ^ {3} + 5 0 0 0 n ^ {2}) = 1 8 8 \cdot g (n), \text { hence } \frac {1}{1 8 8} f (n) \leq g (n); \end{array}g(n)=3n3+5000n23n3+5000n3=5003n35040n3=9560n39(560n3+3n+107)=9f(n), hence 19g(n)f(n).\begin{array}{l} g (n) = 3 n ^ {3} + 5 0 0 0 n ^ {2} \leq 3 n ^ {3} + 5 0 0 0 n ^ {3} = 5 0 0 3 n ^ {3} \leq 5 0 4 0 n ^ {3} = 9 \cdot 5 6 0 n ^ {3} \leq \\ \leq 9 (5 6 0 n ^ {3} + 3 n + 1 0 7) = 9 f (n), \text { hence } \frac {1}{9} g (n) \leq f (n). \end{array}


We showed that


19g(n)f(n)188g(n)\frac {1}{9} g (n) \leq f (n) \leq 1 8 8 g (n)


and


1188f(n)g(n)9f(n)\frac {1}{1 8 8} f (n) \leq g (n) \leq 9 f (n)


We have polynomial expressions of the same order, hence answer is d) f(n)f(n) is O(g(n))O(g(n)) and g(n)g(n) is O(f(n))O(f(n)).

Answer: d) f(n)f(n) is O(g(n))O(g(n)) and g(n)g(n) is O(f(n))O(f(n)).

www.AssignmentExpert.com


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS