Order of f(n) and g(n): O(n^4) and O(n^2)

  • Thread starter Thread starter Gear2d
  • Start date Start date
Gear2d
Messages
49
Reaction score
0

Homework Statement



What is the order of the two functions:

f(n) = (log(n^3))^4
g(n) = (log(n^7))^2

Homework Equations



http://www.augustana.ca/~hackw/csc210/exhibit/chap04/bigOhRules.html

The Attempt at a Solution



f(n) = (log(n^3))^4 = log(n^3) * log(n^3) * log(n^3) * log(n^3)

g(n) = (log(n^7))^2 = log(n^7) * log(n^7)

Based on the Big Oh rules (the link above) using Log of a Power Rule we see that for one log(n^3) and one log(n^7) the order is O(log n) and O(log n). Now since f(n) is raised to power of 4 the order is now O(log n)^4 and g(n) is raised to power of 2 so O(log n)^2.

Now using Comparison Rule 2 we that f(n) is O(n^4) and g(n) is O(n^2).

Would this reasoning be correct?
 
Last edited:
Physics news on Phys.org
I'm not sure how you used comparison rule 2 to get that. Everything up until there is fine though.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top