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

  • Thread starter Thread starter Gear2d
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on determining the order of the functions f(n) = (log(n^3))^4 and g(n) = (log(n^7))^2 using Big O notation. It concludes that f(n) is O(n^4) and g(n) is O(n^2) based on the application of the Log of a Power Rule and Comparison Rule 2. The analysis confirms that the logarithmic transformations lead to the correct polynomial orders for both functions.

PREREQUISITES
  • Understanding of Big O notation
  • Familiarity with logarithmic properties, specifically the Log of a Power Rule
  • Knowledge of Comparison Rule 2 in asymptotic analysis
  • Basic calculus concepts related to limits and growth rates
NEXT STEPS
  • Study the application of the Log of a Power Rule in more complex functions
  • Explore additional Comparison Rules for asymptotic analysis
  • Learn about the implications of polynomial growth rates in algorithm efficiency
  • Investigate other logarithmic functions and their orders in Big O notation
USEFUL FOR

Students in computer science, particularly those studying algorithms and complexity theory, as well as educators teaching Big O notation and logarithmic functions.

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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
1K
Replies
17
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K